Commit Graph

15512 Commits

Author SHA1 Message Date
drh
769b4c95ca Move the write failure test in memjrnlCreateFile() to just after the
actual write, thus reducing the number of instances of the test by one.

FossilOrigin-Name: 7f00d80c63b15376391f661d872f2b29a970702d
2016-03-09 03:44:32 +00:00
drh
c1fb2b87bd Update a comment in btree.c to account for WITHOUT ROWID tables. No code
changes.

FossilOrigin-Name: fa20dcb03b92be3bb32f8e3d6f88681ace3f6c84
2016-03-09 03:29:27 +00:00
drh
2f1e02e8a7 Change a branch made obsolete by recent parser enhancements into an assert().
FossilOrigin-Name: ee486ef742557244f532e8d3b3604ff04e024b8a
2016-03-09 02:12:44 +00:00
drh
273021d71a Add an #ifdef and an ALWAYS() for coverage.
FossilOrigin-Name: 069337a922867ad0d023f5bf36e13ea46e047000
2016-03-09 02:03:03 +00:00
drh
d1cca3b721 Change an unreachable branch in the virtual table query planner into
an assert().

FossilOrigin-Name: 73b97b9ec3c39ab2828ae6353b5d7e04a27996c9
2016-03-08 23:44:48 +00:00
drh
3349d9bea9 Improved comments on virtual table query planning. Added many new
WHERETRACE() macros.

FossilOrigin-Name: 4c89c2534abcf67bc486d5a900a84a6c4f59537e
2016-03-08 23:18:51 +00:00
drh
c629e63a55 In memjournal.c, reuse the same sqlite3_file object for both the in-memory
phase and the on-disk phase.

FossilOrigin-Name: e7fbbdc25c0991d4e58d78a5fcb7386e1aa7f3af
2016-03-08 17:59:19 +00:00
dan
7ed4020890 Modify the memjournal.c code to make it a bit smaller.
FossilOrigin-Name: d99ac4154812065eef26c298de52954d7ee0bd75
2016-03-08 17:44:08 +00:00
drh
33b104af08 Drop support for SQLITE_EXTRA_DURABLE. The new SQLITE_DEFAULT_SYNCHRONOUS
compile-time option is a more general replacement.

FossilOrigin-Name: f6d3156ba9af1da517dd77c1df03fa7869888463
2016-03-08 16:07:59 +00:00
drh
15d36c603d Remove an unused goto label in the RBU extension.
FossilOrigin-Name: 2179a106e8dd7943d4f37093e65ce7826720904e
2016-03-08 16:02:37 +00:00
dan
d0b8b664bd Add a new row type to RBU (a peer of insert, update and delete) - "delete then insert".
FossilOrigin-Name: 1d9468d2427d2c9b7240b364554ac85a0b62fa44
2016-03-08 15:52:43 +00:00
drh
9219bf9839 Add the SQLITE_DEFAULT_SYNCHRONOUS and SQLITE_DEFAULT_WAL_SYNCHRONOUS
compile-time options.  Automatically switch to the WAL_SYNCHRONOUS setting
when first opening a WAL-mode database if the synchronous setting has not
been previously set by the application.

FossilOrigin-Name: 5a847a676e756bbe33436596d4279f339bfb247c
2016-03-08 15:47:47 +00:00
dan
c7dbce0f2a Update fts3/4 so that the 'merge=X,Y' command merges at least, instead of exactly, Y segments from a single level. This matches the documentation. 'merge=X,0' is, as it was in 3.11, an error.
FossilOrigin-Name: 64b3cb29159491cbfab7e01844b54408541ece5e
2016-03-08 15:37:48 +00:00
drh
c2ae2073d9 Make the SQLITE_DEFAULT_SYNCHRONOUS and SQLITE_DEFAULT_WAL_SYNCHRONOUS
values zero-based to agree with PRAGMA synchronous.

FossilOrigin-Name: 592d2104361500e5002783ba329a2609389c57b9
2016-03-08 15:30:01 +00:00
drh
e243de5cf5 If SQLITE_DEFAULT_WAL_SYNCHRONOUS is not the same value as
SQLITE_DEFAULT_SYNCHRONOUS and the application has not run
"PRAGMA synchronous", then set synchronous to the 
SQLITE_DEFAULT_WAL_SYNCHRONOUS setting when entering WAL mode for
the first time.

FossilOrigin-Name: 5791407b523abd24e832fc2361b3e9f01ee2f36a
2016-03-08 15:14:26 +00:00
drh
50a1a5aaca Add compile-time options SQLITE_DEFAULT_SYNCHRONOUS and
SQLITE_DEFAULT_WAL_SYNCHRONOUS used to specify the default synchronous
settings for all database connections.

FossilOrigin-Name: 1fefa967aa93372d232b96b1e0232b7b855d6d00
2016-03-08 14:40:11 +00:00
drh
6702f761ea Fix ATTACH to use the symbolic name PAGER_SYNCHRONOUS_FULL rather than
an integer literal.

FossilOrigin-Name: c4e192a0e5a408e198dbacb2752859a00d2b572f
2016-03-08 14:16:23 +00:00
drh
0dba3304f6 Fix comments on pager flag settings to include synchronous=EXTRA.
FossilOrigin-Name: 3a65a1fc0fd2408c6984153801ec5dcd5211c897
2016-03-08 13:56:02 +00:00
drh
6de32e7cdb Simplified error detection in the xBestIndex processing.
FossilOrigin-Name: 82ca2131b670505578628687746135ac413d156b
2016-03-08 02:59:33 +00:00
drh
8426e36c8f Add the ALLBITS macro as a shorthand for "(Bitmask)(-1)".
FossilOrigin-Name: 91bd619d27e4d91510a187bbb88de961a31c8a2e
2016-03-08 01:32:30 +00:00
drh
599d576456 Add a NEVER() to the code generator. Change the parameter name "mExtra"
to "mPrereq" in the query planner, to more closely reflect its meaning.

FossilOrigin-Name: 721ae51e443647291f3a8f7f2128aa410fee2682
2016-03-08 01:11:51 +00:00
drh
fb826b8c13 Changes so that some assert()s in the virtual table query planner are
correct even following an OOM error.

FossilOrigin-Name: 9805f6f85211dcb5a0ab3ceca204e6f2e48530ea
2016-03-08 00:39:58 +00:00
dan
108b7953ed Update fts3/4 so that the 'merge=X,0' command merges X pages from all segments of the first level in the fts index that contains 2 or more segments.
FossilOrigin-Name: cddf69dbc46f10ee7e87538dd850e086386b544c
2016-03-07 20:14:27 +00:00
drh
237b2b7111 Avoid a NULL pointer dereference following an OOM while generating code
for IN operators on virtual tables.

FossilOrigin-Name: c924008692e35f1f5144830af08d6de051dd21dd
2016-03-07 19:08:27 +00:00
dan
e45216fd9d Add a new row type to RBU (a peer of insert, update and delete) - "delete then insert".
FossilOrigin-Name: 169311c85b30f625bdb6986c9cd11db70942d73b
2016-03-07 17:39:30 +00:00
drh
8c71a98ce1 Add the SQLITE_CONFIG_STMTJRNL_SPILL option for sqlite3_config().
FossilOrigin-Name: b6c4202432dc96f8f1740f52d0bf872116357fcc
2016-03-07 17:37:37 +00:00
dan
104ead923e Fix a problem in the previous commit affecting queries with three or more tables joined together to the right of a LEFT or CROSS JOIN operator.
FossilOrigin-Name: d8d89d69a490a708b83147945f74134ae0e4b387
2016-03-05 21:32:14 +00:00
dan
6a1e076939 Change the way SQLite invokes the xBestIndex method of virtual tables so that N-way joins involving virtual tables work as expected.
FossilOrigin-Name: 195444380bafd3d95d37ad83047c75ca20978de4
2016-03-05 21:07:49 +00:00
drh
2ea74dc805 Adjust the cost estimates for RTREE such that the expected number of rows and
expected cost is halved for each additional constraint.

FossilOrigin-Name: fd7cd0609381a85673d1f737ebeb19dde3de180f
2016-03-05 20:28:24 +00:00
dan
115305ff00 Change the way SQLite invokes the xBestIndex method of virtual tables so that N-way joins involving virtual tables work as expected.
FossilOrigin-Name: ffc65968ede2c402e616147e6e3d737e6f9de21d
2016-03-05 17:29:08 +00:00
drh
c2f18adde5 Remove the unused journal.c source file (its function have been subsumed into
memjournal.c).  Refactor some of the names in memjournal.c.  No functional
changes.

FossilOrigin-Name: 5f2a262d3f6b1531001326faf1d3b3d92c20a30a
2016-03-05 15:35:09 +00:00
drh
65a7e769e7 Work around (incorrect) ASAN warnings in memjournal.c.
FossilOrigin-Name: 4de09777dad6188b7e897473700af3c9655e8547
2016-03-05 15:03:31 +00:00
drh
07eab3b87f Fix an integer size mismatch problem in test_bestindex.c
FossilOrigin-Name: 2e35eb6b7464455467c868adfbcaad4da16d3207
2016-03-05 14:19:32 +00:00
drh
14bfd99143 Fix an incorrect #ifdef on sqlite3LogEstToInt().
FossilOrigin-Name: dca7b23354a6b08c926b6ed3f7345d942a409862
2016-03-05 14:00:09 +00:00
drh
6f17c09fcf Fix an assert() in sqlite3VarintLen(), even though it is impossible to hit
in SQLite due to the way sqlite3VarintLen() is used.

FossilOrigin-Name: 251424c5869f43012fc1e1a545de362036b883db
2016-03-04 21:18:09 +00:00
drh
3298a641a2 Defer opening and writing statement journals until the size reaches a
threshold (currently 64KiB).

FossilOrigin-Name: cb9302cca423de41305719a49208daa392ec09da
2016-03-04 14:43:44 +00:00
drh
3ac9a86415 Update test cases to taken deferred statement-journal opening into account.
FossilOrigin-Name: 5b2fe5219ab9ad15969e3374894a75979b65cb3c
2016-03-04 14:23:10 +00:00
drh
14520bfd23 Merge changes from trunk.
FossilOrigin-Name: a87305dfd49ee17632d0bce66ce7c2e9407b7b3e
2016-03-04 13:08:35 +00:00
drh
94580868f5 Change the default cache_size to -2000 (which means 2000*1024 bytes
independent of page_size).

FossilOrigin-Name: 2682e8e413fadbca0673f242769af17bfd291559
2016-03-04 04:01:43 +00:00
drh
9878fefd6f Change the default page size for new database files to 4096 (from 1024).
Except, when building the testfixture, preserve the legacy page size.
Also fix a comment on SQLITE_MAX_ATTACHED.

FossilOrigin-Name: 2e8a9ca9d3d6efddc31f01074d14acae56568c37
2016-03-04 03:43:10 +00:00
drh
e808d7c1fe Detect the presence of pread()/pwrite() system calls on unix systems and
use them if available.

FossilOrigin-Name: 82cbf5ad2ed988a006106e188e98096a52e6779d
2016-03-04 03:20:05 +00:00
drh
79a2ca3944 Further fixes to the pread()/pwrite() enabling logic.
FossilOrigin-Name: 38fb54e7854ac0500a88585ff9dd7487b4b2e586
2016-03-04 03:14:39 +00:00
drh
a46cadc42e Fix the build for cases when pread()/pwrite() are not available.
FossilOrigin-Name: 7d67d876b70c7a4199697c5b112d809c600e140e
2016-03-04 03:02:06 +00:00
drh
ddebf16f1f Add the test_bestindex.c file to Makefile.in and Makefile.msc so that
"make test" will work again.

FossilOrigin-Name: 6ec6b6a97e62be1abe1e349b5bc04c6f5ae88968
2016-03-04 02:59:35 +00:00
drh
e32a256acd Update the configure script to detect pread/pwrite and update os_unix.c to
use those routines if they are available.

FossilOrigin-Name: 2cffb9e50bed77d1079603f5b4a71b7559de7294
2016-03-04 02:38:00 +00:00
drh
ff6b826631 Get in-memory subjournals working for builds without SQLITE_ENABLE_ATOMIC_WRITE.
FossilOrigin-Name: b5378dcea53d4cd1744d13ddee5e50869607b771
2016-03-04 00:13:29 +00:00
drh
a05fc913ab Merge the latest updates from trunk.
FossilOrigin-Name: 55c00f716dc98b188c91f3a5a010242c9497785f
2016-03-03 21:29:10 +00:00
drh
862acaa3f4 Reduce the amount of heap memory required to store many schemas by storing
the column datatype appended to the column name (with a \000 separator), 
rather than in separate memory allocation.

FossilOrigin-Name: 16fbf2e19c22df9441aef5c8b7f5670adc38a6b6
2016-03-03 21:22:53 +00:00
drh
2b33f6e775 Allow the left-hand side of IN operators on virtual tables to have the
aConstraintUsage[].omit flag clear.

FossilOrigin-Name: 3eb74342740cd393e03aa38cd01690ccab173b76
2016-03-03 20:42:18 +00:00
drh
5b38201708 Merge 3.11.1 changes into trunk.
FossilOrigin-Name: 7abc2dd953477797fa05421b061d73596aa025fb
2016-03-03 17:54:30 +00:00