drh
dc3bb0deb2
Use an unsigned integer to accumulate the string hash. Avoids compiler
...
warnings.
FossilOrigin-Name: b1824344ea4918a13abbda4a3b7134d35fd867c4
2014-01-24 16:36:18 +00:00
drh
9e2c7ae1b0
Add a few more CTE test cases to closure.test.
...
FossilOrigin-Name: 1b6405d9788c1bb89761b2bcdce560a5020ff503
2014-01-24 15:42:51 +00:00
drh
3c2aeae16e
Add test cases that compare the performance of the transitive_closure
...
virtual table again common table expressions for walking a tree.
FossilOrigin-Name: 9a23f020e8ed0e7a1ad227b4ab379fdf5e2de222
2014-01-24 14:37:44 +00:00
drh
b090352b5a
Add test cases showing the use of ORDER BY on a recursive query to control
...
depth-first versus breath-first search of a tree.
FossilOrigin-Name: 83b0b2916589db0184435dbd4c304387f393ed60
2014-01-24 11:16:01 +00:00
dan
afcf9bd806
Modifications to test files to omit any tests that intentionally access out-of-bounds locations in clang -fsanitize=address builds.
...
FossilOrigin-Name: f4a701d55f5c4e1e62ed64b779ad4fff89dd31b7
2014-01-23 14:44:08 +00:00
dan
cfe24586a8
Avoid an extra seek when inserting records into the epheremal index used to ensure that rows returned by UNION recursive queries are unique.
...
FossilOrigin-Name: 72c4b3f07a3faacb5b62d5bc374b4e125a0bd8b3
2014-01-22 19:23:30 +00:00
drh
edf83d1e3d
Fix harmless compiler warnings.
...
FossilOrigin-Name: dea2ca6a159d5dcfd8deceedf1c2a73fb4ac1cfc
2014-01-22 18:31:27 +00:00
drh
953dfa4e60
Change the WITH RECURSIVE implementation to use a queue instead of a pair of
...
tables. Add support for ORDER BY, LIMIT, and OFFSET on recursive queries.
FossilOrigin-Name: b6cea42006910d590373e8f9e296d7672edb114b
2014-01-22 18:16:27 +00:00
drh
aa9ce7078a
Add support for LIMIT and OFFSET in a recursive query.
...
FossilOrigin-Name: 1945484e6b9769c1943f750f5b09860417fb190a
2014-01-22 18:07:04 +00:00
dan
a8a0617e06
Update the spellfix virtual table to optimize queries of the form "SELECT ... FROM tbl WHERE rowid=?".
...
FossilOrigin-Name: a0ba55ff0596c5f15e9cdb254c68ef50df2dfaad
2014-01-22 17:43:16 +00:00
drh
fe1c6bb9c2
Get ORDER BY working for recursive queries.
...
FossilOrigin-Name: 37b343b01841b338954ddfa9b76d92aa50037aec
2014-01-22 17:28:35 +00:00
drh
781def29c7
Add new SelectDest codes, SRT_Queue and SRT_DistQueue in anticipation of adding
...
ORDER BY support on recursive queries. Factor out the recursive query
code generator into a separate procedure.
FossilOrigin-Name: 3eb5f9f8d6ac1ee145cb4119087c516f66fe1456
2014-01-22 13:35:53 +00:00
dan
41028151be
Fix a typo in a comment. No changes to code or tests.
...
FossilOrigin-Name: cceacc0e79c4e54682daddf2056c6bb8e88d9484
2014-01-22 10:22:25 +00:00
drh
340309fd69
Remove an unnecessary parameter from selectInnerLoop(). Clean up comments.
...
FossilOrigin-Name: 5e6c4a55f6df30da9dbaa8170f3223613cc86f65
2014-01-22 00:23:49 +00:00
drh
e73f059093
Change the recursive common table expression algorithm to use a queue instead
...
of a pair of tables. Runs about 25% faster on the sudoku solver query.
The OP_SwapCursors opcode is no longer required. The current implementation
uses just a fifo, but the plan is to change it into a queue that will support
ORDER BY and LIMIT in a recursive query.
FossilOrigin-Name: b2671e1133d2f1fbd36e7cd4b86d6cc7b528aa97
2014-01-21 22:25:45 +00:00
dan
8561c81ed6
Remove the undocumented requirement for applications that use an SQLITE_ENABLE_SQLLOG build to define a sqlite3_init_sqllog() function.
...
FossilOrigin-Name: 5e43bf013253921e4dfbe71de11ee7ed4b3e7eae
2014-01-21 15:04:47 +00:00
dan
a4ff825095
In where.c, do not allocate space in sqlite3_index_info structures for the internal WHERE clause "terms" generated to record column equivalencies.
...
FossilOrigin-Name: 7d9e22187daaa3160b875a1df17b924969bf718e
2014-01-20 19:55:33 +00:00
dan
7df42aba12
Handle a few obscure problems that could manifest if a database corrupted in a certain way was written by a connection in the middle of a SELECT statement on the same db.
...
FossilOrigin-Name: eba8a564e62f84a9620008beead80081fe90a1b7
2014-01-20 18:25:44 +00:00
drh
c25e2ebc01
Remove an unused #define and add an assert(), both associated with WITH logic.
...
FossilOrigin-Name: a06235e0f6aa1e8fefa3f2873ee035eac9dac750
2014-01-20 14:58:55 +00:00
dan
7f3068aa83
Do not run the tests in with2.test with SQLITE_OMIT_CTE builds.
...
FossilOrigin-Name: 8a973912e98c9b1bb9d3f914527d35c1e7f2011a
2014-01-20 14:17:08 +00:00
drh
717c09c4a9
Add a sudoku solver to the recursive query tests in with1.test.
...
FossilOrigin-Name: 679eff8759aa25368b977c0d26b78a9fcd9486f5
2014-01-18 18:33:44 +00:00
dan
1fe3c4b526
Add extra test cases. No changes to code.
...
FossilOrigin-Name: d38d485e581dab99a3ee6b348da8ddaf9b379ff2
2014-01-18 15:59:35 +00:00
drh
75303a2c68
Add asserts() for a couple of unreachable conditions. Add the Mandelbrot Set
...
query as a test case.
FossilOrigin-Name: 2ad4583c0cc7988f0dfe78fd0a2eb0fdb92d835a
2014-01-18 15:22:53 +00:00
dan
ebbf08a012
Avoid spurious "no such table" errors in statements of the form "INSERT INTO tbl WITH xxx AS (...) SELECT * FROM xxx".
...
FossilOrigin-Name: cccff8a0b427feb05cc8952a765b829e731394fd
2014-01-18 08:27:02 +00:00
dan
7c82932723
Add extra tests to with2.test.
...
FossilOrigin-Name: eecc325afd72e37d7d565787c8cea68aad6d7a5c
2014-01-17 20:36:17 +00:00
drh
c59731c4ae
Minor simplification of error message text for a couple of errors associated
...
with WITH clause processing.
FossilOrigin-Name: 2031004d960526d6426d50d7b732f37b281534e2
2014-01-17 18:34:28 +00:00
dan
98f45e53a7
Resolve table names within CTEs in the context in which the CTE is declared, not the context in which it is used.
...
FossilOrigin-Name: a7323838bbd354a1c2f339e5e0f164f0eada47b3
2014-01-17 17:40:46 +00:00
drh
a026b98500
Add tests that verify that keywords WITH, WITHOUT, and RECURSIVE can still
...
be used as table and column names.
FossilOrigin-Name: 9ca18a0191db6a9b0763e2f0b3b35d23099fb71b
2014-01-17 16:19:01 +00:00
drh
6785bcca58
Fix a compiler warning in selectPopWith().
...
FossilOrigin-Name: c8eb11635a356182611ce2ccb8f358b6c453486e
2014-01-17 15:27:00 +00:00
dan
718569443d
Add support for common table expressions (WITH clauses).
...
FossilOrigin-Name: 0171e3bb4f663a9414b0e8b64c87b5d0683855b5
2014-01-17 15:15:10 +00:00
dan
b290f11775
Fix some problems to do with WITH clauses and name resolution.
...
FossilOrigin-Name: 6a549187ed8b5ed50daefa676ff666ae2ed43346
2014-01-17 14:59:27 +00:00
dan
2d4dc5fc60
Remove some code from resolve.c that was only required for recursive cte references in sub-queries. Also a stray "finish_test" command in pagerfault.test.
...
FossilOrigin-Name: f68c6c4d36481526a9348244adc571ea282dc9eb
2014-01-17 11:48:24 +00:00
drh
65a2aaa633
Add the ability for the authorizer callback to disallow recursive
...
queries.
FossilOrigin-Name: 9efc120a1548c03f3d8aabbadf1050ff2a119c31
2014-01-16 22:40:02 +00:00
drh
727a99f1e3
Tweaks to error message text.
...
FossilOrigin-Name: 090a77d97808b86d1e9f5c63c743a2b159a15f5d
2014-01-16 21:59:51 +00:00
dan
f2655fe8b6
Improve the error messages used to report illegal recursive cte references.
...
FossilOrigin-Name: 54eee9fe99290e59469bd3e1a66bb749887d37ee
2014-01-16 21:02:02 +00:00
dan
eae73fbfb9
Allow only a single recursive reference in a recursive CTE. Also require that this reference is not part of a sub-query.
...
FossilOrigin-Name: a296b73360d34c9364eceb2cc09a9a92adc4abb8
2014-01-16 18:34:33 +00:00
drh
6ade453cd8
Always use available indices to optimize LIKE operators even if the pattern
...
of the LIKE operator has a COLLATE modifier. This fixes an ineffiency that
was introduced into 3.7.15 by check-in [8542e6180d4] on 2012-12-08.
FossilOrigin-Name: 16bd54783a3f5531c55564ddefdada657c078eb0
2014-01-16 15:31:41 +00:00
dan
8290c2ad5a
Disable the flattening optimization if the parent query is the recursive part of a recursive CTE and the sub-query is a compound query.
...
FossilOrigin-Name: 6bfa387e82de47ca1f40225fe28d873e29d6f481
2014-01-16 10:58:39 +00:00
drh
7b19f25247
Merge trunk changes. Fix a possible NULL-pointer deference in WITH clause
...
name resolution.
FossilOrigin-Name: 7f953b568baa3eede0b9c144be0b9bc86496341a
2014-01-16 04:37:13 +00:00
drh
93c36bb399
Remove an ALWAYS() that is no longer always true.
...
FossilOrigin-Name: c95823cd451f7721174393817a801403647467db
2014-01-15 20:10:15 +00:00
dan
eede6a538d
Fixes so that SQLITE_OMIT_CTE builds work.
...
FossilOrigin-Name: 3908e2ea2e7e5f466cbbbffdc27e0fe8dc9751ac
2014-01-15 19:42:23 +00:00
drh
c49832c208
Further comments on WITH-clause processing routines in select.c.
...
FossilOrigin-Name: c948384dfdd9f68a832d5a452af44f35337f66e7
2014-01-15 18:35:52 +00:00
drh
60c1a2f0b5
Add a header comment to the searchWith() routine.
...
FossilOrigin-Name: d9ae0f5d9f8230ca7ca10ebed300e2f6635a0614
2014-01-15 18:23:00 +00:00
dan
62ba4e418d
Disable automatic indices on recursive CTE references.
...
FossilOrigin-Name: 28aa6db8c878655255dbfb618f8d65be78e3d7e5
2014-01-15 18:21:41 +00:00
dan
f43fe6e9f6
When resolving names, consider a reference to a recursive CTE column as equivalent to a reference to the outermost name-context. This ensures that correlated sub-queries are correctly identified as such.
...
FossilOrigin-Name: 61be2da0ae623c1572819481508b044e9d32f294
2014-01-15 18:12:00 +00:00
dan
60e7068d75
Return an error if a CTE specifies a different number of columns than its SELECT statement returns.
...
FossilOrigin-Name: 9a514b50e4b01f109fbdb0aabcbfe1ddab129b44
2014-01-15 15:27:51 +00:00
drh
a379b32f33
Don't try to verify the schema of transient table (such as generated inside
...
a WITH clause) when generating code for "IN table" operators.
FossilOrigin-Name: 860aa936634a60d68e3954fc408a96a9260394e0
2014-01-15 14:40:41 +00:00
dan
bfe31e7f80
Disable the flattening optimization if the sub-query is a recursive CTE.
...
FossilOrigin-Name: 9472f6d820a7fb233936d9b8f7a39c9d4c4d6d73
2014-01-15 14:17:31 +00:00
drh
f9db522fee
Use the user-supplied table name in WITH RECURSIVE tables as the internal
...
name of the table and the name of the table in VDBE comments.
FossilOrigin-Name: a29330238be6366444269a0b1b328475b2d01ae2
2014-01-15 02:40:11 +00:00
dan
8ce7184bc2
Add code to handle recursive CTEs.
...
FossilOrigin-Name: a5c2a54a07d35166911abc792008c05dea897742
2014-01-14 20:14:09 +00:00