Commit Graph

10325 Commits

Author SHA1 Message Date
drh
f7c7031f52 Define the sqlite3PagerWalFramesize() function even if SQLITE_OMIT_WAL is used.
FossilOrigin-Name: 96247853ef3d556a13b899b4c907b9fa2c78d513
2012-10-10 12:14:09 +00:00
drh
453a312091 Add support for URI filenames in sqlite3_analyzer.
FossilOrigin-Name: 6dc987d32ba4d09b811ef281cdae09be17ac936c
2012-10-10 10:52:46 +00:00
dan
06a2d82566 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
2012-10-10 09:46:29 +00:00
drh
90abfd086f Merge the fix for ticket [d02e1406a58ea02] into trunk.
FossilOrigin-Name: dd34bec389359845b86f4cc4906ab440f92dcab9
2012-10-09 21:07:23 +00:00
drh
5a05be1b68 Attempt to suppress warnings generated by Coverity.
FossilOrigin-Name: 7b1a6e6cb5099076bf19db142b17c99044a869cd
2012-10-09 18:51:44 +00:00
drh
5a55826bcd 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
2012-10-09 14:36:47 +00:00
drh
2f546ee914 Bring some comments up to date in the query planner, and especially the
ORDER BY optimizer.  Also add testcase() macros.

FossilOrigin-Name: bb5c0f1c92b48631d4a12cd4f321b53cd07885c8
2012-10-09 09:26:28 +00:00
drh
86257fff87 Remove an unused variable. Fix code that occurs before a variable
declaration.

FossilOrigin-Name: 01dc032b5bbd9c9ebb1965f176ca5d732cda85ea
2012-10-09 01:39:25 +00:00
drh
69a76bad73 Replace an always-false conditional with an assert().
FossilOrigin-Name: 981b9943e4b2b660690ec1ac145abdd3c74f8dd2
2012-10-09 01:23:25 +00:00
drh
c31c7c1c6e Changes to facilitate full test coverage.
FossilOrigin-Name: 28d1eb40bfc4c993010ce670ee10780ca2ae5c9c
2012-10-08 23:25:07 +00:00
drh
3a17ea7ab6 Merge ORDER BY optimization refactoring and repair into trunk.
FossilOrigin-Name: c027a9af9137f3346dbb5c5e100a087c2e89797b
2012-10-08 21:51:58 +00:00
drh
2fad815c52 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
2012-10-08 21:01:15 +00:00
drh
6b9e565e54 Further tweaks to the ORDER BY optimizer, to fix a bug and to get the
optimizer to recognize some additional cases.

FossilOrigin-Name: bcb4f262476193cfb17818d8c62bab528dddeef9
2012-10-08 20:27:35 +00:00
drh
0a4c741cab Bug fixes in the ORDER BY optimizer.
FossilOrigin-Name: 301bbee4045aa169e29fb4fb75743b71eb4760a1
2012-10-08 19:41:38 +00:00
drh
8e4af1b997 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
2012-10-08 18:23:51 +00:00
mistachkin
31d72112fa Manually define the Win32 file-mapping APIs for WAL if SQLITE_WIN32_FILEMAPPING_API is defined.
FossilOrigin-Name: 1c2c0a2880dd0ee8862352e307142b8de7e80d13
2012-10-08 14:36:42 +00:00
mistachkin
3038cfe90a Corrections to test names to eliminate duplicates and follow naming conventions.
FossilOrigin-Name: 50679889c75cd3205253b1682abfbddc5ff09175
2012-10-07 05:34:39 +00:00
mistachkin
f1dacbfc5b Manually define the Win32 file-mapping APIs for WAL if SQLITE_WIN32_FILEMAPPING_API is defined.
FossilOrigin-Name: 585e2070eef3bc273f23d8e384a1261ee5fff5bd
2012-10-07 00:52:22 +00:00
mistachkin
08c1c3150b Changes for WinRT compatibility. Also, allow version resource compilation and embedding to be disabled at compile-time.
FossilOrigin-Name: 4b0facc13b1026419f9b89dab3453ba43071455c
2012-10-06 03:48:25 +00:00
dan
6b9bb59f82 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
2012-10-05 19:43:02 +00:00
dan
aedf9ee73a Merge the shared-cache related fixes from the shared-cache-fix branch to the trunk.
FossilOrigin-Name: 698ec7769d4feea1782401479c61ce67d2113fd4
2012-10-05 17:44:51 +00:00
dan
a2ebe4b418 Add a test for the collation-sequence/CHECK constraint problem fixed by the previous commit.
FossilOrigin-Name: 82b6aa77c8d8de4c6fad1960f5958457a929a821
2012-10-05 17:18:16 +00:00
dan
1e92fb59b2 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
2012-10-05 16:30:10 +00:00
drh
79e72a50aa Consolidate all occurrences of the "no such collation sequence" error message
into a single spot.

FossilOrigin-Name: 8ea67522fb03134f355ecb776b70c6917241cab2
2012-10-05 14:43:40 +00:00
mistachkin
d744fccdbd Rename a tool batch file subroutine to avoid confusion about its purpose.
FossilOrigin-Name: 43155b1543bddbb84a8bc13a5b7344b228ddacb9
2012-10-05 07:36:34 +00:00
dan
41fb5cd103 Shared-cache mode fixes for views and virtual tables.
FossilOrigin-Name: 2b370dea704b59262c604af0efcef5660b194454
2012-10-04 19:33:00 +00:00
drh
4f68d6c8c0 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
2012-10-04 12:10:25 +00:00
drh
613a53a029 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
2012-10-03 18:09:32 +00:00
drh
325eff58d6 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
2012-10-03 12:56:18 +00:00
drh
6f0e400cba 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
2012-10-03 12:38:19 +00:00
drh
c45e67162d 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
2012-10-03 11:02:33 +00:00
drh
d663b5bdef Further attempts to optimize out unnecessary ORDER BY clauses.
FossilOrigin-Name: 6744d9a37faffed59b4d5cb96c8671ec46a87ea7
2012-10-03 00:25:54 +00:00
mistachkin
e7c54168fa Work around an optimization issue with the MSVC compiler for ARM.
FossilOrigin-Name: 7d301fdfeec540e4a58f43bff04d219e9f769dc4
2012-10-02 22:54:27 +00:00
drh
afcd522af8 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
2012-10-02 15:19:19 +00:00
drh
178eb61c6b 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
2012-10-02 14:11:29 +00:00
drh
3be57d2aba Factor an invariant out the loop termination condition for the ORDER BY
satisfied-by-index analyzer routine.

FossilOrigin-Name: 545bb33688663066cf3f09e4cdc4d5cfe59fb8db
2012-10-02 01:46:48 +00:00
drh
a578d048c6 Make sure the outer loop cursor numbers are recorded in time for them to be
used by the ORDER BY optimizer.

FossilOrigin-Name: 351dc8d9cab8a222f28fb865d3a7d1c622d60d6f
2012-10-02 01:25:16 +00:00
drh
1afcaaea7a Improvements to the wheretrace output.
FossilOrigin-Name: 76b277655646a9fe0f336ff106157f1efcd32019
2012-10-02 01:10:00 +00:00
drh
5ff00f4b00 Fix harmless compiler warnings.
FossilOrigin-Name: 59c2be75ff8b8ccd77320b45e4088e5bf456a1d9
2012-10-01 20:32:38 +00:00
mistachkin
c197eedbb4 Fix several compiler warnings seen with MSVC.
FossilOrigin-Name: 8b5f617c2a5f0bf7bdbd9144aee58d69564db1e2
2012-10-01 20:12:30 +00:00
dan
80bb6f8217 Add SQLITE_FCNTL_BUSYHANDLER. Invoked to provide access to the busy-handler callback to custom VFS implementations.
FossilOrigin-Name: 1262d2f471214a3417dd02159a7aa2355b18f789
2012-10-01 18:44:33 +00:00
drh
04b85bc609 Minor changes to the query planner for improved test coverage.
FossilOrigin-Name: c12044df322283c9deb0d7dacd8a699ac53f27b6
2012-10-01 17:44:05 +00:00
drh
a1f3853793 Omit the sqlite3GetReservedNoMutex() routine in build configurations where
it is not used.

FossilOrigin-Name: f193dbb6b96b2f49dd0d6345802c9c006cd99e3c
2012-10-01 12:44:26 +00:00
drh
c1fd2cfed2 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
2012-10-01 12:16:26 +00:00
dan
c9a5326974 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
2012-10-01 06:50:55 +00:00
drh
60441af4f2 Improved ORDER BY optimization when outer loops of a join return a single row.
FossilOrigin-Name: 62225b4a4c4bfe1820ef54cb202edf2cd866429f
2012-09-29 19:10:29 +00:00
drh
befda46598 Disable the bigfile tests on Macs.
FossilOrigin-Name: d869eddaf208c4bf03f6bd1848f510392f9dba49
2012-09-29 15:45:12 +00:00
drh
b3f787f4c7 Fix compiler warnings found on Lion.
FossilOrigin-Name: fd74d3d91721ca404537f195fed04c9edef20bf2
2012-09-29 14:45:54 +00:00
dan
0094f37e1f 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
2012-09-28 20:23:42 +00:00
mistachkin
70a1b71fb6 Modify the clearCell function to use SQLITE_CORRUPT_BKPT in the one place it was not.
FossilOrigin-Name: 472beb306a4fa7103837d4417aef7d66eef49993
2012-09-28 18:13:35 +00:00