]> git.ipfire.org Git - thirdparty/sqlite.git/log
thirdparty/sqlite.git
7 years agoExperimentally add the SQLite expert functionality to the shell tool. expert-in-shell
dan [Tue, 19 Dec 2017 17:42:13 +0000 (17:42 +0000)] 
Experimentally add the SQLite expert functionality to the shell tool.

FossilOrigin-Name: 51068dbaeaef13bb80af8126b8c4f3a454dee63de5127d706db50bf789533e60

7 years agoAdd the sqlite3_vtab_collation() function, which allows an xBestIndex callback
dan [Sat, 16 Dec 2017 19:36:52 +0000 (19:36 +0000)] 
Add the sqlite3_vtab_collation() function, which allows an xBestIndex callback
to determine the collation sequence that SQLite will use for a comparison. And
the SQLITE_DBCONFIG_FULL_EQP configuration option, which enhances the output
of "EXPLAIN QUERY PLAN" so that it includes statements run by triggers. And
the code for the sqlite3_expert extension and command line application.

FossilOrigin-Name: 4c782c950204c09c1d8f857c39c4cf476539ec4e7eee6fd86419d47cf0f8b9e0

7 years agoMerge latest trunk changes into this branch. schemalint
dan [Sat, 16 Dec 2017 19:16:24 +0000 (19:16 +0000)] 
Merge latest trunk changes into this branch.

FossilOrigin-Name: d5b597b52a1213cdf382d96f4df3535727be0852b25bafd12bbef54da946c5f2

7 years agoAdd unnecessary initializations to some local variables in the rtree module
drh [Sat, 16 Dec 2017 04:37:15 +0000 (04:37 +0000)] 
Add unnecessary initializations to some local variables in the rtree module
to suppress false-positive compiler warnings coming out of MSVC.

FossilOrigin-Name: 64487d658cb3b6c8c67f1e198c70813c963de52599f3ea974bdc2aa432e74de9

7 years agoEnhance the "swarmvtab" extension. See header comments in ext/misc/unionvtab.c
dan [Fri, 15 Dec 2017 20:21:17 +0000 (20:21 +0000)] 
Enhance the "swarmvtab" extension. See header comments in ext/misc/unionvtab.c
for details.

FossilOrigin-Name: 01c173651ab22b7b0c139eded6f2ad8504efd09088df8ae6a3471230ebf2306f

7 years agoIn the LEMON parser generator, provide reduce actions with access to the
drh [Fri, 15 Dec 2017 12:22:21 +0000 (12:22 +0000)] 
In the LEMON parser generator, provide reduce actions with access to the
lookahead token.

FossilOrigin-Name: 42af190f4f86ad60de02800054010fafd484ac86ca41e2a13799b2e583eea98c

7 years agoIn valueFromExpr() only generate a OOM fault if there have been now prior
drh [Wed, 13 Dec 2017 23:47:55 +0000 (23:47 +0000)] 
In valueFromExpr() only generate a OOM fault if there have been now prior
faults.

FossilOrigin-Name: 3765aaf712998af5ffb6bc680a0c1419f2b5deb47ecbc1835ba5879127c4dbe3

7 years agoAdd support for the 'lsm1.c' target in the MSVC makefile.
mistachkin [Wed, 13 Dec 2017 22:42:55 +0000 (22:42 +0000)] 
Add support for the 'lsm1.c' target in the MSVC makefile.

FossilOrigin-Name: 6de21deac469ab25378656f6f58115a92f5892428c6f2f3545c9bafac37e4a41

7 years agoAn improved way of generating the SQLITE_READONLY_DIRECTORY error.
drh [Wed, 13 Dec 2017 20:35:34 +0000 (20:35 +0000)] 
An improved way of generating the SQLITE_READONLY_DIRECTORY error.
The error message submitted to sqlite3_log() is still correct this way.

FossilOrigin-Name: 1c0aa919ee429cd194820ec9c54084563f39e63fd399b23f859fc6703b429b15

7 years agoNew result code SQLITE_READONLY_DIRECTORY is returned when an attempt is
drh [Wed, 13 Dec 2017 20:02:29 +0000 (20:02 +0000)] 
New result code SQLITE_READONLY_DIRECTORY is returned when an attempt is
made to write on a database file that is in a read-only directory and hence
the journal file could not be created.  This situation formerly returned
SQLITE_CANTOPEN, which less helpful.

FossilOrigin-Name: 3ec73c38f878d73d278fce99ba10c708dcc475835774f1e17769ff7315be6d7c

7 years agoCorrectly invalidate a column cache line when it is overwritten with NULL.
drh [Wed, 13 Dec 2017 18:01:52 +0000 (18:01 +0000)] 
Correctly invalidate a column cache line when it is overwritten with NULL.
Fix for ticket [123c9ba32130a6c9d432].

FossilOrigin-Name: 65754dc3b830ef9482655d2e93c2cd4acaa7a8715a58d8309955d04378541f89

7 years agoChange some LSM code internal typenames from "Blob" and "Pgno" to "LsmBlob"
dan [Wed, 13 Dec 2017 15:32:33 +0000 (15:32 +0000)] 
Change some LSM code internal typenames from "Blob" and "Pgno" to "LsmBlob"
and "LsmPgno". This allows the LSM code to be compiled as a single unit with
sqlite3.c.

FossilOrigin-Name: 30bf38d589adf0b2eb613e184ffb03ed7e625736cb04fd5c341328f72bc5ef4d

7 years agoAdd script to amalgamate all LSM files into "lsm1.c".
dan [Wed, 13 Dec 2017 14:22:48 +0000 (14:22 +0000)] 
Add script to amalgamate all LSM files into "lsm1.c".

FossilOrigin-Name: e32b69d73062e233b0ac853611d10b24546a346a603289ab0e339a3604ae2af4

7 years agoMinor enhancement to two assert() statements in the default VFSes.
drh [Wed, 13 Dec 2017 10:11:09 +0000 (10:11 +0000)] 
Minor enhancement to two assert() statements in the default VFSes.

FossilOrigin-Name: 9cede8a83ca4cd88d504050115e1e89e7b3d3cd3cb2ffb5b8961e311a23ff5e2

7 years agoFix a buffer overwrite in fts5 that could occur when processing a prefix
dan [Mon, 11 Dec 2017 17:20:37 +0000 (17:20 +0000)] 
Fix a buffer overwrite in fts5 that could occur when processing a prefix
query.

FossilOrigin-Name: 92fc146bc2b781e7e2d7138b00e5ea649c6fee1c2b8449420460a1b3e5c9661b

7 years agoFix a harmless API signature mismatch in the unix VFS.
drh [Sat, 9 Dec 2017 01:02:33 +0000 (01:02 +0000)] 
Fix a harmless API signature mismatch in the unix VFS.

FossilOrigin-Name: bab9de7fdda20a724f7c21ec2c25b488ece08b685f1e4fd15c9e73b6b4a0133a

7 years agoThe query planner tries to avoids using indexes that use unknown collating
drh [Fri, 8 Dec 2017 19:37:04 +0000 (19:37 +0000)] 
The query planner tries to avoids using indexes that use unknown collating
functions.

FossilOrigin-Name: 02013fc120bf71a8be3550c696a588af8c92f2209f8e5db530624878ddc8aa7e

7 years agoAdd compile time switch SQLITE_ENABLE_ICU_COLLATIONS. For enabling ICU
dan [Fri, 8 Dec 2017 16:23:38 +0000 (16:23 +0000)] 
Add compile time switch SQLITE_ENABLE_ICU_COLLATIONS. For enabling ICU
collations without also enabling the tokenizer, the LIKE operator, the
REGEXP operator, or the unicode aware upper()/lower() scalar functions.

FossilOrigin-Name: a079f914522d7bc4b3d27d70114eb09adedfac936a64883e6ed8d382c428dd0e

7 years agoMake sure the bComplex variable in sqlite3DeleteFrom() is initialized when
drh [Fri, 8 Dec 2017 14:07:14 +0000 (14:07 +0000)] 
Make sure the bComplex variable in sqlite3DeleteFrom() is initialized when
compiling with -DSQLITE_OMIT_TRIGGER.

FossilOrigin-Name: e526d0c40b971d970367a52a57d3920cb64e6a98920114bfac46ba009f0b1eb5

7 years agoWhen doing a table scan using an index, do not error out if collating
drh [Thu, 7 Dec 2017 22:10:16 +0000 (22:10 +0000)] 
When doing a table scan using an index, do not error out if collating
functions used by that index are unavailable, since they will not be used.

FossilOrigin-Name: bbd69fa6fa7f3c86fb5cd1b69e1abbe1bbad61aa281e6c073a402d1b202e42ec

7 years agoFix typo in comment. No changes to code.
mistachkin [Thu, 7 Dec 2017 22:04:53 +0000 (22:04 +0000)] 
Fix typo in comment.  No changes to code.

FossilOrigin-Name: 95958b60f9282384cac8f29c519d0fa1c32d7c0366c01ce681f6691e5bbf8438

7 years agoFix harmless compiler warnings in the rot13 extension.
drh [Thu, 7 Dec 2017 16:51:25 +0000 (16:51 +0000)] 
Fix harmless compiler warnings in the rot13 extension.

FossilOrigin-Name: 113470772b04210b9300803124c06af2c0b33278313b311fefe6f80594b24e4a

7 years agoUpdates to the main README.md file.
drh [Thu, 7 Dec 2017 13:15:48 +0000 (13:15 +0000)] 
Updates to the main README.md file.

FossilOrigin-Name: 6bfafc35d1fa0415dcc85edbbd1b273f84b7a6ab75f979b01d90b18ce6aa5703

7 years agoFix an unreachable branch in cases when SQLITE_ENABLE_STAT4 is not defined.
drh [Wed, 6 Dec 2017 20:50:08 +0000 (20:50 +0000)] 
Fix an unreachable branch in cases when SQLITE_ENABLE_STAT4 is not defined.

FossilOrigin-Name: 6a55bd67720451cdf316155cf348103bfce1056a78bcddf0029b45ff0fdbcc71

7 years agoFix a compilation problem when both SQLITE_ENABLE_MULTITHREADED_CHECKS and
dan [Tue, 5 Dec 2017 14:58:59 +0000 (14:58 +0000)] 
Fix a compilation problem when both SQLITE_ENABLE_MULTITHREADED_CHECKS and
SQLITE_ENABLE_API_ARMOUR are defined.

FossilOrigin-Name: 0342ce510d2063a63839399a2cfa25b7fc02f4fde17764082676b332d6136241

7 years agoFix the ".lint fkey-indexes" shell command so that it works with WITHOUT ROWID
dan [Fri, 1 Dec 2017 18:40:18 +0000 (18:40 +0000)] 
Fix the ".lint fkey-indexes" shell command so that it works with WITHOUT ROWID
tables.

FossilOrigin-Name: 5771b1d611b3562ea6c040f3f893073c4d0ee58c35b37ae211520d9aee8ed547

7 years agoFix some minor problems in test scripts.
dan [Thu, 30 Nov 2017 11:21:59 +0000 (11:21 +0000)] 
Fix some minor problems in test scripts.

FossilOrigin-Name: 4c551fdebc7feda3dcfeec719387d879cd5e2cbe213c0c1aac0a965b3f9e882d

7 years agoUpdate test file walprotocol.test to account for the changes in the wal
dan [Thu, 30 Nov 2017 07:55:15 +0000 (07:55 +0000)] 
Update test file walprotocol.test to account for the changes in the wal
locking protocol.

FossilOrigin-Name: 64e567009dd56ef595850fe460925bc15fa875163541527638b654aa2b2cf785

7 years agoMerge latest trunk changes into this branch.
dan [Wed, 29 Nov 2017 16:16:29 +0000 (16:16 +0000)] 
Merge latest trunk changes into this branch.

FossilOrigin-Name: 373fa21bffd37053bb1a741d3ace2f003a5639bf373c20ea7bb24a31080888b3

7 years agoFix an assertion fault found by OSSFuzz.
dan [Tue, 28 Nov 2017 20:43:40 +0000 (20:43 +0000)] 
Fix an assertion fault found by OSSFuzz.

FossilOrigin-Name: 75d699877fa7d06d30285ecf008fbedfdf68cc7965bb328c96f5a931d1f13f04

7 years agoLock the wal file for all snapshot transactions, even if they would not
dan [Tue, 28 Nov 2017 13:39:41 +0000 (13:39 +0000)] 
Lock the wal file for all snapshot transactions, even if they would not
otherwise require this, preventing checkpointers and writers from wrapping the
wal file. This means that if one connection has an open snapshot transaction
it is guaranteed that a second connection can open a transaction on the same
snapshot.

FossilOrigin-Name: b81a31495bd27c1d96f7df653da3502054240cb5acf66b860da7f0f9b422a524

7 years agoAdd experimental feature to detect threading bugs in apps that use
dan [Tue, 28 Nov 2017 07:52:00 +0000 (07:52 +0000)] 
Add experimental feature to detect threading bugs in apps that use
SQLITE_CONFIG_MULTITHREADED. Enabled at compile time using
SQLITE_ENABLE_MULTITHREADED_CHECKS.

FossilOrigin-Name: 40b598c8392f030f6ed8c63ce81cb0426bb3984397c19c756215f6a569a40164

7 years agoUse a symbolic constant instead of a literal (-1) to identify a multithreaded-checks
dan [Tue, 28 Nov 2017 07:47:57 +0000 (07:47 +0000)] 
Use a symbolic constant instead of a literal (-1) to identify a
warn-on-contention mutex.

FossilOrigin-Name: 12a23c0a66fac5c9674120b390f6abaeaba3f7ff04693b281af1eefb93d6f47c

7 years agoUpdate tests to deal with SQLITE_FAST_SECURE_DELETE.
drh [Tue, 28 Nov 2017 00:52:14 +0000 (00:52 +0000)] 
Update tests to deal with SQLITE_FAST_SECURE_DELETE.

FossilOrigin-Name: e6b89304695be371978e65dddd710c8bd563c66b9c94d23165142b6c235c82e1

7 years agoFix a faulty NEVER assert() that could fail for SQLITE_ENABLE_STAT4 builds
dan [Mon, 27 Nov 2017 17:56:14 +0000 (17:56 +0000)] 
Fix a faulty NEVER assert() that could fail for SQLITE_ENABLE_STAT4 builds
that use foreign keys.

FossilOrigin-Name: 465350e55ddaf30cfba7874653301de7238a9dc2bc5e1f800fc95de9360679f6

7 years agoFix an CSV output quoting problem in the command-line shell on Windows.
drh [Sun, 26 Nov 2017 02:14:18 +0000 (02:14 +0000)] 
Fix an CSV output quoting problem in the command-line shell on Windows.

FossilOrigin-Name: 6500cdbd36b0169f37fe363c49182b3e30477a51bb521c2a964555cd086a5589

7 years agoFix builds with both SQLITE_ENABLE_MULTITHREADED_CHECKS and
dan [Sat, 25 Nov 2017 21:09:29 +0000 (21:09 +0000)] 
Fix builds with both SQLITE_ENABLE_MULTITHREADED_CHECKS and
SQLITE_THREADSAFE=0 defined.

FossilOrigin-Name: 7d0b12fcb58353b883ffce77df824a5cc8b1e913a21ec3f22fb73481a398c916

7 years agoAdd experimental feature to detect threading bugs in apps that use
dan [Sat, 25 Nov 2017 17:51:01 +0000 (17:51 +0000)] 
Add experimental feature to detect threading bugs in apps that use
SQLITE_CONFIG_MULTITHREADED. Enabled at compile time using
SQLITE_ENABLE_MULTITHREADED_CHECKS.

FossilOrigin-Name: a66886ac13aa6d8ccbb6d673ddd00267c93e3ee1fbc158236fce3157d150868d

7 years agoAdd the "^" syntax from fts3/4 to fts5.
dan [Fri, 24 Nov 2017 19:24:44 +0000 (19:24 +0000)] 
Add the "^" syntax from fts3/4 to fts5.

FossilOrigin-Name: 24d7058e2799133dd681d2fef341025ca50554861bb4cd39e93ee87ae1d8a605

7 years agoEnhance the configure script to detect zLib.
drh [Fri, 24 Nov 2017 16:55:48 +0000 (16:55 +0000)] 
Enhance the configure script to detect zLib.

FossilOrigin-Name: e3b6e22049caf78bc4153ded8dc295fe30ad320323d921f16bd794ef30f1b115

7 years agoFix a problem in the omit-table-from-left-join optimization
drh [Thu, 23 Nov 2017 04:45:35 +0000 (04:45 +0000)] 
Fix a problem in the omit-table-from-left-join optimization
from check-in [0cd82ee9a8413cf] that was discovered by OSSFuzz.

FossilOrigin-Name: b016c28fa5617a20ad34c005372e738d28f7fc4388d19ee0cb7add4ed19d74aa

7 years agoCompletely disable the skip-ahead-distinct optimization for all but the
drh [Thu, 23 Nov 2017 00:45:21 +0000 (00:45 +0000)] 
Completely disable the skip-ahead-distinct optimization for all but the
inner-most loop of a DISTINCT join.  Fix for ticket [ef9318757b152e3a26e9592]

FossilOrigin-Name: b7595cf2cadcba486e60b3c230ccc412a7cf449c1d56cbe65869e6d5d9f1374d

7 years agoFix the skip-ahead-distinct optimization on joins for cases there the table
drh [Tue, 21 Nov 2017 23:38:48 +0000 (23:38 +0000)] 
Fix the skip-ahead-distinct optimization on joins for cases there the table
in the inner loop of the join does not contribute any columns to the
result set.  Proposed fix for ticket [ef9318757b152e3a2]

FossilOrigin-Name: 2dcef5a9ae7f347da65207bf6bf612fb12e18e1a6704799322f0cf2a86154cfd

7 years agoFix typo in the Makefiles for MSVC.
mistachkin [Tue, 21 Nov 2017 21:15:17 +0000 (21:15 +0000)] 
Fix typo in the Makefiles for MSVC.

FossilOrigin-Name: 17dd2f7314e7eb124e0a2a7a6cf475850e87fe3041e6ce1e1fd71b38d54852a8

7 years agoFix compilation issue (C99-ism) in the shell seen with MSVC.
mistachkin [Tue, 21 Nov 2017 21:14:32 +0000 (21:14 +0000)] 
Fix compilation issue (C99-ism) in the shell seen with MSVC.

FossilOrigin-Name: 9cb47430553f00216e9b06e3d8226b903da536152fac80a5b6f615508c933252

7 years agoUpdate the omit-table-from-left-join optimization so that it can omit tables
dan [Tue, 21 Nov 2017 20:53:14 +0000 (20:53 +0000)] 
Update the omit-table-from-left-join optimization so that it can omit tables
from the middle of the join as well as the end.

FossilOrigin-Name: 0cd82ee9a8413cf127b5ca65770e3f363bd579941cd592298d3b0c27715583f3

7 years agoUpdate the omit-table-from-left-join optimization so that it can omit tables left-join-optimization
dan [Tue, 21 Nov 2017 19:22:45 +0000 (19:22 +0000)] 
Update the omit-table-from-left-join optimization so that it can omit tables
from the middle of the join as well as the end.

FossilOrigin-Name: 618ca9fe53d8d2d7b4f368e6ee404d5fceeecac0d689f32ab62af8a6cbb37401

7 years agoFix a problem preventing the planner from identifying scans that visit at most
dan [Mon, 20 Nov 2017 15:46:10 +0000 (15:46 +0000)] 
Fix a problem preventing the planner from identifying scans that visit at most
one row in cases where that property is guaranteed by a unique, not-null,
non-IPK column that is the leftmost in its table.

FossilOrigin-Name: 7fdb1e2ac2040dc47800a224d33a5c95d55200c480d46fedec1e97fb4f089ef7

7 years agoFix a typo in a test script on this branch. left-join-omit-fix
dan [Mon, 20 Nov 2017 15:45:03 +0000 (15:45 +0000)] 
Fix a typo in a test script on this branch.

FossilOrigin-Name: bff5dcfd2b29ee4834258914410a5dee69ec2727dd254053e3ebaf5090937694

7 years agoFix a problem preventing the planner from identifying scans that visit at most
dan [Mon, 20 Nov 2017 14:40:03 +0000 (14:40 +0000)] 
Fix a problem preventing the planner from identifying scans that visit at most
one row in cases where that property is guaranteed by a unique, not-null,
non-IPK column that is the leftmost in its table.

FossilOrigin-Name: 299d7ca52fec32f04ffd2b8561dd4b839e891792162f8b00259368683436b02d

7 years agoEnhance the log messages produced in some cases if database corruption is
dan [Sat, 18 Nov 2017 18:07:17 +0000 (18:07 +0000)] 
Enhance the log messages produced in some cases if database corruption is
encountered by an SQLITE_DEBUG build.

FossilOrigin-Name: ee840a7669dd462af072625232ea4238198c9b94e1873f361c45f3b0985456f3

7 years agoEnhance the log messages produced in some cases if database corruption is sqlite-corrupt-page
dan [Sat, 18 Nov 2017 17:30:08 +0000 (17:30 +0000)] 
Enhance the log messages produced in some cases if database corruption is
encountered by an SQLITE_DEBUG build.

FossilOrigin-Name: 23a3128083834b5fc80adf45448f7dc65587c52761fb3c9483b80313b369406f

7 years agoImproved fix for ticket [da78413751863] that does not require disabling the
drh [Fri, 17 Nov 2017 21:01:04 +0000 (21:01 +0000)] 
Improved fix for ticket [da78413751863] that does not require disabling the
query flattener as was done in [005d5b870625].  This also makes the code
generator for vector IN operators a little easier to understand.

FossilOrigin-Name: 723f1be3d4a905a6a16333f8ef3e1067dcd4944497b303033c49946fc37c780f

7 years agoAdd some missing "finish_test" lines to the end of test scripts.
dan [Fri, 17 Nov 2017 20:07:19 +0000 (20:07 +0000)] 
Add some missing "finish_test" lines to the end of test scripts.

FossilOrigin-Name: c21406ab3281480d3eddca0cdf5aea3abc224425ee52c10eed3ff702a0ae5c26

7 years agoNew assert() statements in the rowvalue IN expression processing.
drh [Fri, 17 Nov 2017 17:32:40 +0000 (17:32 +0000)] 
New assert() statements in the rowvalue IN expression processing.

FossilOrigin-Name: 00c328317473cee8fd7bd92c58409a356337b727cfa562bd8de59350d978769c

7 years agoClarification of comments on sqlite3FindInIndex(). No changes to code.
drh [Fri, 17 Nov 2017 15:02:00 +0000 (15:02 +0000)] 
Clarification of comments on sqlite3FindInIndex().  No changes to code.

FossilOrigin-Name: 071cabd23cd010180711a138f891a0e358031dd128532def4f62c5764651bace

7 years agoDo not count temporary databases that have been attached using ATTACH when
dan [Fri, 17 Nov 2017 13:21:12 +0000 (13:21 +0000)] 
Do not count temporary databases that have been attached using ATTACH when
figuring out if a master-journal file is required by a transaction.

FossilOrigin-Name: 93e012a317c8a4bfb84327616a597acabfcb24417197eefdccb8031bcf64e0c0

7 years agoAvoid creating a master journal if all or all but one of the databases in the master-journal-temp-files
dan [Fri, 17 Nov 2017 08:20:10 +0000 (08:20 +0000)] 
Avoid creating a master journal if all or all but one of the databases in the
transaction is a temp file.

FossilOrigin-Name: 355d1232fd7314723afaa8d6b8b73506b09cbba1113a88b10204ba89be993508

7 years agoEnsure that empty space on pages is zeroed before they are written to disk.
dan [Thu, 16 Nov 2017 20:48:47 +0000 (20:48 +0000)] 
Ensure that empty space on pages is zeroed before they are written to disk.
This helps with compressed databases, and stops valgrind complaining about
uninitialized bytes and write().

FossilOrigin-Name: 5ffec5db33137251090d45e2ca7e3e7823e3215ae89822d905923424ceba2ac2

7 years agoAdd a missing "finish_test" to the end of the stmtvtab1.test script.
drh [Thu, 16 Nov 2017 19:04:33 +0000 (19:04 +0000)] 
Add a missing "finish_test" to the end of the stmtvtab1.test script.

FossilOrigin-Name: e0b5c0585e8530bd516b340093a46d8e358a731facb78da22d3208633c852804

7 years agoFuther improvements to the .testctrl interface in the shell.
drh [Wed, 15 Nov 2017 19:14:08 +0000 (19:14 +0000)] 
Futher improvements to the .testctrl interface in the shell.

FossilOrigin-Name: 1ca3b8cce93e83fabe35c22cb726b8ce0883e0448afa3301ad0b53073055fa8d

7 years agoUI improvements on the .testctrl dot-command in the shell.
drh [Wed, 15 Nov 2017 17:07:22 +0000 (17:07 +0000)] 
UI improvements on the .testctrl dot-command in the shell.

FossilOrigin-Name: 5d66219c4706e11a9c2a1290224e7c17b19f74657e8239accfb4c6f6be6af9b5

7 years agoIn the parse tree, combine LIMIT and OFFSET into a single expression rooted
drh [Tue, 14 Nov 2017 23:48:23 +0000 (23:48 +0000)] 
In the parse tree, combine LIMIT and OFFSET into a single expression rooted
on a TK_LIMIT node, for a small code size reduction and performance increase,
and a reduction in code complexity.

FossilOrigin-Name: 3925facd942c9df663f9b29b1e6f94f6be14af8c2b99eb691bfc836b4c220826

7 years agoAdd the ability to read from read-only WAL-mode database files as long as
drh [Tue, 14 Nov 2017 19:34:22 +0000 (19:34 +0000)] 
Add the ability to read from read-only WAL-mode database files as long as
the -wal and -shm files are present on disk.

FossilOrigin-Name: 00ec95fcd02bb415dabd7f25fee24856d45d6916c18b2728e97e9bb9b8322ba3

7 years agoFix the SQLITE_ENABLE_UPDATE_DELETE_LIMIT functionality so that it works with views...
dan [Tue, 14 Nov 2017 17:06:37 +0000 (17:06 +0000)] 
Fix the SQLITE_ENABLE_UPDATE_DELETE_LIMIT functionality so that it works with views and WITHOUT ROWID tables.

FossilOrigin-Name: dae4a97a483bee1e6ac0271ddd28a0dffcebf7522edaf12eb5e0eba5fc62516a

7 years agoImprovement to a comment. No changes to code. readonly-wal-recovery
drh [Tue, 14 Nov 2017 03:42:52 +0000 (03:42 +0000)] 
Improvement to a comment.  No changes to code.

FossilOrigin-Name: 486949fc03706e0056439b52ce60931ea4ce0a65e391da7f6287fe13862de251

7 years agoRemove some branches in walTryBeginRead() that were
drh [Mon, 13 Nov 2017 05:51:37 +0000 (05:51 +0000)] 
Remove some branches in walTryBeginRead() that were
added by check-in [ce5d13c2de] but became unreachable with the addition
of logic in check-in [18b26843] that enabled read-only clients to parse
the WAL file into a heap-memory WAL-index, thus guaranteeing that the
WAL-index header is always available.

FossilOrigin-Name: 9c6b38b9a96c11bdf9db4ea025720a4f49dcb723fa2e2776edc8453bce85c7e3

7 years agoIn wal.c: improved comments, new assert() and testcase() macros, and
drh [Sat, 11 Nov 2017 20:11:01 +0000 (20:11 +0000)] 
In wal.c: improved comments, new assert() and testcase() macros, and
replace some magic numbers with appropriate symbolic constants.

FossilOrigin-Name: 13ec8a77a47aa471af587459f4094da0d06674c5960f0d34777bcb3d38bc413b

7 years agoFurther comment improvements in wal.c. No code changes.
drh [Sat, 11 Nov 2017 13:30:44 +0000 (13:30 +0000)] 
Further comment improvements in wal.c.  No code changes.

FossilOrigin-Name: 346388007de585083dc67ad865b91db7c7d7b78c10a06f8bb7c48767c326c47e

7 years agoOmit some extra code from non-SQLITE_ENABLE_UPDATE_DELETE_LIMIT builds. update-delete-limit-fix
dan [Fri, 10 Nov 2017 20:13:14 +0000 (20:13 +0000)] 
Omit some extra code from non-SQLITE_ENABLE_UPDATE_DELETE_LIMIT builds.

FossilOrigin-Name: 72be33f9c84de3ec4afc40549482417456ca82c1d16b473dc034b144055271e5

7 years agoImproved comments and variable names in the read-only WAL logic.
drh [Fri, 10 Nov 2017 20:00:50 +0000 (20:00 +0000)] 
Improved comments and variable names in the read-only WAL logic.

FossilOrigin-Name: d3c25740eec9a2a41c29e6e488fcf6587c1fb821147a442c29439b25a92154a5

7 years agoAdd further tests for the code on this branch.
dan [Fri, 10 Nov 2017 17:47:54 +0000 (17:47 +0000)] 
Add further tests for the code on this branch.

FossilOrigin-Name: f8c4e33f4813e0c909064406b5cc17e2d465d8a48a50ede1d356b39479d3d669

7 years agoFix a problem involving "DELETE/UPDATE...LIMIT" statements that use an INDEXED
dan [Fri, 10 Nov 2017 16:14:26 +0000 (16:14 +0000)] 
Fix a problem involving "DELETE/UPDATE...LIMIT" statements that use an INDEXED
BY clause.

FossilOrigin-Name: 09f94c2c8199b0d23a45cc062ca9561f9e5ddfcba117100e41889ce199d21bdb

7 years agoFix a problem with (DELETE...LIMIT) statements against WITHOUT ROWID tables
dan [Fri, 10 Nov 2017 15:42:21 +0000 (15:42 +0000)] 
Fix a problem with (DELETE...LIMIT) statements against WITHOUT ROWID tables
with a single column PK.

FossilOrigin-Name: 35477a3dcceadf5dade8e036d5a2ce91b9ca83c4b85d309db233bdbcf538b1cc

7 years agoFix harmless compiler warning seen with MSVC.
mistachkin [Fri, 10 Nov 2017 12:41:21 +0000 (12:41 +0000)] 
Fix harmless compiler warning seen with MSVC.

FossilOrigin-Name: 3711ef2366af8fefccaaa0a6ee520ce6bc9c74a4fe0666f0a85ef96be46e02d3

7 years agoAvoid superfluous SHM unlock call in the Win32 VFS.
mistachkin [Thu, 9 Nov 2017 23:24:29 +0000 (23:24 +0000)] 
Avoid superfluous SHM unlock call in the Win32 VFS.

FossilOrigin-Name: 5a384be6979b783d1f3af2ac6307e7e731c415d052f9405f04c0216f59414633

7 years agoCleanup superfluous whitespace changes.
mistachkin [Thu, 9 Nov 2017 22:25:58 +0000 (22:25 +0000)] 
Cleanup superfluous whitespace changes.

FossilOrigin-Name: a2908e2c88f7a30638a7e791fc7ad0325b663097c12cecd1f4726b0d60a9a3ed

7 years agoRevise and vastly simplify the Win32 SHM file locking semantics, allowing all new...
mistachkin [Thu, 9 Nov 2017 22:23:50 +0000 (22:23 +0000)] 
Revise and vastly simplify the Win32 SHM file locking semantics, allowing all new tests to pass.

FossilOrigin-Name: d0997b0f5bc9a9869684e39a17a01c430d6383c8b31d6c00ea17a5eac15bc6f0

7 years agoAdd an assert() in the Win32 VFS.
mistachkin [Thu, 9 Nov 2017 20:37:37 +0000 (20:37 +0000)] 
Add an assert() in the Win32 VFS.

FossilOrigin-Name: 22e58330461736ca22d6f4d7eab897a3597de2e7434a6f4a474f0f0d7f964281

7 years agoEnhance walro2.test to better ensure that readonly_shm clients are not using
dan [Thu, 9 Nov 2017 20:34:35 +0000 (20:34 +0000)] 
Enhance walro2.test to better ensure that readonly_shm clients are not using
invalid *-shm files.

FossilOrigin-Name: ff630b66714b20c09888ead0a45f344d63e0d9a5208867d6266e74f79187076c

7 years agoGet read-only SHM file tests passing on Win32.
mistachkin [Thu, 9 Nov 2017 20:02:44 +0000 (20:02 +0000)] 
Get read-only SHM file tests passing on Win32.

FossilOrigin-Name: abef05353554e72f4d08aff562b87ff8530e8537a79e58d831205ea8c46eed07

7 years agoAdd SQLITE_ENABLE_UPDATE_DELETE_LIMIT for views and WITHOUT ROWID tables.
dan [Thu, 9 Nov 2017 19:53:06 +0000 (19:53 +0000)] 
Add SQLITE_ENABLE_UPDATE_DELETE_LIMIT for views and WITHOUT ROWID tables.

FossilOrigin-Name: 584b88aaf89ab30cb51185396b7b50c6ecba286add023a26ab41d865b9c605ce

7 years agoFurther corrections to read-only SHM file handling on Win32.
mistachkin [Thu, 9 Nov 2017 18:53:51 +0000 (18:53 +0000)] 
Further corrections to read-only SHM file handling on Win32.

FossilOrigin-Name: 43c311701bdf1202918cd46fa6133a11458e0ef8ddb09e46290a231083f395ce

7 years agoCorrections to Win32 lock detection for SHM files.
mistachkin [Thu, 9 Nov 2017 18:21:51 +0000 (18:21 +0000)] 
Corrections to Win32 lock detection for SHM files.

FossilOrigin-Name: 3a91be975daee65c3e1199855613066015d5df8ad44ababdef31d1c698b5e746

7 years agoCorrections to the Win32 porting changes on this branch.
mistachkin [Thu, 9 Nov 2017 17:29:18 +0000 (17:29 +0000)] 
Corrections to the Win32 porting changes on this branch.

FossilOrigin-Name: 0b26a5a26d700e20eea5ebbd620af0af6f2d61c652cfca5b8563267588cb2be6

7 years agoMake it possible to use OSTRACE for multi-process testing.
mistachkin [Thu, 9 Nov 2017 17:29:04 +0000 (17:29 +0000)] 
Make it possible to use OSTRACE for multi-process testing.

FossilOrigin-Name: 0a7d416c4c43632725dc89cda8667cd9726b5152ee4692e4d0c9e2031e60cfb4

7 years agoInitial work on porting the changes on this branch to Win32.
mistachkin [Thu, 9 Nov 2017 16:30:55 +0000 (16:30 +0000)] 
Initial work on porting the changes on this branch to Win32.

FossilOrigin-Name: 3738bfd0c0eadb10eea58954af5052cb6ce164059f3aacfe65d7da6a400c63c7

7 years agoDisallow ORDER BY and LIMIT on UPDATE and DELETE of views and WITHOUT ROWID
drh [Thu, 9 Nov 2017 03:55:09 +0000 (03:55 +0000)] 
Disallow ORDER BY and LIMIT on UPDATE and DELETE of views and WITHOUT ROWID
tables.  This is a temporary fix for ticket [d4beea1633f1b88f] until a better
solution can be found.

FossilOrigin-Name: 62fe56b59270d9d7372b1bb8a53788a40d20d0f111fe38c61dd6269848592c70

7 years agoExtra comments on the sqlite3OsShmMap() call in walBeginUnlocked(). No
drh [Wed, 8 Nov 2017 19:26:27 +0000 (19:26 +0000)] 
Extra comments on the sqlite3OsShmMap() call in walBeginUnlocked().  No
changes to code.

FossilOrigin-Name: 033ee92bf4d5dc57f5cb8fd02d1154ae06f2d3261d214e7191a82c70c8ffebf7

7 years agoTurns out that SQLITE_READONLY_CANTLOCK is an historical name that must
drh [Wed, 8 Nov 2017 17:51:10 +0000 (17:51 +0000)] 
Turns out that SQLITE_READONLY_CANTLOCK is an historical name that must
be preserved.  So make a new SQLITE_READLOCK_CANTINIT name instead.

FossilOrigin-Name: 04974a8b5c0e6748216226006ca9125529c8bb2a7a9df4641217eb1413426a14

7 years agoChange the name of SQLITE_READONLY_CANTLOCK to SQLITE_READONLY_CANTINIT.
drh [Wed, 8 Nov 2017 17:32:12 +0000 (17:32 +0000)] 
Change the name of SQLITE_READONLY_CANTLOCK to SQLITE_READONLY_CANTINIT.

FossilOrigin-Name: 6d7f94faa7e6de62f82bc6cac019508a9c1ffd6fa1d14f52fa93e9c06afdd32f

7 years agoFix a problem causing LSM to add unnecessary padding to empty segments in
dan [Wed, 8 Nov 2017 11:14:53 +0000 (11:14 +0000)] 
Fix a problem causing LSM to add unnecessary padding to empty segments in
compressed databases.

FossilOrigin-Name: 1bc2d04645c5239ba9a30a13f6fb3c8cc46461c864e7927012bc0ad305eb705e

7 years agoImproved comments used for documentation of sqlite3_vfs. No changes
drh [Wed, 8 Nov 2017 02:50:09 +0000 (02:50 +0000)] 
Improved comments used for documentation of sqlite3_vfs.  No changes
to code.

FossilOrigin-Name: db8f22d069b1725f16b208c96c0c47b6ab0e30236feeac43cca4217ef80316b8

7 years agoUpdate an assert in wal.c.
dan [Tue, 7 Nov 2017 21:25:15 +0000 (21:25 +0000)] 
Update an assert in wal.c.

FossilOrigin-Name: 94527b897bac66d100ca92161f18b6f0e0768dd77ebcb06e3fb106f0e0e380ee

7 years agoHandle the race condition that may occur if another process connects and then
dan [Tue, 7 Nov 2017 21:15:07 +0000 (21:15 +0000)] 
Handle the race condition that may occur if another process connects and then
checkpoints and truncates the wal file while a readonly-shm client is building
its heap-memory wal-index.

FossilOrigin-Name: 5a6703fc3f2174b3e9a624c7272ae013b73c42d6c97ffa62b58553efdb54e3bc

7 years agoFix handling of partial indexes in checkindex.c (sqlite3_checker).
dan [Tue, 7 Nov 2017 19:02:00 +0000 (19:02 +0000)] 
Fix handling of partial indexes in checkindex.c (sqlite3_checker).

FossilOrigin-Name: 31932a9eb8dbb33d5535715ae8bbfdc55ce66b1a1a0abd57cefe720eeb31e231

7 years agoFix a problem causing an INDEXED BY specifying an unusable partial index to be
dan [Tue, 7 Nov 2017 18:20:15 +0000 (18:20 +0000)] 
Fix a problem causing an INDEXED BY specifying an unusable partial index to be
mishandled.

FossilOrigin-Name: 292a04086a902634fc514b379a2b245eb2681c1b84d9bb950b6ecb9aab28b468

7 years agoAdd the --trace option to the sqlite3_checker utility program.
drh [Tue, 7 Nov 2017 16:54:20 +0000 (16:54 +0000)] 
Add the --trace option to the sqlite3_checker utility program.

FossilOrigin-Name: dc217b7cfe680044d8742e317701abd0269162da8f5cb097361ae7f47fd9ba2d

7 years agoEnhance the checkindex.c virtual table so that it will output the
drh [Tue, 7 Nov 2017 16:23:24 +0000 (16:23 +0000)] 
Enhance the checkindex.c virtual table so that it will output the
index_name and after_key parameters.  Also add a new diagnostic output
column named scanner_sql which shows the SQL statement used to implement
the current index scan.

FossilOrigin-Name: 32e2520ce91351acceda845d81c9567f7a634257dc2b5b90fe6fb6583d8c0f87

7 years agoOn unix, if the *-shm file cannot be opened for read/write access, open it
dan [Tue, 7 Nov 2017 15:43:52 +0000 (15:43 +0000)] 
On unix, if the *-shm file cannot be opened for read/write access, open it
read-only and proceed as if the readonly_shm=1 URI option were specified.

FossilOrigin-Name: ba718754fa5ab8596cb84b751051de98afa2706fe6c5df39ad6d925d790719ee