]> git.ipfire.org Git - thirdparty/sqlite.git/log
thirdparty/sqlite.git
12 years agoDo not search using ON clause constraints of LEFT JOINs to the right of
drh [Fri, 31 May 2013 20:28:28 +0000 (20:28 +0000)] 
Do not search using ON clause constraints of LEFT JOINs to the right of
the table.

FossilOrigin-Name: 723f901a63313b64a9f10516711fb6136526b79b

12 years agoMake sure a unique cursor number is allocated for automatic indices.
drh [Fri, 31 May 2013 20:00:58 +0000 (20:00 +0000)] 
Make sure a unique cursor number is allocated for automatic indices.

FossilOrigin-Name: 433d1aecd399590b767ebf07b32023fb718a6574

12 years agoDo not attempt to generate code in the NGQP if there have been prior errors,
drh [Fri, 31 May 2013 19:14:56 +0000 (19:14 +0000)] 
Do not attempt to generate code in the NGQP if there have been prior errors,
since with prior errors some of the expressions might not be fully
named resolved.

FossilOrigin-Name: 665e4291c6e78f11d7181c18c5f2418d1adfcb1c

12 years agoFix a problem with code generation on LEFT JOIN of tables without an index.
drh [Fri, 31 May 2013 18:20:52 +0000 (18:20 +0000)] 
Fix a problem with code generation on LEFT JOIN of tables without an index.

FossilOrigin-Name: 0b1bee92a0d25f409d5a95f484b05ddf10ae945f

12 years agoAnother virtual table fix in NGQP.
drh [Fri, 31 May 2013 18:13:50 +0000 (18:13 +0000)] 
Another virtual table fix in NGQP.

FossilOrigin-Name: 2f2ce4167728399cc30bef045aab500940af978c

12 years agoFix problems in the virtual table logic for NGQP.
drh [Fri, 31 May 2013 17:55:27 +0000 (17:55 +0000)] 
Fix problems in the virtual table logic for NGQP.

FossilOrigin-Name: 23af28e24b8f7ffacd006978b25bab990a43b8c5

12 years agoRemove the definitions of objects that are no longer used: WhereCost,
drh [Fri, 31 May 2013 15:50:39 +0000 (15:50 +0000)] 
Remove the definitions of objects that are no longer used:  WhereCost,
WherePlan, and WhereBestIdx.

FossilOrigin-Name: 816f8add7e60de2ef8df4fdac090c244f8dbda39

12 years agoAllow tracing of whereLoopInsert() when the 0x8 bit is set on ".wheretrace".
drh [Fri, 31 May 2013 15:18:46 +0000 (15:18 +0000)] 
Allow tracing of whereLoopInsert() when the 0x8 bit is set on ".wheretrace".
Remove the use of sqlite_query_plan from where2.test.  Fix a bug in the
code generator for OR clause optimizations.

FossilOrigin-Name: 707f0323264c35be14847a6adc49a0dc5eaf4ad2

12 years agoEnhance the shell to provide more flexibility when entering numeric arguments
drh [Fri, 31 May 2013 14:31:11 +0000 (14:31 +0000)] 
Enhance the shell to provide more flexibility when entering numeric arguments
on dot-commands.  In particular, allow hex arguments to .wheretrace.

FossilOrigin-Name: b9578c371ee569dca6a0964019959a93407c8ef9

12 years agoFuther enhancements to the ORDER BY optimizer.
drh [Fri, 31 May 2013 13:36:32 +0000 (13:36 +0000)] 
Futher enhancements to the ORDER BY optimizer.

FossilOrigin-Name: d8efa5f8b60bc4c8df8bfad077f87f76f7ee9bf6

12 years agoImproved detection of unnecessary ORDER BY clauses.
drh [Fri, 31 May 2013 12:43:55 +0000 (12:43 +0000)] 
Improved detection of unnecessary ORDER BY clauses.

FossilOrigin-Name: 58805eb36b9975706e2c4e382689519454e9a504

12 years agoFix the constructAutomaticIndex() routine so that it works with NGQP.
drh [Fri, 31 May 2013 11:57:39 +0000 (11:57 +0000)] 
Fix the constructAutomaticIndex() routine so that it works with NGQP.

FossilOrigin-Name: 5e1e61399513b4a95fd93df2377a2603f1670063

12 years agoImprovements to the ORDER BY suppressor in the NGQP.
drh [Thu, 30 May 2013 23:21:20 +0000 (23:21 +0000)] 
Improvements to the ORDER BY suppressor in the NGQP.

FossilOrigin-Name: 24a2e9ddcecd3926817d77abbb75d068ee7140ad

12 years agoIncremental check-in with various NGQP fixes. Many tests still fail.
drh [Thu, 30 May 2013 22:27:09 +0000 (22:27 +0000)] 
Incremental check-in with various NGQP fixes.  Many tests still fail.

FossilOrigin-Name: a51d8c92496436488e1a6eabd85785e8fedf2736

12 years agoFuther simplifications to the NGQP. Fix some test cases to use
drh [Thu, 30 May 2013 19:29:19 +0000 (19:29 +0000)] 
Futher simplifications to the NGQP.  Fix some test cases to use
EXPLAIN QUERY PLAN rather than the (now obsolete) sqlite_query_plan
global variable.

FossilOrigin-Name: ae985db4fa08b5efbef5a834e852f0b05101264b

12 years agoThe expected result in a test case can be of the form "*glob*" or "~*glob*" to
drh [Thu, 30 May 2013 19:28:34 +0000 (19:28 +0000)] 
The expected result in a test case can be of the form "*glob*" or "~*glob*" to
match or not match the GLOB pattern.  This is useful for matching
EXPLAIN QUERY PLAN output that contains regular expression syntax characters
like "?", "(", and ")".

FossilOrigin-Name: a3b4e261bd7e278f150872cce7b020af5ad8d2ed

12 years agoCut over the NGQP query planner. Remove lots of legacy code.
drh [Thu, 30 May 2013 17:43:19 +0000 (17:43 +0000)] 
Cut over the NGQP query planner.  Remove lots of legacy code.
This check-in compiles but does not work.  The test suite gets incorrect
answers and crashes.

FossilOrigin-Name: 001539df4b74dc1cbceb010a91407003ab4d8735

12 years agoMerge recent trunk changes into the NGQP branch.
drh [Thu, 30 May 2013 11:48:36 +0000 (11:48 +0000)] 
Merge recent trunk changes into the NGQP branch.

FossilOrigin-Name: aebe1f2603ee04d792af73aaf59625bda99d5cd1

12 years agoUpdates to the Codec interface to support codecs on attached databases and
drh [Wed, 29 May 2013 17:48:28 +0000 (17:48 +0000)] 
Updates to the Codec interface to support codecs on attached databases and
to allow rekeying in the middle of a transaction.  These changes are only
applicable if SQLite is compiled with SQLITE_HAS_CODEC.

FossilOrigin-Name: d5b084e9d8cfe9c0c339aca076d472bb50aa764c

12 years agoAdd tests for running FTS 'merge' and 'optimize' commands in shared cache mode.
dan [Wed, 29 May 2013 14:22:19 +0000 (14:22 +0000)] 
Add tests for running FTS 'merge' and 'optimize' commands in shared cache mode.

FossilOrigin-Name: 09e5a7ad85dc592fce868a2d0f8719c6915ccb47

12 years agoAdd the percentile() SQL function as a loadable
drh [Tue, 28 May 2013 20:25:54 +0000 (20:25 +0000)] 
Add the percentile() SQL function as a loadable
extension in the ext/misc directory.

FossilOrigin-Name: a64d760d9290b1be78cdda7ae66d4f02c3b3fa53

12 years agoFinish removing the sqlite3.inTrans field. In the previous check-in, it was
drh [Tue, 28 May 2013 17:30:52 +0000 (17:30 +0000)] 
Finish removing the sqlite3.inTrans field.  In the previous check-in, it was
merely commented out because I failed to select File->Save on my text editor.

FossilOrigin-Name: 2f97e38a6611cb17c24d74332d3ac3777dc0dd3e

12 years agoRemove the obsolete and unused sqlite3.inTrans field.
drh [Tue, 28 May 2013 17:25:48 +0000 (17:25 +0000)] 
Remove the obsolete and unused sqlite3.inTrans field.

FossilOrigin-Name: c3381cd4957013d46075996c3b865177c888d2a8

12 years agoMany small harmless comment changes. Removal of obsolete comments and
drh [Tue, 28 May 2013 12:11:54 +0000 (12:11 +0000)] 
Many small harmless comment changes.  Removal of obsolete comments and
fixing misspelled words.  No changes to code.

FossilOrigin-Name: a0d5cc9315dc6e9ef7dee4c3dfabf4e562d64376

12 years agoMerge autoconf-package branch with trunk.
dan [Tue, 28 May 2013 10:52:22 +0000 (10:52 +0000)] 
Merge autoconf-package branch with trunk.

FossilOrigin-Name: a72f50ef76a5f8a3d5a6a758ec88009c12127f06

12 years agoAdd the "dist" target to main.mk. For building the amalgamation autoconf package. autoconf-package
dan [Mon, 27 May 2013 18:37:33 +0000 (18:37 +0000)] 
Add the "dist" target to main.mk. For building the amalgamation autoconf package.

FossilOrigin-Name: 3fdc8b56493350fc4854fb1eaefe29ac87784f91

12 years agoUpdate the NGQP to record which loops need be run in reverse order to
drh [Mon, 27 May 2013 17:59:37 +0000 (17:59 +0000)] 
Update the NGQP to record which loops need be run in reverse order to
satisfy ORDER BY clauses.

FossilOrigin-Name: 211f7a5374fe20a02535edc8b799a8a7136ff6b3

12 years agoAdd the files used to build the amalgamation-autoconf package.
dan [Mon, 27 May 2013 17:19:58 +0000 (17:19 +0000)] 
Add the files used to build the amalgamation-autoconf package.

FossilOrigin-Name: 048865e8fdd2bef6b43b6cebd45fae94c8a1ab20

12 years agoWhen writing to an FTS table, take an exclusive shared-cache lock on the %_segdir...
dan [Mon, 27 May 2013 10:11:53 +0000 (10:11 +0000)] 
When writing to an FTS table, take an exclusive shared-cache lock on the %_segdir table before writing. Otherwise, an xCommit() call may report an SQLITE_LOCKED error.

FossilOrigin-Name: 3cd2da42e9403b1e6243ad53f3f2bbf89c0fb9b0

12 years agoRecord in the WhereLoop object the set of virtual table constraints that
drh [Fri, 24 May 2013 14:52:03 +0000 (14:52 +0000)] 
Record in the WhereLoop object the set of virtual table constraints that
need not be separately checked.

FossilOrigin-Name: b49fa74561f38c945be6149693678fd6518c2de4

12 years agoMerge the latest trunk changes into the NGQP branch.
drh [Fri, 24 May 2013 13:55:23 +0000 (13:55 +0000)] 
Merge the latest trunk changes into the NGQP branch.

FossilOrigin-Name: 7c8f992c04504a132686ad0652efdff19e43480d

12 years agoSet _XOPEN_SOURCE to 600 so that fchmod() will (hopefully) work on FreeBSD.
drh [Fri, 24 May 2013 12:47:26 +0000 (12:47 +0000)] 
Set _XOPEN_SOURCE to 600 so that fchmod() will (hopefully) work on FreeBSD.

FossilOrigin-Name: 61a10452399db28cd5ea4ba9d416b87a34c2eddb

12 years agoFix harmless compiler warnings in the shell.
drh [Fri, 24 May 2013 11:57:50 +0000 (11:57 +0000)] 
Fix harmless compiler warnings in the shell.

FossilOrigin-Name: 9e2c17c5358b156b588542dbba38da7fedf5302b

12 years agoAdd OGC GeoPackage files to the magic.txt database.
drh [Thu, 23 May 2013 20:52:16 +0000 (20:52 +0000)] 
Add OGC GeoPackage files to the magic.txt database.

FossilOrigin-Name: dab6a32847ce17f12e3a2b09a3567945b2154f67

12 years agoHave the "make fulltest" command run the "mmap" permutation test.
dan [Thu, 23 May 2013 10:15:46 +0000 (10:15 +0000)] 
Have the "make fulltest" command run the "mmap" permutation test.

FossilOrigin-Name: 82ad373f85aa0a87d24c6dbb2ea7dca8c5aff56a

12 years agoAvoid unnecessary calls to FCNTL_SIZE_HINT. Return an error to the user if the file...
dan [Thu, 23 May 2013 10:13:18 +0000 (10:13 +0000)] 
Avoid unnecessary calls to FCNTL_SIZE_HINT. Return an error to the user if the file-control invoked by "PRAGMA mmap_size" returns a value other than SQLITE_OK or SQLITE_NOTFOUND.

FossilOrigin-Name: 40cfde8b4a59a09e52e62f9f029f8d3b32eb15fa

12 years agoCause the mmap_size PRAGMA to immediately change the mmap space if the
drh [Thu, 23 May 2013 01:40:53 +0000 (01:40 +0000)] 
Cause the mmap_size PRAGMA to immediately change the mmap space if the
database connection is already active.  In particular, reducing mmap_size
will immediately free up process address space.

FossilOrigin-Name: 761177927cb51e4f5e66061ca39cf37edbe8346b

12 years agoUse the NGQP plan for EXPLAIN QUERY PLAN output. This change causes 207
drh [Wed, 22 May 2013 20:49:02 +0000 (20:49 +0000)] 
Use the NGQP plan for EXPLAIN QUERY PLAN output.  This change causes 207
errors in veryquick.test, many of which are benign.

FossilOrigin-Name: f783e8e6b10de44029c7c5f57e4648a4a677ca1b

12 years agoAllow the rowid at the end of an index to be used in a constraint on that index.
drh [Wed, 22 May 2013 17:01:17 +0000 (17:01 +0000)] 
Allow the rowid at the end of an index to be used in a constraint on that index.

FossilOrigin-Name: 9bf0524df7ca2e7fcd92b2878a8457264b3c7f6e

12 years agoImprovements to ORDER BY handling in the NGQP. Fix an "exit" mistakenly
drh [Wed, 22 May 2013 02:06:59 +0000 (02:06 +0000)] 
Improvements to ORDER BY handling in the NGQP.  Fix an "exit" mistakenly
left in a test script during the previous check-in.

FossilOrigin-Name: 12c709b4369c7d94d7fb743d0d0da7a9350a3d16

12 years agoEnhanced "wheretrace" output in the NGQP solver routine.
drh [Tue, 21 May 2013 19:23:10 +0000 (19:23 +0000)] 
Enhanced "wheretrace" output in the NGQP solver routine.

FossilOrigin-Name: 04dfb85a2a7025d4b5056b73fa8477691323919f

12 years agoWork toward improving the NGQP's ability to optimize out ORDER BY clauses.
drh [Tue, 21 May 2013 15:52:07 +0000 (15:52 +0000)] 
Work toward improving the NGQP's ability to optimize out ORDER BY clauses.

FossilOrigin-Name: 67367f1e1f0c3eb6be65eea9873910aa62b49884

12 years agoMerge in all trunk changes up through the 3.7.17 release.
drh [Mon, 20 May 2013 15:14:42 +0000 (15:14 +0000)] 
Merge in all trunk changes up through the 3.7.17 release.

FossilOrigin-Name: 14ab6675e5eab3761256a06dad23d2b11220788a

12 years agoVersion 3.7.17 version-3.7.17
drh [Mon, 20 May 2013 00:56:22 +0000 (00:56 +0000)] 
Version 3.7.17

FossilOrigin-Name: 118a3b35693b134d56ebd780123b7fd6f1497668

12 years agoRemove a stray tab character from the transitive_closure extension source code.
drh [Fri, 17 May 2013 20:16:41 +0000 (20:16 +0000)] 
Remove a stray tab character from the transitive_closure extension source code.

FossilOrigin-Name: 7a9aa21c3506a10ab9465540e81071b39bca447d

12 years agoFix a bug in SQLITE_TRACE_SIZE_LIMIT that was introduced by
drh [Fri, 17 May 2013 17:15:34 +0000 (17:15 +0000)] 
Fix a bug in SQLITE_TRACE_SIZE_LIMIT that was introduced by
check-in [1a1cf5aa86734c8].  That check-in was to remove harmless
compiler warnings.  So once again, we have introduced a real bug
into SQLite by attempting to eliminate a harmless compiler warning.

FossilOrigin-Name: cec2bcb45aa3f0438e19381ac863f0f876a1d1ad

12 years agoIn test file test_syscall.c, include sqliteInt.h before any tcl or system include...
dan [Fri, 17 May 2013 16:41:15 +0000 (16:41 +0000)] 
In test file test_syscall.c, include sqliteInt.h before any tcl or system include files. This ensures that the magical defines in sqliteInt.h really do enable large file support (and set things up so that sizeof(off_t)==8).

FossilOrigin-Name: 0f355bb17f256c6322e63a95835a67949aa48fb3

12 years agoUse sum() instead of total() in mptest/multiwrite01.test too.
drh [Fri, 17 May 2013 12:52:58 +0000 (12:52 +0000)] 
Use sum() instead of total() in mptest/multiwrite01.test too.

FossilOrigin-Name: d0c2288c723e276957318be433e25746811b0ff7

12 years agoUse sum() instead of total() in the mptest/crash01.test script.
drh [Fri, 17 May 2013 12:51:49 +0000 (12:51 +0000)] 
Use sum() instead of total() in the mptest/crash01.test script.

FossilOrigin-Name: 8ba0fc98115f05ebed7ea945e156379c39e92de2

12 years agoAdd extra "PRAGMA mmap_size = N" statements to mmap1.test and mmap2.test.
dan [Fri, 17 May 2013 12:25:00 +0000 (12:25 +0000)] 
Add extra "PRAGMA mmap_size = N" statements to mmap1.test and mmap2.test.

FossilOrigin-Name: cec0a06c17435d5a35e76b52d6901ecda98f9916

12 years agoIn os_unix.c and os_win.c, initialize the default mmap-limit of a new file descriptor...
dan [Fri, 17 May 2013 12:10:52 +0000 (12:10 +0000)] 
In os_unix.c and os_win.c, initialize the default mmap-limit of a new file descriptor to the current global default mmap-limit, not the current global maximum allowable mmap-limit.

FossilOrigin-Name: 1def4ea3a02afc19648f4cd928b247f8fa55da80

12 years agoFix minor test script issues causing releasetest.tcl to fail.
dan [Thu, 16 May 2013 19:15:07 +0000 (19:15 +0000)] 
Fix minor test script issues causing releasetest.tcl to fail.

FossilOrigin-Name: d8ded9d8a1052885ce223c70efa55c0dd8b9920e

12 years agoFix a typo in Makefile.in preventing compilation with the --disable-amalgamation...
dan [Thu, 16 May 2013 18:33:06 +0000 (18:33 +0000)] 
Fix a typo in Makefile.in preventing compilation with the --disable-amalgamation option.

FossilOrigin-Name: 8ffbefe7d72d25984440c0e7c92a5e9c472ed55e

12 years agoSeveral releasetest.tcl related fixes to test cases. No code changes.
dan [Thu, 16 May 2013 14:28:47 +0000 (14:28 +0000)] 
Several releasetest.tcl related fixes to test cases. No code changes.

FossilOrigin-Name: e97d744ba1138e6c4c1fc657c32f4391ea7479f1

12 years agoFix compilation with SQLITE_OMIT_WAL on Win32.
mistachkin [Thu, 16 May 2013 12:41:49 +0000 (12:41 +0000)] 
Fix compilation with SQLITE_OMIT_WAL on Win32.

FossilOrigin-Name: 6d45a79fb18dcd305cc41c525060e42f2402bd77

12 years agoIn sqlite3_close_v2(), do not attempt to roll back a transaction if there exist activ...
dan [Thu, 16 May 2013 11:57:28 +0000 (11:57 +0000)] 
In sqlite3_close_v2(), do not attempt to roll back a transaction if there exist active statement objects. Any open transaction will be rolled back when the last of these statement objects is finalized.

FossilOrigin-Name: d11e76072a17fe833b87595d9d79f2c4b0b09cb3

12 years agoTreat identifiers in the HAVING clause the same as in the WHERE clause.
drh [Thu, 16 May 2013 01:02:45 +0000 (01:02 +0000)] 
Treat identifiers in the HAVING clause the same as in the WHERE clause.
Only consider AS names from the result set to match if there are no other
matches.  Continuation of the fix for [2500cdb9be05].  This check-in
fixes a bug found by [http://www.sqlite.org/sqllogictest/ | SqlLogicTest]
during release testing for version 3.7.17.

FossilOrigin-Name: 9ffff3d05226bbd01a0745dd0a511776358253c0

12 years agoApply compilation fix from [a58af81483] to the other makefiles as well.
mistachkin [Wed, 15 May 2013 20:35:13 +0000 (20:35 +0000)] 
Apply compilation fix from [a58af81483] to the other makefiles as well.

FossilOrigin-Name: 7e76889d675e4c646158f7f9188d25f155c18876

12 years agoFixes to allow testfixture to be compiled with SQLITE_OMIT_VIRTUAL_TABLE defined.
dan [Wed, 15 May 2013 18:34:17 +0000 (18:34 +0000)] 
Fixes to allow testfixture to be compiled with SQLITE_OMIT_VIRTUAL_TABLE defined.

FossilOrigin-Name: 00231fb0127960d700de3549e34e82f8ec1b5819

12 years agoThe sqlite3ExprCollSeq() function can no longer be called while parse
drh [Wed, 15 May 2013 17:47:12 +0000 (17:47 +0000)] 
The sqlite3ExprCollSeq() function can no longer be called while parse
the schema, so remove the code path inside of sqlite3ExprCollSeq() that
dealt with that case.

FossilOrigin-Name: 867b3e3b29a357f68e48f0898bf323c5dd0575a4

12 years agoMerge the shared-cache-fixes branch into trunk.
drh [Wed, 15 May 2013 17:08:46 +0000 (17:08 +0000)] 
Merge the shared-cache-fixes branch into trunk.

FossilOrigin-Name: 5cc1cc55d28a73d390d51fdf6f2c026f1cab1d75

12 years agoExtra test for commit [6dae62c4e5].
dan [Wed, 15 May 2013 16:24:46 +0000 (16:24 +0000)] 
Extra test for commit [6dae62c4e5].

FossilOrigin-Name: b10b9e758b171b0f514592bba70c3ecd17c8c47f

12 years agoAdd main.c to the list of files compiled with SQLITE_TEST defined when building testf...
dan [Wed, 15 May 2013 16:16:25 +0000 (16:16 +0000)] 
Add main.c to the list of files compiled with SQLITE_TEST defined when building testfixture.

FossilOrigin-Name: a58af81483a5facb09d2a80385fc8815b259a10d

12 years agoFix the sharedA.test module so that it does not attempt to run TCL callbacks shared-cache-fixes
drh [Wed, 15 May 2013 16:08:33 +0000 (16:08 +0000)] 
Fix the sharedA.test module so that it does not attempt to run TCL callbacks
on a different thread from where the interpreter was originally created.

FossilOrigin-Name: 65ff754e3521aa8ee9135d235166cac2a8f57ebd

12 years agoDo not run sharedA.test if the system is not threadsafe.
dan [Wed, 15 May 2013 15:53:52 +0000 (15:53 +0000)] 
Do not run sharedA.test if the system is not threadsafe.

FossilOrigin-Name: d484eaf8d6dfaf2c1065b93b2a52a6db91c09fa4

12 years agoMerge latest trunk changes with this branch.
dan [Wed, 15 May 2013 15:42:14 +0000 (15:42 +0000)] 
Merge latest trunk changes with this branch.

FossilOrigin-Name: 47dd65a890955f333d431e275f3f4d95d34a5ba5

12 years agoWhen loading a database schema that contains an index definition that includes a...
dan [Wed, 15 May 2013 15:16:50 +0000 (15:16 +0000)] 
When loading a database schema that contains an index definition that includes a COLLATE clause for which the collation sequence is unavailable, do not assume that that index uses BINARY instead. Fix for [0fc59f908b].

FossilOrigin-Name: 6dae62c4e505a9a1a22c2771ef3e1921407c4748

12 years agoAdd the rot13.c loadable extension.
drh [Wed, 15 May 2013 13:05:03 +0000 (13:05 +0000)] 
Add the rot13.c loadable extension.

FossilOrigin-Name: 8f9bd8e7a88eb11fb17d29954fa4b8c2840a5019

12 years agoWhen closing a connection, avoid tripping active cursors belonging to a different...
dan [Wed, 15 May 2013 10:21:50 +0000 (10:21 +0000)] 
When closing a connection, avoid tripping active cursors belonging to a different shared-cache client. Also, if sqlite3_close() is called while there are still active statements belonging to the connection, return SQLITE_BUSY and do not roll back any active transaction.

FossilOrigin-Name: 6071b7cce067c807e040283fc4b7449dc6eca498

12 years agoMerge together the fork in this branch.
drh [Tue, 14 May 2013 23:13:41 +0000 (23:13 +0000)] 
Merge together the fork in this branch.

FossilOrigin-Name: 164e3d4da20cc16d2a04d602b5a8229e0db99d9d

12 years agoFix an assert() in unlockBtreeIfUnused() so that it checks for the existance
drh [Tue, 14 May 2013 23:12:06 +0000 (23:12 +0000)] 
Fix an assert() in unlockBtreeIfUnused() so that it checks for the existance
of an untripped cursor, not for the existance of any cursor at all.

FossilOrigin-Name: a6f851d0fe01d8c8d44a2fe0b716ff7a5194c63b

12 years agoAvoid deleting a b-tree "has-content" vector belonging to another shared-cache connec...
dan [Tue, 14 May 2013 20:36:31 +0000 (20:36 +0000)] 
Avoid deleting a b-tree "has-content" vector belonging to another shared-cache connection from within sqlite3_close().

FossilOrigin-Name: 93462df78247f5634b9f53752cf80056bbfe9aac

12 years agoFirst attempt to get ORDER BY optimization working in NGQP.
drh [Tue, 14 May 2013 15:31:07 +0000 (15:31 +0000)] 
First attempt to get ORDER BY optimization working in NGQP.

FossilOrigin-Name: 9fe20292558bb9422de91e35648cb834cbf3b306

12 years agoCandidate fixes for problems revealed by notify2.test. Notify2.test is still failing...
dan [Mon, 13 May 2013 18:23:15 +0000 (18:23 +0000)] 
Candidate fixes for problems revealed by notify2.test. Notify2.test is still failing at this point.

FossilOrigin-Name: ea0428f9b6e63066e7444a2ba2f8c12a2e3ab7e4

12 years agoMinor fixes to the OR-clause processing in the NGQP.
drh [Sat, 11 May 2013 00:06:23 +0000 (00:06 +0000)] 
Minor fixes to the OR-clause processing in the NGQP.

FossilOrigin-Name: d6946f33c7851aa7efb04b93ac2ae1ac50c26eec

12 years agoNow generating OR-clause plans.
drh [Fri, 10 May 2013 20:26:22 +0000 (20:26 +0000)] 
Now generating OR-clause plans.

FossilOrigin-Name: e17003fcfec0c0b524b1b9ff8e15e7ee83efa571

12 years agoUpdate the NGQP so that it can produce plans that include automatic indices.
drh [Fri, 10 May 2013 15:16:30 +0000 (15:16 +0000)] 
Update the NGQP so that it can produce plans that include automatic indices.

FossilOrigin-Name: 586b55d8d7722de1c0530b3b832bae0511e6d05c

12 years agoFactor out common operations into whereLoopAddAll(). Add stubs for
drh [Fri, 10 May 2013 03:30:49 +0000 (03:30 +0000)] 
Factor out common operations into whereLoopAddAll().  Add stubs for
missing features.

FossilOrigin-Name: 0278e420614e02fb2d8474ed99b0904275882dfe

12 years agoMerge in the latest trunk changes.
drh [Fri, 10 May 2013 02:11:40 +0000 (02:11 +0000)] 
Merge in the latest trunk changes.

FossilOrigin-Name: 5ed31c8279a4f465b982df5dc20cefc286928b93

12 years agoFree up bits of wsFlags for reuse. Install the ORDER BY optimization
drh [Fri, 10 May 2013 02:00:35 +0000 (02:00 +0000)] 
Free up bits of wsFlags for reuse.  Install the ORDER BY optimization
infrastructure for the NGQP.

FossilOrigin-Name: 82d50e198025a2fdb8ee733edb8419d388ee5362

12 years agoAdd assert()s to the implementation of xRead() in the built-in VFSes to
drh [Thu, 9 May 2013 18:12:40 +0000 (18:12 +0000)] 
Add assert()s to the implementation of xRead() in the built-in VFSes to
verify that the offset parameter is always non-negative.

FossilOrigin-Name: cf5c3642247fdd34d87f0368594cd7b8f081636a

12 years agoDo not move WHERE clause terms inside OR expressions that are contained
drh [Thu, 9 May 2013 14:20:11 +0000 (14:20 +0000)] 
Do not move WHERE clause terms inside OR expressions that are contained
within an ON clause of a LEFT JOIN.  Fix for ticket [f2369304e47167e3e].

FossilOrigin-Name: 1128575d0ab24f7023a0f6e6ce4828b9a09a7c6c

12 years agoRefine and reform all Windows OSTRACE macro usage. Replace all usage of sqlite3TestE...
mistachkin [Thu, 9 May 2013 00:40:13 +0000 (00:40 +0000)] 
Refine and reform all Windows OSTRACE macro usage.  Replace all usage of sqlite3TestErrorName() with sqlite3ErrName() and add missing return codes.

FossilOrigin-Name: 610425f19008b8b5d4bf027c8b14d97ec3115a54

12 years agoFix memory leaks in the NGQP logic for virtual tables.
drh [Wed, 8 May 2013 20:05:58 +0000 (20:05 +0000)] 
Fix memory leaks in the NGQP logic for virtual tables.

FossilOrigin-Name: 3c2e83a4a2c5e85202162feeb37ef7a3911c05a3

12 years agoFix a couple of harmless compiler warnings in the fts3_tokenize virtual
drh [Wed, 8 May 2013 17:06:28 +0000 (17:06 +0000)] 
Fix a couple of harmless compiler warnings in the fts3_tokenize virtual
table.

FossilOrigin-Name: 1fa8c457394c94864f7584e4c893ec09e685fba4

12 years agoMake sure the ORDER BY collating sequences are compatible with the
drh [Wed, 8 May 2013 16:57:48 +0000 (16:57 +0000)] 
Make sure the ORDER BY collating sequences are compatible with the
comparison collations before using the merge algorithm for compound
SELECT statements.  Fix for ticket [6709574d2a8d8].

FossilOrigin-Name: ce853a75068073d6acc8bec0819505a22c4c7e69

12 years agoFix the wholenumber virtual table so that it returns higher costs for
drh [Wed, 8 May 2013 14:20:28 +0000 (14:20 +0000)] 
Fix the wholenumber virtual table so that it returns higher costs for
unconstrained usage.  Cherrypick from [ceff8955020cd13].

FossilOrigin-Name: 7227b61512a534645c73883c2e37b4e647592e5d

12 years agoNGQP working with virtualt tables, though many legacy tests fail and there
drh [Wed, 8 May 2013 14:14:26 +0000 (14:14 +0000)] 
NGQP working with virtualt tables, though many legacy tests fail and there
are yet some memory leaks.

FossilOrigin-Name: bd9327a9684b99978734ccd561eea1ad864ab13b

12 years agoFix the wholenumber virtual table so that it returns higher costs for
drh [Wed, 8 May 2013 14:13:51 +0000 (14:13 +0000)] 
Fix the wholenumber virtual table so that it returns higher costs for
unconstrained usage.

FossilOrigin-Name: ceff8955020cd1314bf1ab0af7d075fe2c0863e5

12 years agoMore bug fixes to the WhereLoop generator and the solver in NGQP.
drh [Wed, 8 May 2013 04:22:59 +0000 (04:22 +0000)] 
More bug fixes to the WhereLoop generator and the solver in NGQP.
Now finds the best plan for TPC-H Q8.  This seems to prove the
concept, but there is still much work to be done.

FossilOrigin-Name: 8e5aad37529ec3042e3468acf15186f566e2df8a

12 years agoBug fixes in the solver.
drh [Wed, 8 May 2013 03:22:07 +0000 (03:22 +0000)] 
Bug fixes in the solver.

FossilOrigin-Name: b36034bbd19bc5677b26a6f60ca96eb2b37db373

12 years agoAdd the NGQP solver.
drh [Wed, 8 May 2013 03:05:41 +0000 (03:05 +0000)] 
Add the NGQP solver.

FossilOrigin-Name: 5d37587c50d8932b6357bfd03152a851510a4317

12 years agoContinued progress on generating good WhereLoop objects for the new query
drh [Tue, 7 May 2013 23:06:23 +0000 (23:06 +0000)] 
Continued progress on generating good WhereLoop objects for the new query
planner.

FossilOrigin-Name: 15cc8a16482777d8e138c4d0863faf8d54fef33a

12 years agoInserting a few WhereLoop objects without leaking memory. Costs are
drh [Tue, 7 May 2013 19:44:38 +0000 (19:44 +0000)] 
Inserting a few WhereLoop objects without leaking memory.  Costs are
not correct.  Inequality and IN constraints are not implemented.

FossilOrigin-Name: e8881a8b2f25f38bc8ff77619f96f38fe530d13b

12 years agoMake sure the ORDER BY collating sequences are compatible with the tkt-6709574
drh [Tue, 7 May 2013 17:49:08 +0000 (17:49 +0000)] 
Make sure the ORDER BY collating sequences are compatible with the
comparison collations before using the merge algorithm for compound
SELECT statements.  Candidate fix for ticket [6709574d2a8d8].

FossilOrigin-Name: fc3630cdef6e2cdbfb4e7b373d1a094753e55016

12 years agoModify the fts3tokenize table implementation so that it does not use the SQL function...
dan [Tue, 7 May 2013 12:16:48 +0000 (12:16 +0000)] 
Modify the fts3tokenize table implementation so that it does not use the SQL function fts3_tokenizer. The user may have installed an authorizer callback that prohibits this.

FossilOrigin-Name: 0ba67b64de258883e4c43db09e131bb67083855e

12 years agoIn the command-line shell, output the elements of the schema in the order
drh [Mon, 6 May 2013 21:01:06 +0000 (21:01 +0000)] 
In the command-line shell, output the elements of the schema in the order
that they appear in the sqlite_master table.  This is necessary in some
cases to make the schema parsable.

FossilOrigin-Name: e5b3cd747bb0b484e38b8611a81925e2cc144435

12 years agoIn the command-line shell, make sure the output of dot-commands goes to
drh [Mon, 6 May 2013 20:28:54 +0000 (20:28 +0000)] 
In the command-line shell, make sure the output of dot-commands goes to
the same redirected output stream as the result of queries.
Ticket [2f96536e7ff7dba]

FossilOrigin-Name: b72d365920dbe45e61d8b1cff708a8858c2b3e33

12 years agoAdd an assert() to fts3_expr.c in order to silence a clang warning.
drh [Mon, 6 May 2013 14:57:48 +0000 (14:57 +0000)] 
Add an assert() to fts3_expr.c in order to silence a clang warning.

FossilOrigin-Name: d8dc2c5fb554eb5898ddc8d703c6a360af7fe023

12 years agoMake sure the authorizer callback gets a valid pointer to "ROWID" for the
drh [Mon, 6 May 2013 13:22:50 +0000 (13:22 +0000)] 
Make sure the authorizer callback gets a valid pointer to "ROWID" for the
column-name parameter when doing an UPDATE that changes the rowid.
Fix for ticket [0eb70d77cb05bb2272].

FossilOrigin-Name: 26a59bb88d4082758eb281b365b57f9a0c059d89