]> git.ipfire.org Git - thirdparty/sqlite.git/log
thirdparty/sqlite.git
12 years agoFurther work on getting ssdsim to run. This is an incremental checkin to ssdsim
drh [Thu, 25 Oct 2012 23:47:27 +0000 (23:47 +0000)] 
Further work on getting ssdsim to run.  This is an incremental checkin to
save my place while jumping off to work on other things.

FossilOrigin-Name: ae2f1627b1672e511be1ff132f2a3fb8f8bb7169

12 years agoMerge the command-line shell enhancements from trunk. Other edits toward
drh [Thu, 25 Oct 2012 15:32:29 +0000 (15:32 +0000)] 
Merge the command-line shell enhancements from trunk.  Other edits toward
trying to get ssdsim to run.

FossilOrigin-Name: 848f87e22fc6bfbbb7dbc7491c8a20cdd53b7420

12 years agoImprovements to the command-line argument parsing in the
drh [Thu, 25 Oct 2012 15:23:14 +0000 (15:23 +0000)] 
Improvements to the command-line argument parsing in the
command-line shell.  Command-line options can now occur either before
or after the database name and first command and are still accepted and
processed.  Command-line options are processed even if no database name
is given (and :memory: is assumed).

FossilOrigin-Name: 317c80cba3688a97ade9cde622cc3bd94cf3436a

12 years agoInitial check-in of a test VFS designed to simulate a NAND-flash SSD for the
drh [Thu, 25 Oct 2012 01:50:59 +0000 (01:50 +0000)] 
Initial check-in of a test VFS designed to simulate a NAND-flash SSD for the
purpose of measuring and subsequently minimizing write amplification caused
by SQLite.  The code in this check-in compiles but does not run.

FossilOrigin-Name: 9e6efcf05402cd0b259c9b2ae57e349800650bd7

12 years agoMake sure substructure elements have proper alignment in the ICU tokenizers
drh [Fri, 19 Oct 2012 02:10:53 +0000 (02:10 +0000)] 
Make sure substructure elements have proper alignment in the ICU tokenizers
of FTS2 and FTS3.

FossilOrigin-Name: aaa2d9b0db74d8452d9294de17cff786ab4ec7c8

12 years agoAdd detailed comments to the build tools used to generate the VSIX package. Also...
mistachkin [Fri, 19 Oct 2012 00:23:31 +0000 (00:23 +0000)] 
Add detailed comments to the build tools used to generate the VSIX package.  Also, allow the build configurations and native library directories to be overridden for the multi-platform build tool for MSVC.

FossilOrigin-Name: 0482c73bfdf80b0c0ce9abea706554d7ddf36f69

12 years agoPut auxiliary libraries after libsqlite3.a in the testfixture target of the
drh [Thu, 18 Oct 2012 20:49:26 +0000 (20:49 +0000)] 
Put auxiliary libraries after libsqlite3.a in the testfixture target of the
"main.mk" makefile.

FossilOrigin-Name: 8fc8548f52ab8fcfb53f88db68422e09c9b98da1

12 years agoMerge Watcom compiler warning fixes into trunk.
drh [Thu, 18 Oct 2012 15:01:27 +0000 (15:01 +0000)] 
Merge Watcom compiler warning fixes into trunk.

FossilOrigin-Name: 5be96788a142362fa1f218191d2a93fdea46d93d

12 years agoMore warning fixes.
mistachkin [Thu, 18 Oct 2012 10:35:19 +0000 (10:35 +0000)] 
More warning fixes.

FossilOrigin-Name: 51a6a797e1d61c4361b87cdf3467bfd3ce161cc3

12 years agoFix harmless compiler warnings.
mistachkin [Thu, 18 Oct 2012 09:39:16 +0000 (09:39 +0000)] 
Fix harmless compiler warnings.

FossilOrigin-Name: 018e09c70347b9e0c76246ae65d57ef5d29a965a

12 years agoAdd a comment to fts3_snippet.c.
dan [Wed, 17 Oct 2012 20:28:52 +0000 (20:28 +0000)] 
Add a comment to fts3_snippet.c.

FossilOrigin-Name: b5f5ba3103e6fcf117fb69d5379fa70f691a652d

12 years agoInitialize variables used as outputs of custom tokenizer method calls in fts4.
dan [Wed, 17 Oct 2012 20:15:10 +0000 (20:15 +0000)] 
Initialize variables used as outputs of custom tokenizer method calls in fts4.

FossilOrigin-Name: 514505a84bcc677518d60a42896598f85ed78265

12 years agoAdd a test for the problem fixed by [bf44d73d3e].
dan [Wed, 17 Oct 2012 16:20:36 +0000 (16:20 +0000)] 
Add a test for the problem fixed by [bf44d73d3e].

FossilOrigin-Name: db9b1fa5973d79e29885817d5aedc3a886c2589a

12 years agoChange the way the tcl crash-test code works to avoid triggering an assert() in os_un...
dan [Wed, 17 Oct 2012 15:28:26 +0000 (15:28 +0000)] 
Change the way the tcl crash-test code works to avoid triggering an assert() in os_unix.c.

FossilOrigin-Name: b8b7b8f9e97a5c34f0f199b46347e0bf85005a4d

12 years agoRemove an incorrect "#ifndef SQLITE_OMIT_AUTOVACUUM" from pager.
drh [Wed, 17 Oct 2012 13:15:02 +0000 (13:15 +0000)] 
Remove an incorrect "#ifndef SQLITE_OMIT_AUTOVACUUM" from pager.

FossilOrigin-Name: bf44d73d3e4ec403947d361d2fa150cc240c4d45

12 years agoCorrect comments and enhance readability of the mkvsix tool.
mistachkin [Mon, 15 Oct 2012 20:28:22 +0000 (20:28 +0000)] 
Correct comments and enhance readability of the mkvsix tool.

FossilOrigin-Name: 2c3af657fee6153842d660a6ce29aa7d791ebd38

12 years agoHold the mutex on the shared-cache for the duration of a VACUUM operation.
dan [Mon, 15 Oct 2012 18:02:57 +0000 (18:02 +0000)] 
Hold the mutex on the shared-cache for the duration of a VACUUM operation.

FossilOrigin-Name: 629a42d47a0d8f73de900f469845ce800bdb8959

12 years agoDequote column names generated by the query flattener.
drh [Mon, 15 Oct 2012 16:24:07 +0000 (16:24 +0000)] 
Dequote column names generated by the query flattener.

FossilOrigin-Name: 5526e0aa3ccb24988a4f351ac994907b6e89018a

12 years agoFix a failing assert() in wal.c.
dan [Mon, 15 Oct 2012 11:28:24 +0000 (11:28 +0000)] 
Fix a failing assert() in wal.c.

FossilOrigin-Name: 8745530b9a877db77fe2ca3ea9c6bc99ce033055

12 years agoEnsure that when the source of a backup is a database that is zero bytes
drh [Sat, 13 Oct 2012 23:16:00 +0000 (23:16 +0000)] 
Ensure that when the source of a backup is a database that is zero bytes
in size, the final destination database consists of at least one page.
Truncating it to zero bytes is equivalent to zeroing the schema cookie
and change counter, which can cause problems for existing clients.

FossilOrigin-Name: ca86138bda26c5ac5a7e67351acbd19fbd39b0ae

12 years agoMark an always-true conditional as such. zero-byte-backup-fix
drh [Sat, 13 Oct 2012 20:55:12 +0000 (20:55 +0000)] 
Mark an always-true conditional as such.

FossilOrigin-Name: ae025cae2266a91d4226bbdb66f82b9d7714750a

12 years agoModify backup4 test name prefix to make the resulting test names unique.
mistachkin [Sat, 13 Oct 2012 20:20:09 +0000 (20:20 +0000)] 
Modify backup4 test name prefix to make the resulting test names unique.

FossilOrigin-Name: 637fb1c1b7642ba3a404dde32e40d4a4ad16fe14

12 years agoEnsure that when the source of a backup is a database that is zero bytes in size...
dan [Sat, 13 Oct 2012 19:58:11 +0000 (19:58 +0000)] 
Ensure that when the source of a backup is a database that is zero bytes in size, the final destination database consists of at least one page. Truncating it to zero bytes is equivalent to zeroing the schema cookie and change counter, which can cause problems for existing clients.

FossilOrigin-Name: af5c9ee4a453f71c03f24ad08824ced6c1b97afb

12 years agoAllow the showdb tool to be compiled with MSVC.
mistachkin [Sat, 13 Oct 2012 09:31:20 +0000 (09:31 +0000)] 
Allow the showdb tool to be compiled with MSVC.

FossilOrigin-Name: dce391fc6302301e9ac53a5e4fc69f3bd7ba13a7

12 years agoTooling support for including the debug build in the VSIX package.
mistachkin [Fri, 12 Oct 2012 18:06:07 +0000 (18:06 +0000)] 
Tooling support for including the debug build in the VSIX package.

FossilOrigin-Name: de784399ed1f0e27fc875e32719643d19819c8fb

12 years agoFix duplicate test name in whereD.test.
mistachkin [Wed, 10 Oct 2012 13:59:11 +0000 (13:59 +0000)] 
Fix duplicate test name in whereD.test.

FossilOrigin-Name: 1182b54af0fd43d5e6aa6399837e7915aa60a578

12 years agoDefine the sqlite3PagerWalFramesize() function even if SQLITE_OMIT_WAL is used.
drh [Wed, 10 Oct 2012 12:14:09 +0000 (12:14 +0000)] 
Define the sqlite3PagerWalFramesize() function even if SQLITE_OMIT_WAL is used.

FossilOrigin-Name: 96247853ef3d556a13b899b4c907b9fa2c78d513

12 years agoAdd support for URI filenames in sqlite3_analyzer.
drh [Wed, 10 Oct 2012 10:52:46 +0000 (10:52 +0000)] 
Add support for URI filenames in sqlite3_analyzer.

FossilOrigin-Name: 6dc987d32ba4d09b811ef281cdae09be17ac936c

12 years agoMove a couple of WAL-related function declarations in sqliteInt.h and pager.h into...
dan [Wed, 10 Oct 2012 09:46:29 +0000 (09:46 +0000)] 
Move a couple of WAL-related function declarations in sqliteInt.h and pager.h into "#ifndef SQLITE_OMIT_WAL" blocks. Otherwise, the amalgamation fails to build using some compilers with SQLITE_OMIT_WAL (static function declared but not defined).

FossilOrigin-Name: f7437153b90b25a1b77294a0f8d1b0bd4bd08c08

12 years agoMerge the fix for ticket [d02e1406a58ea02] into trunk.
drh [Tue, 9 Oct 2012 21:07:23 +0000 (21:07 +0000)] 
Merge the fix for ticket [d02e1406a58ea02] into trunk.

FossilOrigin-Name: dd34bec389359845b86f4cc4906ab440f92dcab9

12 years agoAttempt to suppress warnings generated by Coverity.
drh [Tue, 9 Oct 2012 18:51:44 +0000 (18:51 +0000)] 
Attempt to suppress warnings generated by Coverity.

FossilOrigin-Name: 7b1a6e6cb5099076bf19db142b17c99044a869cd

12 years agoAvoid an assertion fault and/or freeing memory while it is still in use when
drh [Tue, 9 Oct 2012 14:36:47 +0000 (14:36 +0000)] 
Avoid an assertion fault and/or freeing memory while it is still in use when
an error occurs during virtual table construction.

FossilOrigin-Name: a02599ad85d02470c9effa51c02dbda7796bfa16

12 years agoBring some comments up to date in the query planner, and especially the
drh [Tue, 9 Oct 2012 09:26:28 +0000 (09:26 +0000)] 
Bring some comments up to date in the query planner, and especially the
ORDER BY optimizer.  Also add testcase() macros.

FossilOrigin-Name: bb5c0f1c92b48631d4a12cd4f321b53cd07885c8

12 years agoRemove an unused variable. Fix code that occurs before a variable
drh [Tue, 9 Oct 2012 01:39:25 +0000 (01:39 +0000)] 
Remove an unused variable.  Fix code that occurs before a variable
declaration.

FossilOrigin-Name: 01dc032b5bbd9c9ebb1965f176ca5d732cda85ea

12 years agoReplace an always-false conditional with an assert().
drh [Tue, 9 Oct 2012 01:23:25 +0000 (01:23 +0000)] 
Replace an always-false conditional with an assert().

FossilOrigin-Name: 981b9943e4b2b660690ec1ac145abdd3c74f8dd2

12 years agoChanges to facilitate full test coverage.
drh [Mon, 8 Oct 2012 23:25:07 +0000 (23:25 +0000)] 
Changes to facilitate full test coverage.

FossilOrigin-Name: 28d1eb40bfc4c993010ce670ee10780ca2ae5c9c

12 years agoMerge ORDER BY optimization refactoring and repair into trunk.
drh [Mon, 8 Oct 2012 21:51:58 +0000 (21:51 +0000)] 
Merge ORDER BY optimization refactoring and repair into trunk.

FossilOrigin-Name: c027a9af9137f3346dbb5c5e100a087c2e89797b

12 years agoAll test cases (veryquick.tcl and min.rc) pass. A few branch operations in qp-enhancements
drh [Mon, 8 Oct 2012 21:01:15 +0000 (21:01 +0000)] 
All test cases (veryquick.tcl and min.rc) pass.  A few branch operations in
ORDER BY optimization logic are untested by min.rc.

FossilOrigin-Name: 8314fd6078a3a71aea9d6386ff277cfeb592b4ba

12 years agoFurther tweaks to the ORDER BY optimizer, to fix a bug and to get the
drh [Mon, 8 Oct 2012 20:27:35 +0000 (20:27 +0000)] 
Further tweaks to the ORDER BY optimizer, to fix a bug and to get the
optimizer to recognize some additional cases.

FossilOrigin-Name: bcb4f262476193cfb17818d8c62bab528dddeef9

12 years agoBug fixes in the ORDER BY optimizer.
drh [Mon, 8 Oct 2012 19:41:38 +0000 (19:41 +0000)] 
Bug fixes in the ORDER BY optimizer.

FossilOrigin-Name: 301bbee4045aa169e29fb4fb75743b71eb4760a1

12 years agoContinued refactoring of the ORDER BY optimization logic. This check-in
drh [Mon, 8 Oct 2012 18:23:51 +0000 (18:23 +0000)] 
Continued refactoring of the ORDER BY optimization logic.  This check-in
is close to working, but it still has issues.  A few test cases fail.

FossilOrigin-Name: adbdc663f3d22ff03f21040a811d585cf2218626

12 years agoManually define the Win32 file-mapping APIs for WAL if SQLITE_WIN32_FILEMAPPING_API...
mistachkin [Mon, 8 Oct 2012 14:36:42 +0000 (14:36 +0000)] 
Manually define the Win32 file-mapping APIs for WAL if SQLITE_WIN32_FILEMAPPING_API is defined.

FossilOrigin-Name: 1c2c0a2880dd0ee8862352e307142b8de7e80d13

12 years agoCorrections to test names to eliminate duplicates and follow naming conventions.
mistachkin [Sun, 7 Oct 2012 05:34:39 +0000 (05:34 +0000)] 
Corrections to test names to eliminate duplicates and follow naming conventions.

FossilOrigin-Name: 50679889c75cd3205253b1682abfbddc5ff09175

12 years agoManually define the Win32 file-mapping APIs for WAL if SQLITE_WIN32_FILEMAPPING_API... winFileMapping
mistachkin [Sun, 7 Oct 2012 00:52:22 +0000 (00:52 +0000)] 
Manually define the Win32 file-mapping APIs for WAL if SQLITE_WIN32_FILEMAPPING_API is defined.

FossilOrigin-Name: 585e2070eef3bc273f23d8e384a1261ee5fff5bd

12 years agoChanges for WinRT compatibility. Also, allow version resource compilation and embedd...
mistachkin [Sat, 6 Oct 2012 03:48:25 +0000 (03:48 +0000)] 
Changes for WinRT compatibility.  Also, allow version resource compilation and embedding to be disabled at compile-time.

FossilOrigin-Name: 4b0facc13b1026419f9b89dab3453ba43071455c

12 years agoFix a problem in shared-cache mode where a COMMIT statement might cause a busy-handle...
dan [Fri, 5 Oct 2012 19:43:02 +0000 (19:43 +0000)] 
Fix a problem in shared-cache mode where a COMMIT statement might cause a busy-handler belonging to a shared-cache connection other than the current writer to be invoked.

FossilOrigin-Name: e0c889d66ccf4af12cc77ac38c1e6477da63ac72

12 years agoMerge the shared-cache related fixes from the shared-cache-fix branch to the trunk.
dan [Fri, 5 Oct 2012 17:44:51 +0000 (17:44 +0000)] 
Merge the shared-cache related fixes from the shared-cache-fix branch to the trunk.

FossilOrigin-Name: 698ec7769d4feea1782401479c61ce67d2113fd4

12 years agoAdd a test for the collation-sequence/CHECK constraint problem fixed by the previous...
dan [Fri, 5 Oct 2012 17:18:16 +0000 (17:18 +0000)] 
Add a test for the collation-sequence/CHECK constraint problem fixed by the previous commit.

FossilOrigin-Name: 82b6aa77c8d8de4c6fad1960f5958457a929a821

12 years agoFix a problem with shared-cache mode and CHECK constraints causing one db handle...
dan [Fri, 5 Oct 2012 16:30:10 +0000 (16:30 +0000)] 
Fix a problem with shared-cache mode and CHECK constraints causing one db handle to invoke a collation sequence function registered with another.

FossilOrigin-Name: c2c776ab73828374836af008aa320cc670c081b5

12 years agoConsolidate all occurrences of the "no such collation sequence" error message
drh [Fri, 5 Oct 2012 14:43:40 +0000 (14:43 +0000)] 
Consolidate all occurrences of the "no such collation sequence" error message
into a single spot.

FossilOrigin-Name: 8ea67522fb03134f355ecb776b70c6917241cab2

12 years agoRename a tool batch file subroutine to avoid confusion about its purpose.
mistachkin [Fri, 5 Oct 2012 07:36:34 +0000 (07:36 +0000)] 
Rename a tool batch file subroutine to avoid confusion about its purpose.

FossilOrigin-Name: 43155b1543bddbb84a8bc13a5b7344b228ddacb9

12 years agoShared-cache mode fixes for views and virtual tables.
dan [Thu, 4 Oct 2012 19:33:00 +0000 (19:33 +0000)] 
Shared-cache mode fixes for views and virtual tables.

FossilOrigin-Name: 2b370dea704b59262c604af0efcef5660b194454

12 years agoYet another refactoring of ORDER BY logic in the query planner. This
drh [Thu, 4 Oct 2012 12:10:25 +0000 (12:10 +0000)] 
Yet another refactoring of ORDER BY logic in the query planner.  This
particular check-in works mostly, but still has a few minor issues.

FossilOrigin-Name: 8f4487450be1a2b0371f8251a967cbe341b2dea1

12 years agoFix an out-of-order memset() that occurs before all variable declarations
drh [Wed, 3 Oct 2012 18:09:32 +0000 (18:09 +0000)] 
Fix an out-of-order memset() that occurs before all variable declarations
are finished.  Also fix a line that exceeds the 80-character line length
limit.

FossilOrigin-Name: ba2f492f957ab5556cd540e21a76ebb75efea725

12 years agoUpdate the query planner to recognize more cases where ORDER BY clauses
drh [Wed, 3 Oct 2012 12:56:18 +0000 (12:56 +0000)] 
Update the query planner to recognize more cases where ORDER BY clauses
can be optimized out.  Add test cases to verify correct behavior of the
ORDER BY optimization when the covering-index-scan optimization is disabled.
Fix a harmless compiler warning in the TCL interface.

FossilOrigin-Name: 956e4d7f8958e7065ff2d61cd71519d6f4113d4a

12 years agoFix a query planner problem that only occurs when covering-index-scan is
drh [Wed, 3 Oct 2012 12:38:19 +0000 (12:38 +0000)] 
Fix a query planner problem that only occurs when covering-index-scan is
disabled.  Fix to tests whose output changed due to the new and more
aggressive ORDER BY optimization.

FossilOrigin-Name: 0f9bb90100aa304a7f28023ca4173e68b445e8bd

12 years agoFix the TCL interface so that SQL functions implemented in TCL honor the
drh [Wed, 3 Oct 2012 11:02:33 +0000 (11:02 +0000)] 
Fix the TCL interface so that SQL functions implemented in TCL honor the
"nullvalue" setting.  Also remove from the TCL interface some unused
legacy UTF8 translation code left over from SQLite2.

FossilOrigin-Name: c1f10a2643179ec58f3879764e9e89676d4b5f91

12 years agoFurther attempts to optimize out unnecessary ORDER BY clauses.
drh [Wed, 3 Oct 2012 00:25:54 +0000 (00:25 +0000)] 
Further attempts to optimize out unnecessary ORDER BY clauses.

FossilOrigin-Name: 6744d9a37faffed59b4d5cb96c8671ec46a87ea7

12 years agoWork around an optimization issue with the MSVC compiler for ARM.
mistachkin [Tue, 2 Oct 2012 22:54:27 +0000 (22:54 +0000)] 
Work around an optimization issue with the MSVC compiler for ARM.

FossilOrigin-Name: 7d301fdfeec540e4a58f43bff04d219e9f769dc4

12 years agoMore lenient handling of ORDER BY optimization in joins with mixed ASC/DESC.
drh [Tue, 2 Oct 2012 15:19:19 +0000 (15:19 +0000)] 
More lenient handling of ORDER BY optimization in joins with mixed ASC/DESC.
This is a better and less restrictive fix for the problem addressed by
the previous check-in.

FossilOrigin-Name: abcf6a5d054559ee5a093ba39180c47b4958d9cd

12 years agoOnly continue an ORDER BY optimization into inner loops if the equality
drh [Tue, 2 Oct 2012 14:11:29 +0000 (14:11 +0000)] 
Only continue an ORDER BY optimization into inner loops if the equality
constraints on the inner loop match terms of an outer ordered index that
are actually used by the ORDER BY clause.

FossilOrigin-Name: b0e7b4df6c2a8c479f8d210bde50c737eaa248f0

12 years agoFactor an invariant out the loop termination condition for the ORDER BY
drh [Tue, 2 Oct 2012 01:46:48 +0000 (01:46 +0000)] 
Factor an invariant out the loop termination condition for the ORDER BY
satisfied-by-index analyzer routine.

FossilOrigin-Name: 545bb33688663066cf3f09e4cdc4d5cfe59fb8db

12 years agoMake sure the outer loop cursor numbers are recorded in time for them to be
drh [Tue, 2 Oct 2012 01:25:16 +0000 (01:25 +0000)] 
Make sure the outer loop cursor numbers are recorded in time for them to be
used by the ORDER BY optimizer.

FossilOrigin-Name: 351dc8d9cab8a222f28fb865d3a7d1c622d60d6f

12 years agoImprovements to the wheretrace output.
drh [Tue, 2 Oct 2012 01:10:00 +0000 (01:10 +0000)] 
Improvements to the wheretrace output.

FossilOrigin-Name: 76b277655646a9fe0f336ff106157f1efcd32019

12 years agoFix harmless compiler warnings.
drh [Mon, 1 Oct 2012 20:32:38 +0000 (20:32 +0000)] 
Fix harmless compiler warnings.

FossilOrigin-Name: 59c2be75ff8b8ccd77320b45e4088e5bf456a1d9

12 years agoFix several compiler warnings seen with MSVC. msvcWarnings
mistachkin [Mon, 1 Oct 2012 20:12:30 +0000 (20:12 +0000)] 
Fix several compiler warnings seen with MSVC.

FossilOrigin-Name: 8b5f617c2a5f0bf7bdbd9144aee58d69564db1e2

12 years agoAdd SQLITE_FCNTL_BUSYHANDLER. Invoked to provide access to the busy-handler callback...
dan [Mon, 1 Oct 2012 18:44:33 +0000 (18:44 +0000)] 
Add SQLITE_FCNTL_BUSYHANDLER. Invoked to provide access to the busy-handler callback to custom VFS implementations.

FossilOrigin-Name: 1262d2f471214a3417dd02159a7aa2355b18f789

12 years agoMinor changes to the query planner for improved test coverage.
drh [Mon, 1 Oct 2012 17:44:05 +0000 (17:44 +0000)] 
Minor changes to the query planner for improved test coverage.

FossilOrigin-Name: c12044df322283c9deb0d7dacd8a699ac53f27b6

12 years agoOmit the sqlite3GetReservedNoMutex() routine in build configurations where
drh [Mon, 1 Oct 2012 12:44:26 +0000 (12:44 +0000)] 
Omit the sqlite3GetReservedNoMutex() routine in build configurations where
it is not used.

FossilOrigin-Name: f193dbb6b96b2f49dd0d6345802c9c006cd99e3c

12 years agoMake sure the size parameter to read and write VFS methods in the unix VFS
drh [Mon, 1 Oct 2012 12:16:26 +0000 (12:16 +0000)] 
Make sure the size parameter to read and write VFS methods in the unix VFS
do not become too big or go negative.  This was not actually possible in the
current code.  The checks are added to make sure some future bug does not
make it possible.

FossilOrigin-Name: daebe3bd2d9bd7b6f876a8110cf5045eb3fee078

12 years agoEnsure that the value returned by xSectorSize() is reasonable (currently defined...
dan [Mon, 1 Oct 2012 06:50:55 +0000 (06:50 +0000)] 
Ensure that the value returned by xSectorSize() is reasonable (currently defined as between 2^5 and 2^16 bytes) before using it to calculate the amount of padding to add to a wal file.

FossilOrigin-Name: 6b4ff83bff07d427af585c9fd03be90abf2fc82f

12 years agoImproved ORDER BY optimization when outer loops of a join return a single row.
drh [Sat, 29 Sep 2012 19:10:29 +0000 (19:10 +0000)] 
Improved ORDER BY optimization when outer loops of a join return a single row.

FossilOrigin-Name: 62225b4a4c4bfe1820ef54cb202edf2cd866429f

12 years agoDisable the bigfile tests on Macs.
drh [Sat, 29 Sep 2012 15:45:12 +0000 (15:45 +0000)] 
Disable the bigfile tests on Macs.

FossilOrigin-Name: d869eddaf208c4bf03f6bd1848f510392f9dba49

12 years agoFix compiler warnings found on Lion.
drh [Sat, 29 Sep 2012 14:45:54 +0000 (14:45 +0000)] 
Fix compiler warnings found on Lion.

FossilOrigin-Name: fd74d3d91721ca404537f195fed04c9edef20bf2

12 years agoAvoid calling sqlite3BtreeEnter() in a corner case where the corresponding database...
dan [Fri, 28 Sep 2012 20:23:42 +0000 (20:23 +0000)] 
Avoid calling sqlite3BtreeEnter() in a corner case where the corresponding database handle mutex (sqlite3.mutex) may not be held. This prevents a potential deadlock or crash that can occur if the backup API, shared-cache mode and SQLITE_HAVE_CODEC are all in use.

FossilOrigin-Name: 89b8c377a6f03d9fa885f3f94c1f0b1eec263dea

12 years agoModify the clearCell function to use SQLITE_CORRUPT_BKPT in the one place it was...
mistachkin [Fri, 28 Sep 2012 18:13:35 +0000 (18:13 +0000)] 
Modify the clearCell function to use SQLITE_CORRUPT_BKPT in the one place it was not.

FossilOrigin-Name: 472beb306a4fa7103837d4417aef7d66eef49993

12 years agoQuery planner enhancements to be more agressive about optimizing out ORDER BY
drh [Fri, 28 Sep 2012 00:44:28 +0000 (00:44 +0000)] 
Query planner enhancements to be more agressive about optimizing out ORDER BY
clauses - in particular the query planner now has the ability to omit ORDER BY
clauses that span multiple tables in a join.

FossilOrigin-Name: 1e874629d7cf568368b912b295bd3001147d0b52

12 years agoFix some corner case behavior in the new ORDER BY optimization logic.
drh [Thu, 27 Sep 2012 23:27:23 +0000 (23:27 +0000)] 
Fix some corner case behavior in the new ORDER BY optimization logic.
Remove the SQLITE_OrderByIdx bit from the
SQLITE_TESTCTRL_OPTIMIZATIONS mask, since enabling it caused many
TH3 tests to fail when the NO_OPT configuration parameter was engaged,
and since there really isn't any need to turn that optimization off.
The SQLITE_OrderByIdxJoin bit remains.

FossilOrigin-Name: 98b633717a1c9a08f6a1d00bc6bc891564ae7e9b

12 years agoModify generation of resource header file for MSVC so that it can work from outside...
mistachkin [Thu, 27 Sep 2012 21:03:53 +0000 (21:03 +0000)] 
Modify generation of resource header file for MSVC so that it can work from outside the working directory.

FossilOrigin-Name: 20caf80cb3b65e69a99dbc142db8ee435fb2dbdc

12 years agoMore test cases an bug fixes for the ORDER BY optimization of joins. All
drh [Thu, 27 Sep 2012 19:53:38 +0000 (19:53 +0000)] 
More test cases an bug fixes for the ORDER BY optimization of joins.  All
veryquick tests now pass.

FossilOrigin-Name: 0d573320057b0903a5589cabfb1b1ece1c57958e

12 years agoTest cases and bug fixes applied to the ORDER BY optimization for joins.
drh [Thu, 27 Sep 2012 17:31:32 +0000 (17:31 +0000)] 
Test cases and bug fixes applied to the ORDER BY optimization for joins.
Some test cases fail, but except for the new orderby1.test failures, all
failures appear to be issues with the tests, not with the core code.

FossilOrigin-Name: 75cda864ededb6dc0f84bd52ed3311753a58e351

12 years agoAdd more bits to the bit vector that is used to disable optimizations for
drh [Thu, 27 Sep 2012 15:05:54 +0000 (15:05 +0000)] 
Add more bits to the bit vector that is used to disable optimizations for
built-in test.  Add specific bit patterns to disable ORDER BY using an
index in general and for joins.  Use macros to test for bits in the
disabled-optimization bit vector, in order to make the code clearer.

FossilOrigin-Name: d2fcba1e143beca8c45724d2108870657c269e17

12 years agoEnable ORDER BY clauses that span joins to be optimized out.
drh [Thu, 27 Sep 2012 14:11:36 +0000 (14:11 +0000)] 
Enable ORDER BY clauses that span joins to be optimized out.

FossilOrigin-Name: c29538f9b1ee4d4869999570604c9618ca0d08ac

12 years agoMerge the "PRAGMA busy_timeout" change into trunk.
drh [Thu, 27 Sep 2012 12:11:25 +0000 (12:11 +0000)] 
Merge the "PRAGMA busy_timeout" change into trunk.

FossilOrigin-Name: 1a679a1ef3b4f2d898c8cd83432d2b4c12bd93fa

12 years agoFurther tweaks to the query planner logic in preparation for adding
drh [Thu, 27 Sep 2012 12:05:09 +0000 (12:05 +0000)] 
Further tweaks to the query planner logic in preparation for adding
ORDER BY opt-out for joins.

FossilOrigin-Name: 53efc10af990d3f293551f3cd8ef2f8be2d9d716

12 years agoFurther refactoring of the ORDER BY related query-planning logic in order
drh [Wed, 26 Sep 2012 23:17:01 +0000 (23:17 +0000)] 
Further refactoring of the ORDER BY related query-planning logic in order
to make it easier to extend to support optimizing out ORDER BY on joins.
No actual behavior changes, yet.

FossilOrigin-Name: 96496ddae12a239b30a1fc997fbea43e3a75bfe7

12 years agoAugment the WhereBestIdx structure to pass down into the query planner
drh [Tue, 25 Sep 2012 20:43:35 +0000 (20:43 +0000)] 
Augment the WhereBestIdx structure to pass down into the query planner
information that might be used to better detect ORDER BY and DISTINCT
optimizations spanning multiple tables of a join.

FossilOrigin-Name: 4226e51ff837f0ffe16355491a655d919d13488e

12 years agoPass information around between the major routines of the query planner
drh [Tue, 25 Sep 2012 14:29:39 +0000 (14:29 +0000)] 
Pass information around between the major routines of the query planner
using a single pointer to a structure rather than a long list of parameters.

FossilOrigin-Name: 1104d42e104d561ce60d05d158acfe499ee9fd50

12 years agoRemove an unused subfunction parameter and an obsolete comment from the
drh [Mon, 24 Sep 2012 19:50:00 +0000 (19:50 +0000)] 
Remove an unused subfunction parameter and an obsolete comment from the
query planner logic in where.c.

FossilOrigin-Name: 349a55cd8ba9ce65ebfd987ecfebd1204f7d0a85

12 years agoChange the internal sqlite3WhereBegin() to report that the ORDER BY clause
drh [Mon, 24 Sep 2012 15:30:54 +0000 (15:30 +0000)] 
Change the internal sqlite3WhereBegin() to report that the ORDER BY clause
is satisfied by indices using the WhereInfo.nOBSat field of the returned
structure.

FossilOrigin-Name: 22989f3588531efd555cc29d6c576e7a34b7edc4

12 years agoUpdate documentation to describe the threadsafety of
drh [Mon, 24 Sep 2012 11:43:43 +0000 (11:43 +0000)] 
Update documentation to describe the threadsafety of
sqlite3_enable_shared_cache().

FossilOrigin-Name: e081890cd77ad8de4bf55a8f8cf9d63bfaaf8218

12 years agoEnable query planner tracing using the new (and undocumented) ".wheretrace 1"
drh [Fri, 21 Sep 2012 22:50:45 +0000 (22:50 +0000)] 
Enable query planner tracing using the new (and undocumented) ".wheretrace 1"
command in the command-line shell if both the shell and the core are
compiled with SQLITE_DEBUG and SQLITE_ENABLE_WHERETRACE.  This is not a
supported API. Use for testing and debugging only.

FossilOrigin-Name: 1be4b16b9e900181ae6848f2920ea646f407c9dc

12 years agoCommand-line shell enhancements: Added the ".print" command. Enhanced
drh [Fri, 21 Sep 2012 13:40:02 +0000 (13:40 +0000)] 
Command-line shell enhancements:  Added the ".print" command.  Enhanced
the ".width" command so that negative widths will right-justify.

FossilOrigin-Name: a1d8269da3868e41a6603c1a683e324fe21fb317

12 years agoConsolidate more of the DISTINCT processing logic into a single spot in the
drh [Fri, 21 Sep 2012 00:04:28 +0000 (00:04 +0000)] 
Consolidate more of the DISTINCT processing logic into a single spot in the
code.  Reduce the number of OP_Column operations needed to perform a
WHERE_DISTINCT_ORDERED.

FossilOrigin-Name: 79e922f7ae29bbe06d639d648fbd72523cf9a28e

12 years agoContinuing incremental enhancements of SELECT code generation:
drh [Thu, 20 Sep 2012 15:41:31 +0000 (15:41 +0000)] 
Continuing incremental enhancements of SELECT code generation:
Remove the Select.affinity field.  Use SelectDest.affSdst instead.

FossilOrigin-Name: cf40b7b5ebdacc3215d769aadacce8c9e7e9dfbb

12 years agoRefactoring of DISTINCT code. Change the name of the local variable
drh [Thu, 20 Sep 2012 14:26:22 +0000 (14:26 +0000)] 
Refactoring of DISTINCT code.  Change the name of the local variable
"distinct" to "distinctTab".  Generate cleaner code w/o unnecessary P4
and P5 values on the OP_Null for WHERE_DISTINCT_ORDERED.

FossilOrigin-Name: 0cda241a2bcb3c6f2ae6c48f522780bc4eddfc02

12 years agoTighter VDBE code for the WHERE_DISTINCT_ORDERED case of DISTINCT keyword
drh [Wed, 19 Sep 2012 21:15:46 +0000 (21:15 +0000)] 
Tighter VDBE code for the WHERE_DISTINCT_ORDERED case of DISTINCT keyword
handling.

FossilOrigin-Name: 94b48064db3cbb43e911fdf7183218b08146ec10

12 years agoAdd comments to the WHERE_DISTINCT_* macros. No changes to code.
drh [Wed, 19 Sep 2012 17:31:15 +0000 (17:31 +0000)] 
Add comments to the WHERE_DISTINCT_* macros.  No changes to code.

FossilOrigin-Name: 82320501904f65030622a67836ba30f412169056

12 years agoMerge the covering-index-scan optimization into trunk.
drh [Wed, 19 Sep 2012 00:35:31 +0000 (00:35 +0000)] 
Merge the covering-index-scan optimization into trunk.

FossilOrigin-Name: ddd5d789e7ae4a66cd7b7fa79e48d2777f95350b

12 years agoSilence harmless compiler warning seen with SQLITE_OMIT_DEPRECATED.
mistachkin [Tue, 18 Sep 2012 23:21:32 +0000 (23:21 +0000)] 
Silence harmless compiler warning seen with SQLITE_OMIT_DEPRECATED.

FossilOrigin-Name: c5cee969322d14114e4136510c3891a2e743520d