]> git.ipfire.org Git - thirdparty/sqlite.git/log
thirdparty/sqlite.git
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 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 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 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 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 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 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

7 years agoAdd fault-injection tests for the code on this branch.
dan [Tue, 7 Nov 2017 09:08:43 +0000 (09:08 +0000)] 
Add fault-injection tests for the code on this branch.

FossilOrigin-Name: a7d949fb735f60c19e7257a1a7a12568a9c15be9cd980c018f3a0d6bf112c339

7 years agoAdd further test cases for the new code on this branch. And a couple of fixes.
dan [Mon, 6 Nov 2017 19:49:34 +0000 (19:49 +0000)] 
Add further test cases for the new code on this branch. And a couple of fixes.

FossilOrigin-Name: 71af9acb227a91d9ad8798c9d0b12d6967e863d050f5cb1fddb45f25ee1f47db

7 years agoAdd further tests for the code added on this branch.
dan [Sat, 4 Nov 2017 21:06:35 +0000 (21:06 +0000)] 
Add further tests for the code added on this branch.

FossilOrigin-Name: a6716fcde38b28b8a03b40f9d16f78a57ec20f60cf391ff553692641cb7f0d3f

7 years agoIn cases where a readonly_shm client cannot take the DMS lock on the *-shm
dan [Sat, 4 Nov 2017 18:10:03 +0000 (18:10 +0000)] 
In cases where a readonly_shm client cannot take the DMS lock on the *-shm
file, have it parse the wal file and create a wal-index to access it in heap
memory.

FossilOrigin-Name: 18b268433d739486eac1b04947bd418655e4bc56e8dc63ffa558aa4552a32e30

7 years agoFix test cases in wal2.test broken by the locking change in the previous
dan [Thu, 2 Nov 2017 18:57:46 +0000 (18:57 +0000)] 
Fix test cases in wal2.test broken by the locking change in the previous
commit.

FossilOrigin-Name: f569c3517234881f9425075aab65a32ffd0deb8e793f421a241d8cca881da33f

7 years agoAvoid locking shm-lock WAL_READ_LOCK(0) during recovery. Doing this allows
dan [Thu, 2 Nov 2017 11:12:03 +0000 (11:12 +0000)] 
Avoid locking shm-lock WAL_READ_LOCK(0) during recovery. Doing this allows
recovery to proceed while a readonly_shm connection in unlocked mode has an
ongoing read transaction.

FossilOrigin-Name: 5190d84a296b7cf716ef43bf7b6d4d351ef1a4d650de37dc01a5ab333da7c05d

7 years agoIf a readonly_shm connection cannot map the *-shm file because no other
dan [Wed, 1 Nov 2017 20:59:28 +0000 (20:59 +0000)] 
If a readonly_shm connection cannot map the *-shm file because no other
process is holding the DMS lock, have it read from the database file only,
ignoring any content in the wal file.

FossilOrigin-Name: ce5d13c2de69b73378637d4f7e109714f7cd17bf1d1ad995e0be442d517ed1b3

7 years agoMerge latest trunk changes into this branch.
dan [Wed, 1 Nov 2017 07:06:41 +0000 (07:06 +0000)] 
Merge latest trunk changes into this branch.

FossilOrigin-Name: 985bfc992950625a45a7521bf4c8438cd0170de974dff976968be158ac5922a9

7 years agoFix a race condition in os_unix.c that might allow a client to use a *-shm
dan [Wed, 1 Nov 2017 06:59:19 +0000 (06:59 +0000)] 
Fix a race condition in os_unix.c that might allow a client to use a *-shm
file corrupted by a power failure if another client fails between locking the
*-shm file and truncating it to zero bytes.

FossilOrigin-Name: d655bfabd110999b6808073c334869c5b6a8334df56811df883e47e56d3f1cbb

7 years agoUpdate the built procedures for the sqlite3_analyzer utility to allow it
drh [Tue, 31 Oct 2017 14:56:44 +0000 (14:56 +0000)] 
Update the built procedures for the sqlite3_analyzer utility to allow it
to be linked with an external sqlite3.o library.  Automatically detect a
missing dbstat extension and report the compile-time error.

FossilOrigin-Name: bb39744f4b2b25c10d293e85db7579e2a99c639fdab45e93d1de75952b68b2de

7 years agoFix redundancies in the makefiles that resulted from moving shell.c over
drh [Tue, 31 Oct 2017 12:20:43 +0000 (12:20 +0000)] 
Fix redundancies in the makefiles that resulted from moving shell.c over
to shell.c.in.

FossilOrigin-Name: bf09fa683ea42b7552bd2f29ab5371bd175f0055cf9a453e6f8c6f4408cd168f

7 years agoFix a minor comment typo. No changes to code.
drh [Tue, 31 Oct 2017 12:06:29 +0000 (12:06 +0000)] 
Fix a minor comment typo.  No changes to code.

FossilOrigin-Name: 5f79e6d9c3d44b0cc7cf805429006f7b29a69e8d863b58472172a56b29a7bb4e

7 years agoRemove unnecessary NEVER() and ALWAYS() conditionals.
drh [Tue, 31 Oct 2017 03:40:15 +0000 (03:40 +0000)] 
Remove unnecessary NEVER() and ALWAYS() conditionals.

FossilOrigin-Name: 1c80c75d4be2f3d44fb18bb4c07eccac2aba79b688215a741317dfc47dc7c2ce

7 years agoAdd the showshm utility program for printing out the shm header in a
drh [Mon, 30 Oct 2017 23:25:06 +0000 (23:25 +0000)] 
Add the showshm utility program for printing out the shm header in a
human-readable format.

FossilOrigin-Name: f6304fd142c998aba44f02c6018223af2630671b4791d750b70a59ab1adb8d6d

7 years agoClarify some comments describing the WAL index file. No changes to code.
drh [Mon, 30 Oct 2017 20:44:36 +0000 (20:44 +0000)] 
Clarify some comments describing the WAL index file.  No changes to code.

FossilOrigin-Name: 3be3aad9ecbe33060cfa9c6059b9206ed221d1fd72a69c355a9387f9f4e075e7

7 years agoImprove the performance of the LIKE operator by using strcspn() to aid
drh [Mon, 30 Oct 2017 18:49:11 +0000 (18:49 +0000)] 
Improve the performance of the LIKE operator by using strcspn() to aid
wildcard matching.

FossilOrigin-Name: 37284d4e8f501a37c582aa899419a3dfe0932e2a8e2ef2fdf59addd1d3cdacb4

7 years agoIncrease the version number for the next release - which is still months
drh [Sat, 28 Oct 2017 20:54:51 +0000 (20:54 +0000)] 
Increase the version number for the next release - which is still months
away but there have been significant query planner enhancements since the
previous release.

FossilOrigin-Name: 457eedfac0ff652912c4cfb89682acb3d2e372ef00745139adf8492a0b61fa09

7 years agoReactivate query flattening when the result set of the outer query has
drh [Sat, 28 Oct 2017 20:51:54 +0000 (20:51 +0000)] 
Reactivate query flattening when the result set of the outer query has
no function calls or subqueries.  This is a partial reversal of
check-in [c9104b59].  Co-routines are still preferred if the outer
query has a complex result set, but for simple results sets, query flattening
is used.  Check-in [4464f40ccd7] is completely backed
out due to this change.

FossilOrigin-Name: d17ef7d153058f7332b3fec421ade42c67e26b06f36fc1629e6799537a5afc5f

7 years agoAdd test cases from OSSFuzz to prevent a regression in co-routine
drh [Sat, 28 Oct 2017 12:20:09 +0000 (12:20 +0000)] 
Add test cases from OSSFuzz to prevent a regression in co-routine
processing.

FossilOrigin-Name: 689743d8e3fa81e65dcb067bbf61bab09210b3b39586c865c00d9f1d6692daf2

7 years agoFix a Pager ref-count leak in the sqlite_dbpage virtual table.
drh [Fri, 27 Oct 2017 18:24:11 +0000 (18:24 +0000)] 
Fix a Pager ref-count leak in the sqlite_dbpage virtual table.

FossilOrigin-Name: c063bb04da77d6847e4e254b6bb939c860e781382e34ddff8e0454d9db7552e2

7 years agoHandle the Ctrl-C event for the shell on Win32.
mistachkin [Fri, 27 Oct 2017 17:09:44 +0000 (17:09 +0000)] 
Handle the Ctrl-C event for the shell on Win32.

FossilOrigin-Name: c8aaf37117ed4a23bbd15dc481788735efcb77bff98be423eca3521c0a9270de

7 years agoAdditional test case demonstrating the ability to access structure elements
drh [Fri, 27 Oct 2017 12:27:25 +0000 (12:27 +0000)] 
Additional test case demonstrating the ability to access structure elements
using quoted names in the JSON1 extension.

FossilOrigin-Name: 8d3cc928a8f0c7b2616c5c75af9d3a50bd4f0fe8e4ccab545ab8648cbfbb4b7f

7 years agoEnhance the min/max optimization so that it works with indexes on
drh [Thu, 26 Oct 2017 20:04:28 +0000 (20:04 +0000)] 
Enhance the min/max optimization so that it works with indexes on
expressions.

FossilOrigin-Name: 6caec9082b3ad6d3f89f6291084a8f5c80f296630e2e94bc764389ac1a47a833

7 years agoExtra ".selecttrace" output following aggregate analysis. No changes to
drh [Thu, 26 Oct 2017 18:43:19 +0000 (18:43 +0000)] 
Extra ".selecttrace" output following aggregate analysis.  No changes to
production builds.

FossilOrigin-Name: 6fbf74ab3189b9cb20cf7cc8db0226eb935a8eab477cc83b8390492fcf2f1f76

7 years agoFix an error in the previous commit on this branch.
dan [Thu, 26 Oct 2017 17:34:50 +0000 (17:34 +0000)] 
Fix an error in the previous commit on this branch.

FossilOrigin-Name: f71dfee06ce1e0eee760cfca19482bdec7729d6c7d28f10f4cfd21e1f92a04b0

7 years agoInstead of extra locks, use F_GETLK to ensure that readonly_shm clients cannot
dan [Thu, 26 Oct 2017 17:05:22 +0000 (17:05 +0000)] 
Instead of extra locks, use F_GETLK to ensure that readonly_shm clients cannot
connect to a wal-mode database if there are no writers.

FossilOrigin-Name: 5492f457dc7cc5c416de4b4e61e84bd2f10b4e6ce54011b7a60feb47f629c923

7 years agoFix a bug causing "make amalgmation-autoconf" to create an invalid package if
dan [Thu, 26 Oct 2017 15:21:56 +0000 (15:21 +0000)] 
Fix a bug causing "make amalgmation-autoconf" to create an invalid package if
either the current or parent directory contains a file named install.sh or
install-sh.

FossilOrigin-Name: e1faa7859451ee969f0ce02d2d4e4c54d0e2e018b37b8faf690e6b87593cce7d

7 years agoUse extra locks to prevent a readonly_shm=1 process from connecting to a
drh [Wed, 25 Oct 2017 23:28:13 +0000 (23:28 +0000)] 
Use extra locks to prevent a readonly_shm=1 process from connecting to a
WAL-mode database if there are no writers.

FossilOrigin-Name: 35d979082b4ab36d6a8975f8f15a50e69f46b72a173164d2b353377b9f758bd8

7 years agoFix the sqlite3_dbpage virtual table so that it can read and write from
drh [Wed, 25 Oct 2017 19:18:33 +0000 (19:18 +0000)] 
Fix the sqlite3_dbpage virtual table so that it can read and write from
any attached database.

FossilOrigin-Name: d4f893e1ae53a0445939ea2920af87d21dd36270494381028b2eaebe5c188f18

7 years agoAdd tests cases and fix minor issues in the rtreecheck() function.
dan [Wed, 25 Oct 2017 18:17:24 +0000 (18:17 +0000)] 
Add tests cases and fix minor issues in the rtreecheck() function.

FossilOrigin-Name: d6130cd226c0ca95e02f0cbabfdc27071acdcf83e0d0cb0eaa47d992479ed9a1

7 years agoAdd SQL scalar function rtreecheck() to the rtree module. For running checks to ensur...
mistachkin [Wed, 25 Oct 2017 18:01:58 +0000 (18:01 +0000)] 
Add SQL scalar function rtreecheck() to the rtree module. For running checks to ensure the shadow tables used by an rtree virtual table are internally consistent.

FossilOrigin-Name: 7d26498063bbc4525976ace698fafcf161d939908f4ffb36d7a4df8fb1bce1fb

7 years agoFix compilation issue (C99-ism) seen with MSVC. rtree-integrity-check
mistachkin [Wed, 25 Oct 2017 18:00:58 +0000 (18:00 +0000)] 
Fix compilation issue (C99-ism) seen with MSVC.

FossilOrigin-Name: 61870b42b033189509b244c76d28932f7a447b887ffe04a3c81461148e54cfb5

7 years agoAdd SQL scalar function rtreecheck() to the rtree module. For running checks
dan [Wed, 25 Oct 2017 16:38:34 +0000 (16:38 +0000)] 
Add SQL scalar function rtreecheck() to the rtree module. For running checks
to ensure the shadow tables used by an rtree virtual table are internally
consistent.

FossilOrigin-Name: dde0bb3eab1316c3247b1755594527ca70955aab4ad4907190731f7ec092b327

7 years agoDo not reference the ioctl() system call in the unix backend unless it
drh [Wed, 25 Oct 2017 16:14:12 +0000 (16:14 +0000)] 
Do not reference the ioctl() system call in the unix backend unless it
is actually needed by the Batch Atomic Write extension.  This should allow
the build to work on VxWorks.

FossilOrigin-Name: adfa7ed2de3e833fff65935455e71236a59602aaf7b97ece667ab300dca9f673

7 years agoAdd the sqlite_btreeinfo eponymous-only table for introspecting the schema
drh [Wed, 25 Oct 2017 01:34:24 +0000 (01:34 +0000)] 
Add the sqlite_btreeinfo eponymous-only table for introspecting the schema
and estimating the sizes of various btrees.

FossilOrigin-Name: 1e30f4772db1e1086096f72d32e87c552923be8b264aa13cf822fae754eb083d

7 years agoForce the autoconf makefile for MSVC to always use the 'find.exe' included with Windows.
mistachkin [Tue, 24 Oct 2017 21:17:12 +0000 (21:17 +0000)] 
Force the autoconf makefile for MSVC to always use the 'find.exe' included with Windows.

FossilOrigin-Name: b76bffd332585e8412a0a994ae6dee79a83213d8b709d7f858c5c05678ab0887

7 years agoMerge all of the fixes from the 3.21.0 release.
drh [Tue, 24 Oct 2017 19:05:26 +0000 (19:05 +0000)] 
Merge all of the fixes from the 3.21.0 release.

FossilOrigin-Name: 5ab662b443df17c5ebdadc0bdac2f447c5c7e86f7a32a6943bb4ac8605879441

7 years agoVersion 3.21.0 branch-3.21 version-3.21.0
drh [Tue, 24 Oct 2017 18:55:49 +0000 (18:55 +0000)] 
Version 3.21.0

FossilOrigin-Name: 1a584e499906b5c87ec7d43d4abce641fdf017c42125b083109bc77c4de48827

7 years agoFix a problem in the incr-blob code causing a new cursor to be opened for
dan [Tue, 24 Oct 2017 17:28:25 +0000 (17:28 +0000)] 
Fix a problem in the incr-blob code causing a new cursor to be opened for
every sqlite3_blob_reopen() call.

FossilOrigin-Name: 41ef34a1f0650c50cacb203665cd9d57db53a49c979bf0d5a78937517f763a2c

7 years agoOn the amalgamation package, enable the sqlite_dbpage virtual table so that
drh [Mon, 23 Oct 2017 21:24:38 +0000 (21:24 +0000)] 
On the amalgamation package, enable the sqlite_dbpage virtual table so that
the .dbinfo command works in the CLI.

FossilOrigin-Name: 54b90b4f27f6f213825e881929fa04a6282e5b909a12e881366f9aef6872dcb6

7 years agoMerge trunk fixes to swarmvtabfault.test and the lsm extension into this
dan [Mon, 23 Oct 2017 20:20:42 +0000 (20:20 +0000)] 
Merge trunk fixes to swarmvtabfault.test and the lsm extension into this
branch. No changes to core SQLite code.

FossilOrigin-Name: f632b87002a7ee9be569aacb5ce85bb7e9c86b7d77bb8d1bf8b55eb5be4ecc77

7 years agoIn the 'swarmvtabfault' test module, make sure to close the database handle prior...
mistachkin [Mon, 23 Oct 2017 20:17:19 +0000 (20:17 +0000)] 
In the 'swarmvtabfault' test module, make sure to close the database handle prior to raising an error from the 'not found' callback script.

FossilOrigin-Name: f317037b31b19007e30bb41c54506d9d241a6d590c2b31e2ddda10d4f6e7605b

7 years agoCleanup a test database file prior to using it.
mistachkin [Mon, 23 Oct 2017 17:36:52 +0000 (17:36 +0000)] 
Cleanup a test database file prior to using it.

FossilOrigin-Name: e1bf5e1d06dbe573671c6b5472b45f5bfa3cf82374f70a76b4c80815bf15a29b

7 years agoUpdates to test procedures so that they all work with encryption. No changes
drh [Mon, 23 Oct 2017 16:34:07 +0000 (16:34 +0000)] 
Updates to test procedures so that they all work with encryption.  No changes
to the core SQLite code.

FossilOrigin-Name: 0481330756e861de8e1eb7136e7dca2f333b2a82377949d2e0eba401af7d73dd

7 years agoAvoid passing a NULL value as the second argument to memcpy().
dan [Mon, 23 Oct 2017 16:03:54 +0000 (16:03 +0000)] 
Avoid passing a NULL value as the second argument to memcpy().

FossilOrigin-Name: 58e5bb491bc0e28412ca188ba8fbe94adc67b5b1e9d7c112c36011400528d577

7 years agoIn lsm (not SQLite), avoid opening the *-shm file before the database file is
dan [Mon, 23 Oct 2017 11:48:00 +0000 (11:48 +0000)] 
In lsm (not SQLite), avoid opening the *-shm file before the database file is
locked. Otherwise, there is a race condition whereby a connection in another
process process may unlink() it while it is still in use.

FossilOrigin-Name: c8b8b9b573665c2b4d278bb679a48ac407374b8d860f0c3f4d50a303043464ad

7 years agoFix minor test script problems revealed by releasetest.tcl.
dan [Mon, 23 Oct 2017 07:53:00 +0000 (07:53 +0000)] 
Fix minor test script problems revealed by releasetest.tcl.

FossilOrigin-Name: c333ee7e9677bda1dad8e80cf94755350bfe20bc0754577442727b6f807ad831

7 years agoFix minor test script problems revealed by releasetest.tcl.
dan [Mon, 23 Oct 2017 07:52:07 +0000 (07:52 +0000)] 
Fix minor test script problems revealed by releasetest.tcl.

FossilOrigin-Name: 15e87d9bc81812fb9de86f9870389217dddb9f9c4d48e42acefce2d35ba293f1

7 years agoFix test cases in dbpage.test so that they work with
dan [Sun, 22 Oct 2017 08:03:39 +0000 (08:03 +0000)] 
Fix test cases in dbpage.test so that they work with
SQLITE_DEFAULT_AUTOVACUUM=1 builds.

FossilOrigin-Name: 9474f061d634721ca462bbad375270b8b39dea44011df3e1aac72021e8bf70fc

7 years agoFix test cases in dbpage.test so that they work with
dan [Sun, 22 Oct 2017 08:02:56 +0000 (08:02 +0000)] 
Fix test cases in dbpage.test so that they work with
SQLITE_DEFAULT_AUTOVACUUM=1 builds.

FossilOrigin-Name: 0fcf1e61ef2b6c1fb8f4846f973d2d427598ffbc80dbc49e56e71513b194bae7

7 years agoAvoid running tests that use sqlite_dbpage with SQLITE_OMIT_VIRTUAL_TABLE
dan [Sun, 22 Oct 2017 07:58:09 +0000 (07:58 +0000)] 
Avoid running tests that use sqlite_dbpage with SQLITE_OMIT_VIRTUAL_TABLE
builds.

FossilOrigin-Name: 6dde8d6154c5b4d36c7aad17d6eaafdb13c66a09d17d4c79f52b2417846ea0b5

7 years agoAvoid running tests that use sqlite_dbpage with SQLITE_OMIT_VIRTUAL_TABLE
dan [Sun, 22 Oct 2017 07:57:29 +0000 (07:57 +0000)] 
Avoid running tests that use sqlite_dbpage with SQLITE_OMIT_VIRTUAL_TABLE
builds.

FossilOrigin-Name: 7bd20a20a0f422765a6e469d1a1b67b95c4a441931688e04a2b1b491a5238528

7 years agoMerge all the enhancements and bug fixes from trunk, since none are
drh [Sat, 21 Oct 2017 17:17:17 +0000 (17:17 +0000)] 
Merge all the enhancements and bug fixes from trunk, since none are
destablizing.  Call this the second beta.

FossilOrigin-Name: fb3ee1b7cac09e4950e4f48b44c277e4f391cb6c8f069644732d2389ca653da4

7 years agoCatch and avoid a 16-bit integer overflow on the number of columns in a
drh [Sat, 21 Oct 2017 14:17:31 +0000 (14:17 +0000)] 
Catch and avoid a 16-bit integer overflow on the number of columns in a
common table expression.  This fixes a problem found by OSS-Fuzz.  The
test case is in TH3.

FossilOrigin-Name: 6ee8cb6ae5fd076ec226bb184b5690ba29f9df8cfaef47aaf13336873b4c1f6c

7 years agoRemove unnecessary "#if SQLITE_MAX_COLUMN". SQLITE_MAX_COLUMN is always
drh [Sat, 21 Oct 2017 13:29:26 +0000 (13:29 +0000)] 
Remove unnecessary "#if SQLITE_MAX_COLUMN".  SQLITE_MAX_COLUMN is always
defined.

FossilOrigin-Name: 6ec82acde81a46a75ed5931fc7dd813f2523753106ad7b8f0b544b9da9824d5a

7 years agoTake extra care to avoid an OOB read caused by a corrupt b-tree page.
dan [Thu, 19 Oct 2017 15:17:38 +0000 (15:17 +0000)] 
Take extra care to avoid an OOB read caused by a corrupt b-tree page.

FossilOrigin-Name: 04925dee41a21ffca9a9f9df27d8165431668c42c2b33d08b077fdb28011170b

7 years agoAvoid using snprintf as a member variable of a struct in sqlite3ext.h. This
dan [Wed, 18 Oct 2017 15:02:01 +0000 (15:02 +0000)] 
Avoid using snprintf as a member variable of a struct in sqlite3ext.h. This
causes problems on OSX. Similar to fix [a1fd3aa8].

FossilOrigin-Name: cd0471ca9f75e7c8be74536ff4ec85b5d70f0d7994b680ed5f45b9f12a46cf46

7 years agoAvoid using snprintf as a member variable of a struct in sqlite3ext.h. This sqlite3ext-fix
dan [Wed, 18 Oct 2017 14:29:36 +0000 (14:29 +0000)] 
Avoid using snprintf as a member variable of a struct in sqlite3ext.h. This
causes problems on OSX.

FossilOrigin-Name: b066d5a69f5391b2cef04b4e288f7d33e63a4ff54325b7e9fbd6aa42529c2f3c

7 years agoThe source code files generated for the 'sqlite3-all.c' target should not have Window...
mistachkin [Tue, 17 Oct 2017 18:33:22 +0000 (18:33 +0000)] 
The source code files generated for the 'sqlite3-all.c' target should not have Windows line-endings.

FossilOrigin-Name: 6a08c43431be18a08bdcbf33d327513f72fff72dac5d02103dab8399d8c3d668

7 years agoFix the ".check" command of the command-line shell to return 1 (error)
drh [Tue, 17 Oct 2017 13:44:46 +0000 (13:44 +0000)] 
Fix the ".check" command of the command-line shell to return 1 (error)
rather than 2 (exit) on a test failure.

FossilOrigin-Name: e2af0cc6ef5fafc785b8b73f51995901f50822972dcfb632494e22402596186d

7 years agoImproved comments, including a typo fix, on the whereLoopCheaperProperSubset()
drh [Mon, 16 Oct 2017 11:50:12 +0000 (11:50 +0000)] 
Improved comments, including a typo fix, on the whereLoopCheaperProperSubset()
function.

FossilOrigin-Name: 700a3c694438ca6cca185d0097f24799e82717ef38cb47bd83666c80f0e3cb2f

7 years agoIn the query planner, do not consider index X to be a proper subset of
drh [Sun, 15 Oct 2017 22:16:25 +0000 (22:16 +0000)] 
In the query planner, do not consider index X to be a proper subset of
index Y if X is a covering index but Y is not.

FossilOrigin-Name: ee31c04353cd75ea4bbadee2994c30d3808b696a4f680187502d104902988a5d

7 years agoUpdates to the Makefiles for MSVC. Cherrypick of [ac8786f3f9f35cb6].
mistachkin [Sat, 14 Oct 2017 19:58:37 +0000 (19:58 +0000)] 
Updates to the Makefiles for MSVC.  Cherrypick of [ac8786f3f9f35cb6].

FossilOrigin-Name: 92eb721faefcdd8396072722d3e4d7ca41b860b306e4bb0f0191dde8f30d0add

7 years agoUpdates to the Makefiles for MSVC.
mistachkin [Sat, 14 Oct 2017 19:54:06 +0000 (19:54 +0000)] 
Updates to the Makefiles for MSVC.

FossilOrigin-Name: ac8786f3f9f35cb6fa72c65f5ca41cc6659f4702cd29ab0c9dcf04d3d1189090

7 years agoImproved ability to generate stand-alone program using TCL and SQLite by
drh [Fri, 13 Oct 2017 20:14:06 +0000 (20:14 +0000)] 
Improved ability to generate stand-alone program using TCL and SQLite by
compiling with -DTCLSH_INIT_PROC=name to cause the TCL interpreter to be
initialized using procedure name().  Both sqlite3_analyzer and testfixture
are now built this way.

FossilOrigin-Name: d65d1f297ddb07b799ff5b2e560575fc59a6fa74c752269cc85ab84348fb7da4

7 years agoAdd the tcl/mkccode.tcl script used to construct a single C-language source
drh [Fri, 13 Oct 2017 18:58:55 +0000 (18:58 +0000)] 
Add the tcl/mkccode.tcl script used to construct a single C-language source
fiel for programs that combine C-code, SQLite, and TCL.  Use this script to
construct the sqlite3_analyzer program.

FossilOrigin-Name: 298a3fddec459c4fd2b840bd363239dc627f1dda90e2d5e478846cb895a8ad82

7 years agoMove a bunch of unrelated test code out of tclsqlite.c and into
drh [Fri, 13 Oct 2017 16:19:48 +0000 (16:19 +0000)] 
Move a bunch of unrelated test code out of tclsqlite.c and into
test_*.c files.  There is still some test code in tclsqlite.c, but the amount
is greatly reduced.

FossilOrigin-Name: a9c4bc88fcf985a0bea14ed5381239cfb697886287998da04a10230b6858ab5d

7 years agoThe db_use_legacy_prepare command no longer exists. Use the undocumented tclsqlite-cleanup
drh [Fri, 13 Oct 2017 16:01:36 +0000 (16:01 +0000)] 
The db_use_legacy_prepare command no longer exists.  Use the undocumented
-use-legacy-prepare option to DB version instead.

FossilOrigin-Name: ea2fa9ab9b3c97e001c1a2f3e24f3554b544070d5f915b9827eb07eb5ea8f00b

7 years agoWhen compiling with SQLITE_TEST, extra options are available on the
drh [Fri, 13 Oct 2017 15:56:26 +0000 (15:56 +0000)] 
When compiling with SQLITE_TEST, extra options are available on the
"DB version" command for controlling the internal state of the SqliteDb
object, for testing purposes.

FossilOrigin-Name: bf86478d9c6b899d6441e80cf9d17b58731e5d354e31b11f0d58a798f6fab896

7 years agoMove some test logic out of tclsqlite.c and into auxiliary test_*.c files.
drh [Fri, 13 Oct 2017 15:06:06 +0000 (15:06 +0000)] 
Move some test logic out of tclsqlite.c and into auxiliary test_*.c files.
This is a work in progress.

FossilOrigin-Name: 95b7687fed75b32a62a0c62d397f4f543bf40095e13c22e15938d5dcfd71fcdf

7 years agoAdd the sqlite_dbpage virtual table (enabled using SQLITE_ENABLE_DBPAGE_VTAB).
drh [Thu, 12 Oct 2017 20:37:20 +0000 (20:37 +0000)] 
Add the sqlite_dbpage virtual table (enabled using SQLITE_ENABLE_DBPAGE_VTAB).
Make that virtual table and dbstat available to the command-line shell.

FossilOrigin-Name: eaeeb09d4aa1dbccdd2488af8461e2a8c8a53d92c63fd56330be041ad72a9e4a

7 years agoCreate the new ext/repair folder and move checkfreelist.c there. Remove
drh [Thu, 12 Oct 2017 19:50:28 +0000 (19:50 +0000)] 
Create the new ext/repair folder and move checkfreelist.c there.  Remove
checkfreelist.c from the command-line shell (undoing check-in [48418f2e]).

FossilOrigin-Name: dfdebd12bfc80b91d234ab328cb6106d5d37ccb79b58e36e556c1a8af640a4ab

7 years agoFix a harmless compiler warning about an unused parameter.
drh [Thu, 12 Oct 2017 14:18:38 +0000 (14:18 +0000)] 
Fix a harmless compiler warning about an unused parameter.

FossilOrigin-Name: de20133d44773f0b3b8869db5c1cb2a90f0426a54c7f40d12a930003343ad8e0

7 years agoFix the "snapshot-tarball" makefile target, which was broken by the shell.c
drh [Thu, 12 Oct 2017 14:13:20 +0000 (14:13 +0000)] 
Fix the "snapshot-tarball" makefile target, which was broken by the shell.c
change of check-in [36acc0a9].

FossilOrigin-Name: c643ace24c1936f9d2b16bd6d1d13cf08070dfe5b094208b638924e904915339

7 years agoMerge fixes from trunk. All changes are on makefiles and test scripts.
drh [Thu, 12 Oct 2017 14:03:09 +0000 (14:03 +0000)] 
Merge fixes from trunk.  All changes are on makefiles and test scripts.
There are no core code changes.

FossilOrigin-Name: 1fb87a0c6e4db1f8bf51d552d9af1252544b7d7bd2dd80f78870f3b4fd347bad

7 years agoThe src/shell.c file is now generated from src/shell.c.in, so remove shell.c
drh [Thu, 12 Oct 2017 13:47:48 +0000 (13:47 +0000)] 
The src/shell.c file is now generated from src/shell.c.in, so remove shell.c
from version control and update the makefiles to build it automatically.

FossilOrigin-Name: 36acc0a97fdcc6f54f29c68c4e131702f69c3e59e58237ff4e5c647928699956

7 years agoMerge fixes from the 3.21 branch.
drh [Thu, 12 Oct 2017 13:21:56 +0000 (13:21 +0000)] 
Merge fixes from the 3.21 branch.

FossilOrigin-Name: 292921692c8919d29f0a67d03ca953d5c1c4900d8c8567cceab27513732be598

7 years agoFix a potential crash that may follow an OOM or other system error in the shell tool.
dan [Thu, 12 Oct 2017 11:33:13 +0000 (11:33 +0000)] 
Fix a potential crash that may follow an OOM or other system error in the shell tool.

FossilOrigin-Name: c36761e1a05c15c48468dd793faf06636f5dcfd3b4314074c4d9c9eac5c2695c