Commit Graph

45 Commits

Author SHA1 Message Date
drh
b1ec87afdb When checking for the WHERE-clause push-down optimization, verify that
all terms of the compound inner SELECT are non-aggregate, not just the
last term.  Fix for ticket [f7f8c97e97597].

FossilOrigin-Name: ec215f94ac9748c0acd82af0cc9e7a92249462f9
2016-04-25 02:20:10 +00:00
drh
0ff47e9e1b Implement FROM-clause subqueries as co-routines whenever they are guaranteed
to be the outer-most loop of the join.

FossilOrigin-Name: c7bae50bdccb5bcf3bc22e8ac5bb6725ef13db39
2016-03-15 17:52:12 +00:00
drh
2fade2f791 Make sure every co-routines has its own set of temporary registers and does
not share temporaries, since a co-routine might expect the content of a
temporary register to be preserved across an OP_Yield.
Proposed fix for ticket [d06a25c84454a].

FossilOrigin-Name: ca72be8618e5d466d6f35819ca8bbd2b84269959
2016-02-09 02:12:20 +00:00
drh
00d5ab7405 Fix handling of queries with VALUES on the left and UNION ALL SELECT on the
right and a LIMIT clause.

FossilOrigin-Name: c403502cdce8b82e570e6fc49ab7f5144800c189
2015-05-20 00:15:27 +00:00
drh
9b40e474ef Remove a faulty assert() statement.
FossilOrigin-Name: 5f2539da8cb9df99029ab4ab7023804722697673
2015-05-07 00:09:29 +00:00
drh
9af8646dce Fix a faulty assert() in the SELECT code generator and add a test case
to prevent regression.

FossilOrigin-Name: 1421c8ffba179d6aafa2643012f80a2738779117
2015-05-04 16:09:34 +00:00
drh
60f4e0918d Test case for the previous check-in.
FossilOrigin-Name: a526f58bc96c0fdead51b6bd9aafea7b48bf398e
2015-04-21 02:17:30 +00:00
drh
7b4da150da Always resolve symbols in all ORDER BY clauses of a compound-SELECT, even
illegal ORDER BY clauses.

FossilOrigin-Name: 6c39ef73d5899eabdb46db50c2b00c2d8381a41a
2015-04-17 18:52:37 +00:00
drh
a276e3fd4d Fix a faulty assert() in the compound-SELECT code generator.
FossilOrigin-Name: 10715b05f2201a63dca317f99ce39d3ce182e182
2015-04-16 16:22:27 +00:00
drh
772460fd4c Improvements to the way VALUES clauses are parsed.
FossilOrigin-Name: ec5a493ad27593ca78899b3001630c1898b940ff
2015-04-16 14:13:12 +00:00
drh
3dc4cc66b3 Change the multiSelectOrderBy() routine to return non-zero if there has
been any prior error.

FossilOrigin-Name: 14784c317bff05dd0a74e2596432dfd12c139391
2015-04-15 07:10:25 +00:00
drh
1978d171cb When adding the implied "LIMIT 1" to the end of a scalar subquery, make sure
that subquery is not a VALUES-only query as such queries cannot deal with
LIMIT clauses.

FossilOrigin-Name: 7c27310bdf6b4af44a0811a2787ed64966d720d2
2015-04-15 05:20:44 +00:00
drh
2af878ec5e New requirements marks on compound SELECT statements.
FossilOrigin-Name: e7991bc510f63f3594603a91f6f3b32e94d90e72
2015-03-05 01:29:51 +00:00
drh
c0bf493ea5 Make sure a multi-row VALUES clause works correctly in a compound SELECT.
FossilOrigin-Name: 85b355cfb40e8dbeb171980204ffad897184063f
2014-02-19 01:31:02 +00:00
drh
c724008b26 Add a test case for ticket [3557ad65a076c].
FossilOrigin-Name: 4f34d7077b9acf7926c5e7375ca870d4ed3c60b9
2012-03-03 01:44:12 +00:00
drh
10c081adf8 In a 3-fold compound SELECT make sure early code generation of the SELECTs
to the right do not dereference non-existant columns in SELECTs on the left. (CVS 6511)

FossilOrigin-Name: 414f340809c487901fa913026a342b19a2956c0a
2009-04-16 00:24:23 +00:00
danielk1977
de3e41e304 Fix (make test) with SQLITE_OMIT_COMPOUND_SELECT. Ticket #3235. (CVS 5530)
FossilOrigin-Name: 9ca975c8fdeaae7d5af8fe62e097d8d251362cfe
2008-08-04 03:51:24 +00:00
mihailim
29b13cc9d9 Fixed typo to close #1731. (CVS 5302)
FossilOrigin-Name: 9902be8d66453d3f4cfdc7f81a4ebe9bc6729204
2008-06-25 08:02:44 +00:00
drh
ad27e76110 Make sure an imbalance in the number of columns on a compound SELECT is
detected and reported as an error before it can cause an assertion fault
or array-bounds overflow in the code generator.
Oops: part of the fix for ticket #3015 got included with this
check-in by mistake. (CVS 4917)

FossilOrigin-Name: 50de87dc808820a70d3a99277f532e418a2f97e2
2008-03-26 12:46:23 +00:00
danielk1977
24acd8f939 Use 1<<$x instead of pow(2,$x) in the test suite code. (CVS 4715)
FossilOrigin-Name: 3a289b6d28bcf399845586b15f100d7c3a78b550
2008-01-16 18:20:41 +00:00
drh
b765411161 Continuing work toward converting the VM into a register machine. (CVS 4707)
FossilOrigin-Name: a6dddebcc5ccbbf3009c9d06163a8b59036331de
2008-01-12 12:48:07 +00:00
danielk1977
01874bfc51 Adjust the test suite to account for recent changes related to #2822. Most changes are related to English language error messages only. (CVS 4622)
FossilOrigin-Name: 2f88b9b3e3c9abc3ae4a5dcef82707dd74f8aace
2007-12-13 07:58:50 +00:00
drh
1e281291fb ORDER BY in a compound SELECT will first match against the left-most SELECT.
If there is no match there, it begins working its way to the right. (CVS 4621)

FossilOrigin-Name: 56063ec84b130bcdb0e90bc76fabca394d0d867f
2007-12-13 03:45:07 +00:00
danielk1977
70517ab9a1 Further modifications to do with ORDER BY and compound SELECT queries. Related to ticket #2822. (CVS 4606)
FossilOrigin-Name: 0d9b0e6e3a8f8a66956878084085842e94c3cb2f
2007-12-10 18:51:47 +00:00
drh
4c77431448 Better resolution of ORDER BY terms in compound queries. Candidate
solution for ticket #2822.  Needs more testing and documentation
before going final. (CVS 4602)

FossilOrigin-Name: 62a78d212c53a9cb1759d03134653a75f3a086b6
2007-12-08 21:10:20 +00:00
danielk1977
4b2688ab31 Modifications so that compilation and testing with the various OMIT macros defined works. (CVS 3276)
FossilOrigin-Name: c6ea353bd9f5fe6c9cc3349d2034ada283f9c80e
2006-06-20 11:01:07 +00:00
drh
923782530b SQLite now always chooses the column names for compound selects using
the left-most select.  This makes SQLite work like other SQL database,
but it also is a change from historical behavior and may break some
scripts.  Ticket #1721. (CVS 3153)

FossilOrigin-Name: 80cda9f7ce83f2de6cd2fdaf6150bbc35b670fee
2006-03-26 01:21:22 +00:00
danielk1977
e61b9f4f3c Modify test scripts to work when SQLITE_OMIT_SUBQUERY (but no other OMIT macros) is defined. (CVS 2252)
FossilOrigin-Name: d4e19efcef68d834c55c7d496cdb3696d63a31a2
2005-01-21 04:25:47 +00:00
danielk1977
27c774388a Ensure tests pass when SQLITE_OMIT_COMPOUND_SELECT is defined. (CVS 2138)
FossilOrigin-Name: 007be591b7829f9ff38e4b14ba5a5043796c2ff3
2004-11-22 13:35:41 +00:00
drh
5f3b4ab53c Remove the COPY command. (CVS 1477)
FossilOrigin-Name: 287f86731c71401dbac098e08357367b4f8e5a43
2004-05-27 17:22:54 +00:00
danielk1977
3d1bfeaa22 Implement type affinity for table and index records (CVS 1375)
FossilOrigin-Name: dbfe6e93166d9557d66cab9dca7977baa3501e5e
2004-05-14 11:00:53 +00:00
danielk1977
452c989fd8 Manifest types in indices. At the moment indices use manifest typing, but
some other parts of the SQL engine do not, which can lead to some strange
results. (CVS 1368)

FossilOrigin-Name: 9f2b6d9d3a07e25fcdb7e8290da7a182a65c37b2
2004-05-13 05:16:15 +00:00
drh
bb999ef6fa Make the GROUP BY clause work even if there are no aggregate functions. (CVS 859)
FossilOrigin-Name: b68792315883eed8523f5e11856ec8378dc972c1
2003-02-02 12:41:25 +00:00
drh
f46f905a1e An optimization: avoid the use of an intermediate table on UNION ALL if there
is no ORDER BY clause. (CVS 637)

FossilOrigin-Name: 8aa73ce61268a50d353d9a5c878461290195525f
2002-06-22 02:33:38 +00:00
drh
c926afbc2d Fix for ticket #73: The ORDER BY clause is significant for subqueries.
This passes all regression tests, but more testing is needed to exercise
all paths through the new code. (CVS 631)

FossilOrigin-Name: 43c5aff5d078bce9292683cd40311e0dcc81ac14
2002-06-20 03:38:26 +00:00
drh
e4de1feb3e Enhance the ORDER BY clause so that an integer term means to sort by the
corresponding column. (CVS 602)

FossilOrigin-Name: 7acbf84b492202d8b5a05276a95b475027eb5f58
2002-06-02 16:09:01 +00:00
drh
f570f011eb Refinements to NULL processing: NULLs are indistinct for DISTINCT and UNION.
Multiplying a NULL by zero yields zero. In a CASE expression, a NULL comparison
is considered false, not NULL.  With these changes, NULLs in SQLite now work
the same as in PostgreSQL and in Oracle. (CVS 600)

FossilOrigin-Name: da61aa1d238539dff9c43fd9f464d311e28d669f
2002-05-31 15:51:25 +00:00
drh
bb113518f9 Bug fixes and additional test cases for the distinct-NULL patch. (CVS 592)
FossilOrigin-Name: 0e268d0c0faa02c3f95e1567cf631b7a04bfbdf0
2002-05-27 01:04:51 +00:00
drh
f5905aa7be NULL values are distinct. A comparison involving a NULL is always false.
Operations on a NULL value yield a NULL result.  This change makes SQLite
operate more like the SQL spec, but it may break existing applications that
assumed the old behavior.  All the old tests pass but we still need to add
new tests to better verify the new behavior.  Fix for ticket #44. (CVS 589)

FossilOrigin-Name: 9051173742f1b0e15a809d12a0c9c98fd2c4614d
2002-05-26 20:54:33 +00:00
drh
01f3f25376 Add support for the full SQL join syntax. This is just a parser enhancement.
We now recognize all kinds of joins, but we don't actually do anything with
them yet. (CVS 586)

FossilOrigin-Name: e238643efdbe1394c7ff85e34e486f7c6082b6cc
2002-05-24 16:14:15 +00:00
drh
41202ccae2 Fix for ticket #22: In the code generator for compound SELECT statements, take
care not to generate column name headers if the output is an intermediate table.
Otherwise the column headers are not generated correctly if a compound SELECT
statement appears as an expression in part of the WHERE clause. (CVS 543)

FossilOrigin-Name: a06d9acdd5af0dc69b3a4d024de082631254aead
2002-04-23 17:10:18 +00:00
drh
b19a2bc603 Disclaimed copyright. Preparing for release 2.0. (CVS 250)
FossilOrigin-Name: 4e926efe2b59adfec4086eb1d2ba830238facb4c
2001-09-16 00:13:26 +00:00
drh
4cfa793437 :-) (CVS 81)
FossilOrigin-Name: 61c381e7e6c85619b7b494417956fc209c5b7b84
2000-06-08 15:10:46 +00:00
drh
92cd52f5b6 :-) (CVS 77)
FossilOrigin-Name: b3fb15ccde399318bde8c87362ecaa3a744f0680
2000-06-08 01:55:29 +00:00
drh
92dba24b69 :-) (CVS 76)
FossilOrigin-Name: 19029233082e319d4bfd94b22a694c917d8f0296
2000-06-08 00:28:51 +00:00