Commit Graph

12048 Commits

Author SHA1 Message Date
drh
60830e3c53 Improvements to a "Synopsis:" comment in the VDBE engine.
FossilOrigin-Name: 0dfa7ee9157ea6b1c745732d6c3fcd066cf4f849
2014-02-10 15:56:34 +00:00
drh
53a6eb3f3c Faster implementation for sqlite3MulInt64().
FossilOrigin-Name: 010c48f671e909cb406f3716102a0032bc72a592
2014-02-10 12:59:15 +00:00
drh
1b27b8c0a0 Faster and smaller implementation of sqlite3_value_type().
FossilOrigin-Name: 5708bc24b8cab623b833121183042b43e5a7021b
2014-02-10 03:21:57 +00:00
drh
5574e3f456 Add a compound-query test to the speedtest1 test program.
FossilOrigin-Name: 532995759114ab7a7cba18cc9d8820d78eb1a96e
2014-02-09 23:59:28 +00:00
drh
d227a291b2 Use the WITH clause to help resolve names for SELECT statements on the left
of a compound query.  Proposed fix for ticket [31a19d11b97088296a].

FossilOrigin-Name: 67bfd59d9087a987f15f6148efa1ff104983e1fb
2014-02-09 18:02:09 +00:00
drh
fa46bfbbc5 Add the Mandelbrot Set testcase to the "cte" testset of speedtest1.
FossilOrigin-Name: 56febbeb575a298ae8839b3a59711150ceb9999d
2014-02-09 00:52:53 +00:00
drh
c47548057d Add a new "testset" to the speedtest1 program: The sudoku solver.
FossilOrigin-Name: 4677ef2f8a726573c48ee2e532c00a68308dd7e1
2014-02-09 00:18:21 +00:00
drh
5f61229504 Do away with the "multi-register pseudo-table" abstration. Instead, just
use an OP_SCopy to load results directory from the result registers of
the co-routine.

FossilOrigin-Name: 1e64dd782a126f48d78c43a664844a41d0e6334e
2014-02-08 23:20:32 +00:00
drh
826af37865 Change the OP_Found opcode so that it expands zero-blobs prior to comparing
them.  Fix for ticket [fccbde530a6583b]

FossilOrigin-Name: e2303d1b0c17b6e7494fb7db8264f4c2ac193723
2014-02-08 19:12:21 +00:00
drh
c0740cebeb Fix a harmless compiler warning in VS2013.
FossilOrigin-Name: 83116ee3e0f2b9110c70a4f73a9badc9c2a56f28
2014-02-08 13:24:04 +00:00
drh
04d0bcd533 Fix a harmless compiler warning in VS2013.
FossilOrigin-Name: 35f2793db5eb58484554477a23f8320843ebcd71
2014-02-08 13:22:36 +00:00
drh
725de29a2d Tweaks to the generated VDBE code to make it a little easier to follow.
FossilOrigin-Name: 129217ee91782ec77ff82661753ae5bee8ca99d0
2014-02-08 13:12:19 +00:00
drh
e0e261a473 Enable constant expression factoring even if no tables are read and no
transaction is started.

FossilOrigin-Name: a45b87713c0afca2be2ace9500513620a024c0a2
2014-02-08 04:24:37 +00:00
drh
aceb31b120 Change the OP_Trace opcode to OP_Init and give it the ability to jump to the
initialization code at the bottom of the program, thus avoiding the need for
an extra OP_Goto.

FossilOrigin-Name: 192dea97316144f15f6dd0eabff08a0bf9ef203e
2014-02-08 01:40:27 +00:00
drh
642364a48b Add opcodes OP_InitCoroutine and OP_EndCoroutine. Use these to remove the
need for separate boolean registers to record when a co-routine has finished.

FossilOrigin-Name: 5a88b6a7aef3a0d5380e19eee2ee38439cc9b08b
2014-02-07 22:21:07 +00:00
drh
dddf6978d2 Fix redundant definitions of _LARGE_FILE and _LARGEFILE_SOURCE.
FossilOrigin-Name: 4043d879795bfad55af35e9cb48e0a42eb4087ae
2014-02-07 19:33:31 +00:00
drh
a198f2b55d In the TCL bindings, make sure Tcl_AppendResult() is always terminated
by "(char*)0" and not just "0".

FossilOrigin-Name: ea4d23d1c0df4fde2e532daa081888712f465884
2014-02-07 19:26:13 +00:00
drh
ed71a839fd Change the OP_InitCoroutine instruction to jump over the co-routine
implementation.

FossilOrigin-Name: a522f364a6b8ca6f69c353b30609a2166f6e94cf
2014-02-07 19:18:10 +00:00
drh
81cf13ec7b Get rid of the OP_Undef and OP_IsUndef opcodes in favor of higher-level
OP_InitCoroutine and OP_EndCoroutine.

FossilOrigin-Name: 1ec0e9dd4b26d9f597adc8e062317d4866c5a6a6
2014-02-07 18:27:53 +00:00
drh
a5750cfe01 Add the OP_Undef and OP_IsUndef opcodes. With these, use the first register
in the result register range as the flag to indicate EOF on an INSERT from
a SELECT, rather than allocating a separate boolean register for that task.

FossilOrigin-Name: 6fb7448550f28a3c93053e125faeaf11de1011d0
2014-02-07 13:20:31 +00:00
mistachkin
21a919f630 More comment updates. No changes to code.
FossilOrigin-Name: be24fbc22106e508975e316abe0471edd3833291
2014-02-07 03:28:02 +00:00
drh
0fd613542c Update comments in vdbe.c. No changes to code.
FossilOrigin-Name: 1122b410de68a3c79b4c719a3a4cc4dc6a5bb39d
2014-02-07 02:29:45 +00:00
drh
b22f7c831f Delete the OP_VerifySchema opcode. Enhance OP_Transaction to do the schema
version checks that OP_VerifySchema used to do.

FossilOrigin-Name: 2f3376ebf13df44e6acf27cb1f07172cd8b34033
2014-02-06 23:56:27 +00:00
drh
0211d8bca4 Change the spellfix1 virtual table to deterministically names its shadow
tables.

FossilOrigin-Name: 5219cdfc56ec3e1cd645ae6443ba72ce0df0339a
2014-02-06 13:18:51 +00:00
drh
4bbcf10617 Add additional error messages and a progress spinner to the ".clone" command.
FossilOrigin-Name: dd0db3f0cef1be46cea16d4e61ea3348b3b3bd3e
2014-02-06 02:46:08 +00:00
mistachkin
e31ae90100 Rename the '.repair' shell command to '.clone'.
FossilOrigin-Name: 4f9d95624ae4e123f83c835b5940f64d4a47be0d
2014-02-06 01:15:29 +00:00
drh
3350ce95f7 Add the ".repair" command to the command-line shell.
FossilOrigin-Name: d1dfadea87ecf18eeb6d2f21769deaa97473ca0e
2014-02-06 00:49:12 +00:00
mistachkin
5dfd3d9080 In the Win32 VFS, the winSysInfo variable should be static.
FossilOrigin-Name: 4a4dd371a72b7d475185923bebb4cd9bd83e1bd9
2014-02-05 11:05:47 +00:00
drh
e08ecad58a Do not mark the ephemeral tables used to hold the RHS of IN clauses as
unordered because the NGQP will use those ephemeral tables to help order the
output.  This is not an issue for standard SQLite since ephemeral tables
there are always ordered, regardless of the hint.  It only affects systems
that substitute an alternative storage engine.

FossilOrigin-Name: f2504089df0bf4011864e67825b37f6aa3d03458
2014-02-04 23:45:45 +00:00
drh
ee06c99b49 Remove the SF_Materialize flag from the SELECT object as it does not
accomplish anything useful.

FossilOrigin-Name: 65d5dcddbd34dfb2733a7a908c7c652ce2d610fe
2014-02-04 20:46:41 +00:00
drh
7df89c8c8a Rearrange fields in the Parse object for a tighter packing, resulting in
an 8% size reduction on x64.

FossilOrigin-Name: 3e1a3f68d7457ff708222a3448404b593f018fc2
2014-02-04 15:55:25 +00:00
drh
fe21a796f7 Performance optimizations in sqlite3PcacheFetch().
FossilOrigin-Name: b60cc11ef775c23a2245d9e7a00dab34013f3ccb
2014-02-03 17:04:29 +00:00
drh
e39a732ce2 Provide hints to the btree layer Next and Previous primitives to let them
know if they can be no-ops if the underlying index is unique.

FossilOrigin-Name: 6c643e45c274e755dc5a1a65673df79261c774be
2014-02-03 14:04:11 +00:00
drh
6645370e5b Version 3.8.3
FossilOrigin-Name: e816dd924619db5f766de6df74ea2194f3e3b538
2014-02-03 13:52:03 +00:00
drh
dd31490e02 Minor change to TEA extension docs in an attempt to make links work correctly.
FossilOrigin-Name: af3c775e5d6a399bfc985a5dae27451908766546
2014-02-03 13:49:40 +00:00
drh
d49c545968 Update the "sqlite3.1" unix manpage document.
FossilOrigin-Name: 21ce9e3a53aed62fbe075b0dbed9faa00218aadc
2014-01-31 11:50:20 +00:00
mistachkin
a3fdec7172 Minor change to TEA extension docs in an attempt to make links work correctly.
FossilOrigin-Name: 492585c8208457120dde24f5fbf4db7e4e10ae73
2014-01-31 06:35:37 +00:00
drh
bb44b3de39 Update evidence marks on SELECT tests. Comment changes only.
No changes to code or tests.

FossilOrigin-Name: 1973d80e474cb95d053e04415b22154897d4d710
2014-01-30 17:47:02 +00:00
drh
9a2555f538 Fix requirements marks only. No changes to code or tests.
FossilOrigin-Name: 4a34378b9b02e463081729186dcb9b0404dbcd06
2014-01-30 15:03:50 +00:00
drh
a88aca5442 Update a requirement mark and add some additional test cases to cover
the requirement associated with ORDER BY and LIMIT on compound SELECT
statements.

FossilOrigin-Name: 8560091e85f2f99a24810648868bf2e081c32698
2014-01-30 14:10:00 +00:00
mistachkin
b8e59bcb86 Enhance the MSVC makefile for better debugging symbol support.
FossilOrigin-Name: c9bef0f29a5a7f04914d80e58105104babd4168c
2014-01-30 12:45:32 +00:00
dan
81a034b62b Do not run test script mmapfault.test as part of the "inmemory_journal" permutation test.
FossilOrigin-Name: b222b61a98dc1f3c2c48ea06efe7d82d9fcf4d75
2014-01-30 12:16:23 +00:00
mistachkin
b04275121c Enhance the MSVC makefile for better debugging symbol support.
FossilOrigin-Name: c723ec2784d6b60c9781a435c84800b2bc7818d5
2014-01-30 11:12:52 +00:00
drh
ec2da85412 Make sure that sqlite3SelectDup() initializes the nSelectRow of the
duplicate Select object.

FossilOrigin-Name: 5bb29b82109224a2ad02920658fabd8fb0f27b3f
2014-01-29 01:46:12 +00:00
drh
db718d8a3b Fix harmless compiler warnings in the showdb utility program.
FossilOrigin-Name: 27c27daa3324b7c9323acfb972330367630bb64e
2014-01-28 20:36:22 +00:00
drh
4d06798e56 Fix a potential over-size and hence undefined shift operation.
FossilOrigin-Name: 6379b0729521146bc4ec27a9924492c7dc1d8a31
2014-01-28 18:53:29 +00:00
dan
9c2552f2e8 Minor bugfix in main.c so that the library builds with SQLITE_OMIT_WSD defined.
FossilOrigin-Name: 5e3b9ecc7b2b2e50952de819b99bafdb7b9ff59e
2014-01-28 17:49:13 +00:00
dan
705a48758a Fix a couple of problems with new test scripts causing the permutations test to fail.
FossilOrigin-Name: 48d736c0ee1ac0879bd12d2f1901f208e87e538a
2014-01-27 16:35:15 +00:00
drh
a820c05aa0 Update some requirements marks to conform with improvements
in the documentation.

FossilOrigin-Name: be1acb610f7e594b417dd8409b7a7aa8f3af5f77
2014-01-27 15:02:07 +00:00
dan
d0879bad42 Fix a problem in pagerfault.test causing an assert() to fail.
FossilOrigin-Name: ba8d2d507f82e2baaceadcf7ac6d71bb91f7e06b
2014-01-27 14:19:22 +00:00
drh
729677720d Fix (harmless) duplicate variable declaration.
FossilOrigin-Name: 94ed9bc4207873e0f3f8114009002f56d5aff359
2014-01-27 13:58:58 +00:00
dan
abfe034692 Fix some problems in test scripts. No code changes.
FossilOrigin-Name: 08acfc65877e207f1a62d31a14afb4add20c4c35
2014-01-27 08:48:10 +00:00
dan
b68b97789e Fix a problem causing SQLITE_OMIT_COMPOUND_SELECT builds to fail.
FossilOrigin-Name: b30db0ac3096b43d55a6da40cafc7de569082bf8
2014-01-25 12:16:53 +00:00
drh
693e671936 Fixes for various clang warnings.
FossilOrigin-Name: 87bf60637e5863c54c5e2d05aaaca0835b7aace8
2014-01-24 22:58:00 +00:00
dan
53bed45ecb Select collation sequences for ORDER BY expressions attached to recursive CTEs in the same way as they are selected for other compound SELECT statements.
FossilOrigin-Name: 9554519c126c5e714421a82fd2e8aa9b19e11493
2014-01-24 20:37:18 +00:00
mistachkin
6ef5e12e1f Fix harmless compiler warnings in the Tcl interface.
FossilOrigin-Name: 35bc81f5ad4503c0db03127ba3c2ee4ce5227448
2014-01-24 17:03:55 +00:00
dan
05d3dc29c5 Add test cases for LIMIT and ORDER BY on recursive CTEs.
FossilOrigin-Name: 67d6c42d44cb191368ce20f553b32fcb14bfc4d7
2014-01-24 16:57:42 +00:00
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
mistachkin
7a429658d7 Fix harmless compiler warning in LEMON.
FossilOrigin-Name: f61a70589ac7e05008a362bd9d5b7bde5d07a758
2014-01-14 10:17:21 +00:00
mistachkin
866b53eb5a For the Win32 VFS, defining winShmMutexHeld should be controlled by NDEBUG, not SQLITE_DEBUG.
FossilOrigin-Name: 1e131094b522103a0829f72193b067b04e42ce82
2014-01-14 10:17:02 +00:00
drh
c3d6ba49c6 In the command-line shell, defend against a NULL-pointer dereference in the
case where sqlite3_column_name() returns NULL (as might happen following an
OOM error).

FossilOrigin-Name: ac15455abcb9bdb88b53129348668a1442f6899f
2014-01-13 20:38:35 +00:00
drh
859bc542c6 For statements of just an unadorned VALUES clause, assign column names
as "columnN" for increasing whole numbers N.

FossilOrigin-Name: 260587d2727f66d7fd65ef672ee46c92024f1d30
2014-01-13 20:32:18 +00:00
dan
a9f5c13d0c Fix some memory leaks and crashes that could follow an OOM condition during WITH clause parsing.
FossilOrigin-Name: 8839850c44a8938883e493eacd752fa686e542df
2014-01-13 16:36:40 +00:00
dan
4e9119d9e8 Add code to handle non-recursive CTEs in the same way as SQL views.
FossilOrigin-Name: a26f399ba485e8127c276c5f103ec6c555e11734
2014-01-13 15:12:23 +00:00
dan
7d562dbe02 Update the parser so that sub-queries and CTEs may have WITH clauses.
FossilOrigin-Name: 704d3931b855562a619769955969d439c42ca406
2014-01-11 19:19:36 +00:00
drh
8b4718636c Parse common table expressions. But do not do anything with them (yet).
FossilOrigin-Name: da98b7205eb3d7ec2ddbf8a8e24eee0b2ff499a5
2014-01-11 13:22:17 +00:00
drh
03e1b1f5ff In LEMON, limit the size of the grammar file to 100MB. This ensures that
the program will never experience integer overflow.  To be doubly sure,
use calloc() instead of malloc() when allocating arrays.

FossilOrigin-Name: 29ba458d849ad8864711cbe59fb10447a947e06a
2014-01-11 12:52:25 +00:00
drh
f59b12fbc1 Optimizations to the SQL language grammar that result in a small size
reduction and speed increase.

FossilOrigin-Name: cb5d1f83e0a33d546d4c0cb817ef1f8440d1f738
2014-01-11 03:54:05 +00:00
drh
ecaa9d399c Add the "%token_class" directive to the LEMON parser generator. This opens up
the possibility of simplifying the parser.  Also remove all calls to 
sprintf(), strcpy(), and strcat() from LEMON to avoid compiler warnings
on OpenBSD.  (Aside:  It is this change to avoid harmless compiler warnings
that was the cause of the reason spat of bugs.)

FossilOrigin-Name: 8eb48c04bd0a14031488b3160fde67307eb8b35d
2014-01-11 03:27:37 +00:00
drh
61f92cd045 In LEMON, fix a bug in the text formatter introduced by the previous
commit.  Also add the new "%token_class" directive for defining symbolic
names that stand any one of a collection of tokens.

FossilOrigin-Name: da7890ca6b1d8e511377a469047120220e8c3b2d
2014-01-11 03:06:18 +00:00
drh
898799fa00 Do not use sprintf(), strcpy() or strcat() in the implementation of the
lemon parser generator tool, to avoid compiler warnings in OpenBSD.

FossilOrigin-Name: e43c522dde01e134f1adc94f534d2b3eda74afc2
2014-01-10 23:21:00 +00:00
drh
144ffe7bfb Remove unused structure definition from parse.y.
FossilOrigin-Name: 7f1e7ae313c7625ef2623d78883dce776eecca30
2014-01-10 20:51:16 +00:00
drh
75593d96be Allow a VALUES clause to be used any place that a SELECT statement can be
used.

FossilOrigin-Name: c9ea7d199f06a7801ab639e7ac98ebeb98706f24
2014-01-10 20:46:55 +00:00
drh
c740752470 Fix CREATE TABLE ... AS so that it works with column names that are empty
strings.

FossilOrigin-Name: 632045f21c553e10f59a14c772d50d7824ca0c2c
2014-01-10 20:38:12 +00:00
dan
9871c59a2d Fix another harmless compiler warning in unixUnfetch().
FossilOrigin-Name: 0484549bb82ca5246488330c8d266e429ccd19b9
2014-01-10 16:40:21 +00:00
drh
1bcbc621df Fix harmless compiler warning in unixUnfetch().
FossilOrigin-Name: 618f248f4ea9fb0b6ff019a4c2cd72857389301f
2014-01-09 13:39:07 +00:00
drh
b66e21fda5 Fix an typo that breaks the build when SQLITE_ENABLE_TREE_EXPLAIN is defined.
FossilOrigin-Name: f461e2b3973d0fe6a7b8cb7a3aaab8a30b3e16c0
2014-01-04 20:00:14 +00:00
dan
2e08486a08 Add the usual "fts3" prefix to new static method setEstimatedRows() in fts3.c. This fixes a problem when compiling the amalgamation, as the r-tree module also contains a static method named setEstimatedRows.
FossilOrigin-Name: d6fcfc8890489b942e5b3f1bc271835d77c5ef96
2014-01-04 19:58:29 +00:00
drh
1c2c0b776f Avoid redundant register loads during index key generation when doing a
DELETE or INTEGRITY_CHECK on a table with multiple indices.

FossilOrigin-Name: 8f6e6149a165f516be6395fd753e163d52ffd52e
2014-01-04 19:27:05 +00:00
drh
61019c7883 Omit OP_Close operations that occur immediately prior to OP_Halt and which
cannot be jumped over.

FossilOrigin-Name: 874b7e9999811c288ad41d07709f88e458d2d497
2014-01-04 16:49:02 +00:00
drh
54e2adb5f3 Improvements to the column-cache for nested AND/OR operators.
FossilOrigin-Name: 4e725f53131d3584319c710c8710a068989543c6
2014-01-04 15:17:04 +00:00
dan
8c7d4ddd5a Have FTS assign extremely high costs to plans that feature unusable MATCH constraints. This discourages the planner from choosing such plans, which lead to "unable to use function MATCH in the requested context" errors.
FossilOrigin-Name: fa8be488a3ad290722dae7a1a7396c77277b2149
2014-01-04 14:46:39 +00:00
dan
69014393f8 Instead of having the planner ignore plans with unusable MATCH constraints, have FTS assign extremely high costs to such plans in order to discourage the planner from using them.
FossilOrigin-Name: 24f84b38131866f7b435ffe641bb2f6991a70db2
2014-01-04 14:42:14 +00:00
dan
42899543f8 Have the planner detect cases where a MATCH constraint is applied to a virtual table, and ignore any plans that do not allow the virtual table implementation to implement the MATCH filtering.
FossilOrigin-Name: 19f3208b26597625728d1ef716d4e44407cf96ac
2014-01-04 14:16:06 +00:00
drh
5426d80948 Avoid some unnecessary OP_SCopy operations when inserting into a table
with multiple indices.

FossilOrigin-Name: 429018b19cb525a4bb0843d20955457b53900d4b
2014-01-03 16:03:43 +00:00
drh
759e858811 Try to factor constant subcomponents of the WHERE clause out of the loop.
FossilOrigin-Name: 9d05777fe24e1a5ce71762de38db840931ef0bc8
2014-01-02 21:05:10 +00:00
drh
762c1c4071 Avoid unnecessary affinity transformations when building indices using
data from a table.

FossilOrigin-Name: 10d851353c2abeadbd2852c210a7ff9f7f513e5d
2014-01-02 19:35:30 +00:00
drh
991a198511 Be more aggressive in optimizing constant conditional expressions.
FossilOrigin-Name: b7e39851a75b87ebca747b26a39989560fd6362b
2014-01-02 17:57:16 +00:00
drh
b00d862139 Try to detect process ID changes due to fork() calls in os_unix.c and
reset the PRNG when a process ID change is detected.

FossilOrigin-Name: e1eba1fb09d7db49d77928bd115b27b8002ae640
2014-01-01 15:18:36 +00:00
drh
fe98081e18 Enhance sqlite3_randomness(N,P) such that it resets the internal PRNG
if N is less than 1.  Subsequent calls to sqlite3_randomness() will reinitialize
the internal PRNG by calling the xRandomness() method of the default VFS.

FossilOrigin-Name: a221aa82bb5496885fd0bf76e4601443799511de
2014-01-01 14:00:13 +00:00
drh
3312348cf8 Add -I. to the main.mk makefile for building sqlite3.o and speedtest1.
FossilOrigin-Name: cc72c5aec7fe93d4a1368517aab949dc98d33003
2013-12-24 12:04:24 +00:00
drh
73d5b8f550 Move elements of the Vdbe object that are only used during statement
preparation out into the Parse object.

FossilOrigin-Name: c289a253c0c053ac8fc344efe138262c327d8096
2013-12-23 19:09:07 +00:00
drh
58c960816f Remove a stray tab character.
FossilOrigin-Name: 25b8a1c9ba77df3b7c78cbce922cb593d661696d
2013-12-23 11:33:32 +00:00
drh
eaf4f523a5 Remove a condition that is always in the logic that handles reading
default values for columns.

FossilOrigin-Name: 895af097e71749f423b63ece17c5a4b4dfcd164d
2013-12-22 22:45:14 +00:00
drh
6c1de308f2 Make sure the WhereLoop.aLTerm[] array is large enough when processing
the skip-scan optimization.  Fix for ticket [520070ec7fbaac].

FossilOrigin-Name: 46d040591f27be01b1860344f8a268797fe344f4
2013-12-22 20:44:10 +00:00
drh
25555506df Fix speedtest1.c so that in --explain mode it only outputs non-explain text
for DDL statements.

FossilOrigin-Name: 2d2b3c4951dc2b8317d5ba8b5cf72b1f4a6668f6
2013-12-21 17:14:58 +00:00
drh
685e3c481c Avoid compiler warnings by only enabling sqlite3ErrName() when
SQLITE_TEST is defined.

FossilOrigin-Name: 862228e50534a6b89c9498c4db664610db11485e
2013-12-21 17:07:13 +00:00
drh
c73d0d9dec Fix harmless compiler warnings in FTS4. This involved corrupting
Martin Porter's beautifully written and elegant stemmer code, making it
a little less beautiful and a little less elegant.  Today is a sad
day.  But the warnings from GCC grow increasingly verbose and irksome
with each new release and so something had to be done.

FossilOrigin-Name: df05679838b571c16a7ab7e135f9564cd2d9647c
2013-12-21 16:06:47 +00:00
drh
849a9d92ba Fix the ".echo on" dot-command of the shell so that it echos comments in
addition to SQL statements and dot-commands.  Add the --explain option
to speedtest1 so that the output can be piped into the command-line shell
to show nicely-formated VDBE code for the entire test.

FossilOrigin-Name: 96397263f94256e284aae9506de1fc48fea89193
2013-12-21 15:46:06 +00:00
drh
ae28d6efc6 Add a case to speedtest1.c that demonstrates the need to factor OP_Column
operators out of inner loops.

FossilOrigin-Name: 69a17336fdf4ae891e815914be8942f7222230c2
2013-12-21 00:04:37 +00:00
drh
a47941fe42 Fix compiler harmless warnings in tclsqlite.c that appeared with GCC 4.8.x.
FossilOrigin-Name: d93ae6833a7fca0672caf902a7b48846e54242cd
2013-12-20 18:57:44 +00:00