]> git.ipfire.org Git - thirdparty/sqlite.git/log
thirdparty/sqlite.git
4 years agoFix handling of an xShmLock(SHARED, UNLOCK) call when the caller does not hold any... unixshmlock-opt
dan [Fri, 28 Aug 2020 20:01:06 +0000 (20:01 +0000)] 
Fix handling of an xShmLock(SHARED, UNLOCK) call when the caller does not hold any lock on the specified slot, but another connection in the same process holds an EXCLUSIVE.

FossilOrigin-Name: 3eb365027b885e1f61965efd53a3643b6ff441ae01e79038a091314516a50dd4

4 years agoModify the unixShmLock() function to avoid iterating through the (possibly large...
dan [Fri, 28 Aug 2020 19:27:15 +0000 (19:27 +0000)] 
Modify the unixShmLock() function to avoid iterating through the (possibly large) set of connections to the same database file.

FossilOrigin-Name: e0faddf0dfc3a40b6b94408296dd781dd0264ecc9f2129ce4405438433fb00e0

4 years agoAdd fts5 test to confirm that for a table with columns a, b, c and d, "{a b}" and...
dan [Fri, 28 Aug 2020 11:19:49 +0000 (11:19 +0000)] 
Add fts5 test to confirm that for a table with columns a, b, c and d, "{a b}" and "-{c d}" are handled similarly.

FossilOrigin-Name: 1a04920998368e56276fd0b100be8343609c6ff8a731cf8e26a0490f9c6dabdf

4 years agoRemove a (harmless) redundant variable from the CLI implementation.
drh [Thu, 27 Aug 2020 20:55:54 +0000 (20:55 +0000)] 
Remove a (harmless) redundant variable from the CLI implementation.

FossilOrigin-Name: 3f7bbb840de0a9b1ca89288805cb151aea6fcb82efda9ba39f51abf1b17c070b

4 years agoInclude the original text of the CHECK constraint in the error message for
drh [Thu, 27 Aug 2020 18:36:30 +0000 (18:36 +0000)] 
Include the original text of the CHECK constraint in the error message for
anonymous CHECK constraints.

FossilOrigin-Name: 5ce34a955bb36d77edc9951cb7ac2ef9c876d7d3ff5852af682f558e248f428c

4 years agoApple the same fix for ticket [9eda2697f5cc1aba] to text-to-integer
drh [Thu, 27 Aug 2020 16:28:30 +0000 (16:28 +0000)] 
Apple the same fix for ticket [9eda2697f5cc1aba] to text-to-integer
conversions that was done for floating point conversions by
check-in [1c76f1d8ec0937a2].

FossilOrigin-Name: aafb7a21041090e529491b0ce30c3902420be0551b1b2c55840a5fbb9105fb7d

4 years agoDo not attempt to run test script analyze3.test as part of the "prepare" permutation.
dan [Thu, 27 Aug 2020 14:53:47 +0000 (14:53 +0000)] 
Do not attempt to run test script analyze3.test as part of the "prepare" permutation.

FossilOrigin-Name: f7f13cb1bc699c034a3f5f7a2431c8055cb79e2a14d5e70e1fc5dd6dec00fb26

4 years agoEnhance the ".databases" command in the CLI so that it shows the result
drh [Wed, 26 Aug 2020 19:07:18 +0000 (19:07 +0000)] 
Enhance the ".databases" command in the CLI so that it shows the result
of sqlite3_db_readonly() and sqlite3_txn_state() for each database file.

FossilOrigin-Name: 0ffd16d23dd3b6467cce31af506c70fde44c3796d386c2a03896e43a6d683e60

4 years agoIf the argument to the ".read" command in the CLI begins with "|" then
drh [Wed, 26 Aug 2020 10:50:48 +0000 (10:50 +0000)] 
If the argument to the ".read" command in the CLI begins with "|" then
run the remainder of the argument as a command and read input from the
output of that command.

FossilOrigin-Name: 6c716f4b556ea8f9c9f15cffd81cb970488eadf1d5da2ba6b366d3bdeb36e492

4 years agoAdd support for the sqlite3_txn_state() interface.
drh [Tue, 25 Aug 2020 19:09:07 +0000 (19:09 +0000)] 
Add support for the sqlite3_txn_state() interface.

FossilOrigin-Name: ad195e3dd89d0f33b50070c18fb8f43c4eb24162515dfdd7c04d9e7d96b902a2

4 years agoReduce the N in the logN term for the sorting cost associated with computing
drh [Mon, 24 Aug 2020 23:44:27 +0000 (23:44 +0000)] 
Reduce the N in the logN term for the sorting cost associated with computing
DISTINCT by B-Tree by half, under the assumption that the DISTINCT will
eliminate about half the rows of output.  This is really a wild guess.  But
we do not have any better way of estimating what the row-count reduction due
to DISTINCT will actually be.

FossilOrigin-Name: 8787417ec1da8071d84c6ff0d7a90b5fd458ab6baba871327f36bc4e1bceca61

4 years agoCorrectly handle expressions like "x IS (not) true/false" within the rhs of IN()...
dan [Mon, 24 Aug 2020 10:52:52 +0000 (10:52 +0000)] 
Correctly handle expressions like "x IS (not) true/false" within the rhs of IN() expressions. Fix for [f3ff1472].

FossilOrigin-Name: 493a25949b9a6d0be82169b597133e491d8be4f4147b6eae135b06c1d810abd3

4 years agoFix a crash that could occur in SQLITE_MAX_EXPR_DEPTH=0 builds when processing SQL...
dan [Thu, 20 Aug 2020 16:25:26 +0000 (16:25 +0000)] 
Fix a crash that could occur in SQLITE_MAX_EXPR_DEPTH=0 builds when processing SQL containing syntax errors.

FossilOrigin-Name: 5f58dd3a19605b6f49b4364fa29892502eff35f12a7693a8694100e1844711ea

4 years agoAvoid a buffer overrun in test code that could occur if certain test functions were...
dan [Thu, 20 Aug 2020 11:03:33 +0000 (11:03 +0000)] 
Avoid a buffer overrun in test code that could occur if certain test functions were passed a hex-string containing an odd number of digits.

FossilOrigin-Name: 3c5e63c22ffbfeb66eb6ee38912d29fad6f2bd4d74b6a25e89bd36bf40eaa661

4 years agoTry to make SQLite easier to compiler for Mac Catalyst. See
drh [Wed, 19 Aug 2020 23:51:54 +0000 (23:51 +0000)] 
Try to make SQLite easier to compiler for Mac Catalyst. See
[https://sqlite.org/forum/forumpost/803387a1c5|forum post 803387a1c5].

FossilOrigin-Name: e1595a20d71e61957944cc2b634578968cda8fba08a1f1e75edba20dc9c6080b

4 years agoDo not skip over TK_IF_NULL_ROW operators when bypassing TK_COLLATE operators.
drh [Wed, 19 Aug 2020 23:32:06 +0000 (23:32 +0000)] 
Do not skip over TK_IF_NULL_ROW operators when bypassing TK_COLLATE operators.
Fix to check-in [ac31edd3eeafcef4] which was itself a fix for ticket
[45f4bf4eb4ffd788].

FossilOrigin-Name: 871f2ddcfbb9196dbd851a350e3471ee6d242d86bbd755201f7e2406fce3ac55

4 years agoUpdate releasetest_data.tcl so that the "Fast-One" configuration runs bigmmap.test...
dan [Wed, 19 Aug 2020 15:24:19 +0000 (15:24 +0000)] 
Update releasetest_data.tcl so that the "Fast-One" configuration runs bigmmap.test as part of release testing.

FossilOrigin-Name: a0aa35aaa5694a96638a7c7b1cd69c7523750cbe95831a13c1ee5a6d48256b76

4 years agoFix a problem in test file bigmmap.test.
dan [Wed, 19 Aug 2020 15:21:52 +0000 (15:21 +0000)] 
Fix a problem in test file bigmmap.test.

FossilOrigin-Name: d8e47382160e98be646ce3ba568578493088d1bb11d513ded3e00b576fb07f06

4 years agoFix the -quote option on the CLI to set the correct column separator.
drh [Mon, 17 Aug 2020 09:11:21 +0000 (09:11 +0000)] 
Fix the -quote option on the CLI to set the correct column separator.

FossilOrigin-Name: c778f8295c3c9b6cd6107b33fd7664ae75c97840fc974c9f971755a523f185c4

4 years agoOptimization to sqlite3BeginWriteOperation().
drh [Sun, 16 Aug 2020 00:30:44 +0000 (00:30 +0000)] 
Optimization to sqlite3BeginWriteOperation().

FossilOrigin-Name: 2173d4c6e3addc75964508f2fc8e42755376b3bc285286fa90df4831a6fa280b

4 years agoOptimization of the sqlite3SrcListDelete() routine.
drh [Sat, 15 Aug 2020 23:48:22 +0000 (23:48 +0000)] 
Optimization of the sqlite3SrcListDelete() routine.

FossilOrigin-Name: 1b4acd1ac4a8d24f8804c6d0770f5b0022f569d51742b6954b26e525f04d38ca

4 years agoRemove more unnecessary sqlite3GetVdbe() calls, replacing them with assert()s.
drh [Sat, 15 Aug 2020 22:23:00 +0000 (22:23 +0000)] 
Remove more unnecessary sqlite3GetVdbe() calls, replacing them with assert()s.

FossilOrigin-Name: b7dc932197665f0ebde3ffb8f0785c22da07ce307cfd5f0eab69e86e4b38fcde

4 years agoAvoid unnecessary calls to the sqlite3GetVdbe() routine. Add assert()
drh [Sat, 15 Aug 2020 21:55:14 +0000 (21:55 +0000)] 
Avoid unnecessary calls to the sqlite3GetVdbe() routine.  Add assert()
statements to prove each call is unnecessary.

FossilOrigin-Name: 86d3790caf92e9cb7a9aaaa110f309b4b6945ac30cfd53fc3e5aa1ec3075ada5

4 years agoOmit the unnecessary not-NULL check on the upper bound of a forward index
drh [Sat, 15 Aug 2020 19:58:59 +0000 (19:58 +0000)] 
Omit the unnecessary not-NULL check on the upper bound of a forward index
range scan.  The subsequent OP_IdxGT will always catch the NULL.  Similarly,
omit the not-NULL check on the lower bound of a reverse index range scan,
as the SeekLE opcode will disallow the NULL.

FossilOrigin-Name: e51ecadcbdef5ce6e41d68412aee70aa4a1416c850358a6fa7e9a1ab443e719d

4 years agoWhen doing an UPDATE or DELETE using a multi-column index where only a few
drh [Fri, 14 Aug 2020 21:51:02 +0000 (21:51 +0000)] 
When doing an UPDATE or DELETE using a multi-column index where only a few
of the earlier columns of the index are useful for the index lookup,
postpone doing the main table seek until after all WHERE clause constraints
have been evaluated, in case those constraints can be covered by unused
later terms of the index, thus avoiding unnecessary main table seeks.

FossilOrigin-Name: 7fee0b1075d622835dc6828c061be516102da9e2809f52d9ab7c4bbef7dfb871

4 years agoUpdate the version number to 3.34.0 for the next development cycle.
drh [Fri, 14 Aug 2020 21:37:32 +0000 (21:37 +0000)] 
Update the version number to 3.34.0 for the next development cycle.

FossilOrigin-Name: 70f34f3df5358d36c8578afbc05756450c46da36b8dce339ed87fc0b9d4057cb

4 years agoOptimizations to the logic that converts main table accesses into equivalent delete-bytecode-optimization
drh [Fri, 14 Aug 2020 21:32:16 +0000 (21:32 +0000)] 
Optimizations to the logic that converts main table accesses into equivalent
index accesses.  Code is now slightly smaller and faster than trunk.

FossilOrigin-Name: 611b640442025e57b8e161f8ddac1f19bd3be9a3d5266f4cef287595c3ed9257

4 years agoFor UPDATE and DELETE, use OP_DeferredSeek always. If the seek must later
drh [Fri, 14 Aug 2020 20:04:26 +0000 (20:04 +0000)] 
For UPDATE and DELETE, use OP_DeferredSeek always.  If the seek must later
be resolved, add the OP_FinishSeek opcode after all WHERE clause terms have
been processed.  This obviates the need for the WHERE_SEEK_TABLE and
WHERE_SEEK_UNIQ_TABLE flags to sqlite3WhereBegin() and the ensuing
complication, and it allows the covering index optimization to be used
further into WHERE clause processing.

FossilOrigin-Name: a495f60d315e34b1a1bc5fb1336e05047add52c8fb2710b577c97b10a5e734f6

4 years agoExperimental change to try to get some DELETE operations to access values
drh [Fri, 14 Aug 2020 17:39:31 +0000 (17:39 +0000)] 
Experimental change to try to get some DELETE operations to access values
using the index rather than the main table, so as to avoid unnecessary
main table seeks.

FossilOrigin-Name: 2f7cb6ab39e54fd6eb3a280d3022c3d4f4ed92e83af7226e63e0199a96397a6b

4 years agoFix an inconsequential memory leak in sqldiff. Update the "Sanitize" case in wapptest...
dan [Fri, 14 Aug 2020 16:14:40 +0000 (16:14 +0000)] 
Fix an inconsequential memory leak in sqldiff. Update the "Sanitize" case in wapptest.tcl to use -fsanitize=address,undefined, and to run more tests.

FossilOrigin-Name: 613fb5c2525be77e48bad0a74e8b7bf53489365060fb9c7713a0caddb1820c71

4 years agoVersion 3.33.0 version-3.33.0
drh [Fri, 14 Aug 2020 13:23:32 +0000 (13:23 +0000)] 
Version 3.33.0

FossilOrigin-Name: fca8dc8b578f215a969cd899336378966156154710873e68b3d9ac5881b0ff3f

4 years agoFix "make test" handling of environment variable QUICKTEST_OMIT so that it can be...
dan [Thu, 13 Aug 2020 17:27:57 +0000 (17:27 +0000)] 
Fix "make test" handling of environment variable QUICKTEST_OMIT so that it can be used to exclude test files in other than the main test directory.

FossilOrigin-Name: b050976079ba4a22d4dfeadb81f40cf71da6588c95bf2b634d88b416de5accd7

4 years agoImprovement on the previous fix.
drh [Wed, 12 Aug 2020 16:19:12 +0000 (16:19 +0000)] 
Improvement on the previous fix.

FossilOrigin-Name: f6cffa2d50bfebe5b025f412b7a49b7fdafb798aaf1ddc80e6656ccd1f012a7f

4 years agoFix an assertion() fault in ALTER TABLE found by OSSFuzz. Test case in TH3.
drh [Wed, 12 Aug 2020 15:39:43 +0000 (15:39 +0000)] 
Fix an assertion() fault in ALTER TABLE found by OSSFuzz.  Test case in TH3.

FossilOrigin-Name: 41de742c5713ab1a0c0c15c44af3ffac40bbc527ae2dc11d829ba9773eb4c84a

4 years agoFix harmless USAN warnings from gcc9.
drh [Tue, 11 Aug 2020 21:53:42 +0000 (21:53 +0000)] 
Fix harmless USAN warnings from gcc9.

FossilOrigin-Name: 72c4c69fea13f5e24df25645e6941ce3ff896f0a3c73cd63329f819cc907ab40

4 years agoNew test cases for the use of the ieee754 and decimal extensions in the CLI.
drh [Tue, 11 Aug 2020 18:17:04 +0000 (18:17 +0000)] 
New test cases for the use of the ieee754 and decimal extensions in the CLI.

FossilOrigin-Name: bc1590f32fc4e2696b4126bd0302cb6405031dd4f55b86f3f1611f7f39299f85

4 years agoModify a test for corruption within the wal checkpoint code to account for the pendin...
dan [Tue, 11 Aug 2020 18:00:10 +0000 (18:00 +0000)] 
Modify a test for corruption within the wal checkpoint code to account for the pending-byte page. And for the fact that test configurations might move the pending-byte page.

FossilOrigin-Name: 7dfb74c37e678dde347d9d85846672f82ad282e300e32676330b764be2e4d580

4 years agoMinor comment fixes. No changes to code.
drh [Tue, 11 Aug 2020 17:20:02 +0000 (17:20 +0000)] 
Minor comment fixes.  No changes to code.

FossilOrigin-Name: 533aeb90085d989078073067172135db98e37e00be84f99757255858126196e4

4 years agoRemove an unused #define from sqliteInt.h.
drh [Tue, 11 Aug 2020 16:46:21 +0000 (16:46 +0000)] 
Remove an unused #define from sqliteInt.h.

FossilOrigin-Name: d5b254f94c1ce6f0f26024d0b9c80e610f7cc891360bc4c2cb116e9eda2874b3

4 years agoSimplify #ifdefs associated with Parse.eParseMode. Fix an #ifdef error
drh [Mon, 10 Aug 2020 21:01:32 +0000 (21:01 +0000)] 
Simplify #ifdefs associated with Parse.eParseMode.  Fix an #ifdef error
associated with SQLITE_OMIT_AUTOVACUUM.

FossilOrigin-Name: 5bbd4bddd3b9fa64d134ed62bce3eb4a09456bf24dec2474b5d764a3a3775964

4 years agoFix a problem causing test failures in corruptL.test for some permutations.
dan [Mon, 10 Aug 2020 19:35:01 +0000 (19:35 +0000)] 
Fix a problem causing test failures in corruptL.test for some permutations.

FossilOrigin-Name: 680bdc6524ad6af0e74401e96e3a576145042fb865c1582bfaffc11d4ff76a4f

4 years agoFix a problem building fts3 separately from the amalgamation.
dan [Mon, 10 Aug 2020 19:30:21 +0000 (19:30 +0000)] 
Fix a problem building fts3 separately from the amalgamation.

FossilOrigin-Name: 2a167cfbb2abd76e1b33116b671e58a767fc972dd79bee0004aad09a1dd2b487

4 years agoFix a shell tool build error caused by some combinations of options.
dan [Mon, 10 Aug 2020 14:34:36 +0000 (14:34 +0000)] 
Fix a shell tool build error caused by some combinations of options.

FossilOrigin-Name: 33cd5341ac2ec84c86fbd3371f15c9153f83c1739f85dd8c3956fe2093d49afd

4 years agoFix harmless compiler warnings that surface in newer versions of GCC.
drh [Mon, 10 Aug 2020 14:18:00 +0000 (14:18 +0000)] 
Fix harmless compiler warnings that surface in newer versions of GCC.

FossilOrigin-Name: 9d670a318381f219b467653f5f9539097808b887ae37291ce13be462dedfb18d

4 years agoFix another test script problem in walvfs.test.
dan [Mon, 10 Aug 2020 11:21:48 +0000 (11:21 +0000)] 
Fix another test script problem in walvfs.test.

FossilOrigin-Name: 1b89d3931e368a66be5075bdf49eedd3839591ee268e3ac293040b5bf7639746

4 years agoFix minor test script problems.
dan [Mon, 10 Aug 2020 10:43:43 +0000 (10:43 +0000)] 
Fix minor test script problems.

FossilOrigin-Name: 5d54cd44d076cfede60bd404a59bd700a950420b961ae9fdec4365a3e4ed18ed

4 years agoFix a harmless compiler warning.
drh [Sun, 9 Aug 2020 17:58:45 +0000 (17:58 +0000)] 
Fix a harmless compiler warning.

FossilOrigin-Name: 6f91769fdb0734905f05e1f4d1c81364e6e874450c9f13a0de2259d564f582a7

4 years agoFix the check-in at [41474548ef3f7454] so that it computes the pointer in
drh [Sat, 8 Aug 2020 20:15:16 +0000 (20:15 +0000)] 
Fix the check-in at [41474548ef3f7454] so that it computes the pointer in
time for error checking at the end of the routine in the case of a non-OOM
error.

FossilOrigin-Name: 13d2fed760e7d0def573c56b7181f45622b0ed78d61952a6de901f96949d074e

4 years agoFix test script busy2.test so that it works with the inmemory-journal permutation.
dan [Sat, 8 Aug 2020 20:11:22 +0000 (20:11 +0000)] 
Fix test script busy2.test so that it works with the inmemory-journal permutation.

FossilOrigin-Name: b412d1d175fde9c6402b6fda7c73ac2db2471f2c9416d5c5073549732dea6d98

4 years agoChanges to busy2.test, corruptL.test and fkey5.test so that new test cases pass with...
dan [Sat, 8 Aug 2020 20:03:12 +0000 (20:03 +0000)] 
Changes to busy2.test, corruptL.test and fkey5.test so that new test cases pass with all test permutations.

FossilOrigin-Name: d62d1711e2b0f18bb4dfb8899299c8e5b4c8205989b719699da60bcfe1884cf3

4 years agoFix a test script problem causing an error for SQLITE_ENABLE_OVERSIZE_CELL_CHECK...
dan [Sat, 8 Aug 2020 19:52:53 +0000 (19:52 +0000)] 
Fix a test script problem causing an error for SQLITE_ENABLE_OVERSIZE_CELL_CHECK builds in corruptL.test.

FossilOrigin-Name: a85520e0074d574cb4ac5239bb225f8f0b0b3ea1d782cd1cbc79797b4c583fb0

4 years agoMove a pointer computation until after OOM checks to avoid a nuisance USAN
drh [Sat, 8 Aug 2020 17:55:39 +0000 (17:55 +0000)] 
Move a pointer computation until after OOM checks to avoid a nuisance USAN
warning.

FossilOrigin-Name: 41474548ef3f7454e44fbf648429730b3f5ba1ff0086fd2f2d0e59b8f51d85e6

4 years agoChange the name of sqlite3SelectTrace to sqlite3_unsupported_selecttrace.
dan [Sat, 8 Aug 2020 17:02:39 +0000 (17:02 +0000)] 
Change the name of sqlite3SelectTrace to sqlite3_unsupported_selecttrace.

FossilOrigin-Name: 5ecd03a27b81637ec92af654451a8fff46f1768ddb7c7a443d2a4a933b4475c1

4 years agoUpdate requirement marks due to wording improvements in the documentation.
drh [Sat, 8 Aug 2020 15:40:42 +0000 (15:40 +0000)] 
Update requirement marks due to wording improvements in the documentation.

FossilOrigin-Name: bf875a1c7fcb2b41a4d3bd741bb358a635b869d0b6fc9d24385cd5779686d78c

4 years agoReorder declarations in the decimal extension for C89.
drh [Sat, 8 Aug 2020 00:44:45 +0000 (00:44 +0000)] 
Reorder declarations in the decimal extension for C89.

FossilOrigin-Name: eface2da2c0b3daee2a5fd640cca3d3757d0930f62900fc810c50c104635241d

4 years agoDo the oversize-WAL corruption test before the size hint is issued.
drh [Fri, 7 Aug 2020 19:52:01 +0000 (19:52 +0000)] 
Do the oversize-WAL corruption test before the size hint is issued.

FossilOrigin-Name: fdc5fb902d7f2d10f73e64fe30c67153b59b26c5d707fc9c354e90967dbcc214

4 years agoFix a file-descriptor leak in test script corruptL.test.
dan [Fri, 7 Aug 2020 18:52:03 +0000 (18:52 +0000)] 
Fix a file-descriptor leak in test script corruptL.test.

FossilOrigin-Name: ec2c340c39bc78e4bce0eb01ea408c95ba121103cc77f300f29f3001fc345c20

4 years agoReturn an SQLITE_CORRUPT error if the final expected size of the database when checkp...
dan [Fri, 7 Aug 2020 16:28:02 +0000 (16:28 +0000)] 
Return an SQLITE_CORRUPT error if the final expected size of the database when checkpointing is not reasonable - where reasonable is defined (basically) as the sum of the sizes of the database and wal files.

FossilOrigin-Name: e2799563c8a97f617c6d932719b312e3d5bff051a9a397492df8d88e8bb4260a

4 years agoAdd the --checkpoint option to speedtest1.
drh [Fri, 7 Aug 2020 14:47:55 +0000 (14:47 +0000)] 
Add the --checkpoint option to speedtest1.

FossilOrigin-Name: 4cffa9bb44d6f0bdb23cae913adfb224f0814e65a2abb9120179f0b288e70f77

4 years agoFix compilation issues with MSVC.
drh [Fri, 7 Aug 2020 14:22:56 +0000 (14:22 +0000)] 
Fix compilation issues with MSVC.

FossilOrigin-Name: c5a7e6d2c203ebe5f22ab5c676d33759b542ac57c8bad85d8f561a53bd26917c

4 years agoFix the columnar output modes in the CLI so that they work with parameters.
drh [Thu, 6 Aug 2020 16:45:22 +0000 (16:45 +0000)] 
Fix the columnar output modes in the CLI so that they work with parameters.
See [https://sqlite.org/forum/forumpost/17ba6aac24] for details of the
problem fixed.

FossilOrigin-Name: d573aa9b1299bc25e46fc8a4b4f7c665263490db86c66f11e2d903dcd7071995

4 years agoFix compilation issues with MSVC. msvcWarn
mistachkin [Tue, 4 Aug 2020 16:11:37 +0000 (16:11 +0000)] 
Fix compilation issues with MSVC.

FossilOrigin-Name: af07d8458ae5e2933134b706f80f9538f011970221904bf9f50ed6e47d306e14

4 years agoBack out a NEVER() that turns out to be reachable.
drh [Fri, 31 Jul 2020 23:34:53 +0000 (23:34 +0000)] 
Back out a NEVER() that turns out to be reachable.

FossilOrigin-Name: 8cf342d4e5eb67b17aee595d9d75f7798eccaebc1ec88e646d344d8d4ab64977

4 years agoRemove an ALWAYS() that turns out to be reachable.
drh [Fri, 31 Jul 2020 02:07:16 +0000 (02:07 +0000)] 
Remove an ALWAYS() that turns out to be reachable.

FossilOrigin-Name: 12bb75d9edc4c11de58d8b1105b95366c58ac4daaa9ad659499dded89a0d7cb5

4 years agoTest for schema corruption is reachable after all.
drh [Thu, 30 Jul 2020 23:47:00 +0000 (23:47 +0000)] 
Test for schema corruption is reachable after all.

FossilOrigin-Name: 2032236cce2ea040dec4cb1c03284bf4882efc1e0158703ab93d8a3451c805a5

4 years agoProvide an alternative "guaranteed-safe" method for overwriting the WAL index
drh [Thu, 30 Jul 2020 22:33:36 +0000 (22:33 +0000)] 
Provide an alternative "guaranteed-safe" method for overwriting the WAL index
on recovery, in case some platform is found for which memcpy() cannot do this
safely.

FossilOrigin-Name: 168cccbabbd4807bdb04953f395cd1a245c46e9d4816a09c9d024ecd5432759d

4 years agoFix compiler warnings in MSVC.
drh [Thu, 30 Jul 2020 17:37:49 +0000 (17:37 +0000)] 
Fix compiler warnings in MSVC.

FossilOrigin-Name: 96e3dba2ed3ab0c5b2ecf65a3408633e0767c884d48c270e9ef10ab9fa3ec051

4 years agoAllow for page numbers as large as 4294967294 (0xfffffffe) which means
drh [Thu, 30 Jul 2020 17:29:39 +0000 (17:29 +0000)] 
Allow for page numbers as large as 4294967294 (0xfffffffe) which means
database files as large as 281 TB.

FossilOrigin-Name: 166e82dd20efbfd355ef3fb8b500bfebd8b946f1b13619b46722de96b57ed039

4 years agoFix unreachable branches. larger-databases
drh [Thu, 30 Jul 2020 17:14:55 +0000 (17:14 +0000)] 
Fix unreachable branches.

FossilOrigin-Name: 905752da9815ff8242b3cb9a77b1ffdc5cfc76143f47c774890f617a542457a5

4 years agoFix signed/unsigned compiler warnings.
drh [Wed, 29 Jul 2020 12:23:20 +0000 (12:23 +0000)] 
Fix signed/unsigned compiler warnings.

FossilOrigin-Name: 1d69eee8b085d514f442840346f001b4785f8ec64f5ba66943e9577b26e2e29c

4 years agoEarlier detection of out-of-range page numbers in the btree layer.
drh [Tue, 28 Jul 2020 20:32:12 +0000 (20:32 +0000)] 
Earlier detection of out-of-range page numbers in the btree layer.

FossilOrigin-Name: 805bb67a82be51dc6077480691ed815c63a37bd8fc00cf7e67e020349c6e322e

4 years agoMerge enhancements from trunk.
drh [Tue, 28 Jul 2020 17:51:48 +0000 (17:51 +0000)] 
Merge enhancements from trunk.

FossilOrigin-Name: 969c25bb14fbd99ca8523abf0ae78a75a3dde539e3323d105690aef4940041eb

4 years agoIf a writer crashes in WAL mode and leave the SHM file in an inconsistent state,
drh [Tue, 28 Jul 2020 17:29:13 +0000 (17:29 +0000)] 
If a writer crashes in WAL mode and leave the SHM file in an inconsistent state,
subsequent transactions are now able to recover the SHM file even if there are
active read transactions.

FossilOrigin-Name: ee8a108058c304f9b6b02f84f1da01a0b7a3a21992627bcc1f97d42e8d23da69

4 years agoAdd an sqlite3FaultSim() to make an OOM case more accessible and remove unlocked-recovery
drh [Tue, 28 Jul 2020 17:17:36 +0000 (17:17 +0000)] 
Add an sqlite3FaultSim() to make an OOM case more accessible and remove
the ALWAYS() on the conditional that is false when the OOM actually occurs.

FossilOrigin-Name: 2a251af84ff1f5ca281aa69c5410d6ae7aa5a85ef47149909a297525e1651e9d

4 years agoOn recovery, always overwrite the old with the new, even if they are the same.
drh [Mon, 27 Jul 2020 20:16:37 +0000 (20:16 +0000)] 
On recovery, always overwrite the old with the new, even if they are the same.
Add ALWAYS() macros on branches currently thought to be unreachable, pending
additional testing.

FossilOrigin-Name: 7052cf1d533f6404d0f45cf0b3e8a11c1ee27eccb64680a7fd308c8da7cbd544

4 years agoFix a couple of test scripts to match the new wal recovery behaviour on this branch.
dan [Mon, 27 Jul 2020 15:05:20 +0000 (15:05 +0000)] 
Fix a couple of test scripts to match the new wal recovery behaviour on this branch.

FossilOrigin-Name: 3af61e83532f76f0f3252a28663415d37b096ddf05a9c58fa79303933c09abce

4 years agoImproved error reporting if walLockExclusive() fails.
drh [Mon, 27 Jul 2020 15:01:10 +0000 (15:01 +0000)] 
Improved error reporting if walLockExclusive() fails.

FossilOrigin-Name: cf962d213abe1b55ebbcfecf1de9d5d61709509d1ce3cbd56d8cf4c9ad65e5a9

4 years agoAllow a wal mode recovery to proceed even if there are readers.
dan [Sat, 25 Jul 2020 20:16:27 +0000 (20:16 +0000)] 
Allow a wal mode recovery to proceed even if there are readers.

FossilOrigin-Name: 74374aebf9abf3d6b6a3920967a079ceaa4c6276dc6c177682742c2be405b7b7

4 years agoMerge recent changes from trunk.
drh [Fri, 24 Jul 2020 13:49:38 +0000 (13:49 +0000)] 
Merge recent changes from trunk.

FossilOrigin-Name: 22e8e6901a119698de831ede6d8b03c4fd6576eaa8686a97a0b8aeea7593688a

4 years agoRemove a surplus space from a comment
drh [Fri, 24 Jul 2020 11:01:29 +0000 (11:01 +0000)] 
Remove a surplus space from a comment

FossilOrigin-Name: 73fecc688ab5c459245c9bb89432139a083ef378404b4dae3397a7f4e253f72a

4 years agoFix other potentiall pointer aliasing problems associated with subclassing
drh [Fri, 24 Jul 2020 09:17:42 +0000 (09:17 +0000)] 
Fix other potentiall pointer aliasing problems associated with subclassing
of the sqlite3_file object for various VFS implementations.

FossilOrigin-Name: 270ac1a0f232d75537be40abae559004e950b992cb2c7e94cd6de66e96ae17bd

4 years agoFix pointer aliasing problem in the in-memory journal code.
drh [Fri, 24 Jul 2020 09:14:44 +0000 (09:14 +0000)] 
Fix pointer aliasing problem in the in-memory journal code.
Ref: [https://sqlite.org/forum/forumpost/d44eb2fc44|forum post d44eb2fc44]

FossilOrigin-Name: 892e9191dc8f805678a501db1993437ee99a1e1849496a0a24ceec9b84123257

4 years agoAdd the OMIT_ZLIB compile-time option to sessionfuzz.c. (Originally
drh [Thu, 23 Jul 2020 18:03:14 +0000 (18:03 +0000)] 
Add the OMIT_ZLIB compile-time option to sessionfuzz.c.  (Originally
checked into the wrong branch.)

FossilOrigin-Name: 6019bf8a2db548fea4be4f49961937d5b12eba9e42c7c7a58babfaf3288cb0cd

4 years agoFix a typo in an error message.
drh [Thu, 23 Jul 2020 15:23:53 +0000 (15:23 +0000)] 
Fix a typo in an error message.

FossilOrigin-Name: 849b03d8de62251707ee0d31c9f1cd98cbd296c70c1a2c8d7c1658840a930fe4

4 years agoMerge fixes from trunk.
drh [Thu, 23 Jul 2020 14:27:51 +0000 (14:27 +0000)] 
Merge fixes from trunk.

FossilOrigin-Name: dd39418ee47529cc3ffbe01eccf31f1304a266a196bf81a2a2cb2e650c195b97

4 years agoAn ORDER BY clause can slip into an SRT_Upfrom query via the query
drh [Thu, 23 Jul 2020 14:12:47 +0000 (14:12 +0000)] 
An ORDER BY clause can slip into an SRT_Upfrom query via the query
flattener, even without the SQLITE_ENABLE_UPDATE_DELETE_LIMIT compile-time
option.  So always enable the code to deal with that case.

FossilOrigin-Name: 6a3111cd0693bb51191d55a32ecd436341638d54ecb2df0778de681b4969241b

4 years agoFix another case where a corrupt record could cause an assert() to fail in fts3.
dan [Thu, 23 Jul 2020 13:45:47 +0000 (13:45 +0000)] 
Fix another case where a corrupt record could cause an assert() to fail in fts3.

FossilOrigin-Name: 28515bbbae4fbc260457dea7a0f7414be1837d6db27fec5514f8da358bfc1f0c

4 years agoMerge support for partial integrity checks.
drh [Thu, 23 Jul 2020 09:14:25 +0000 (09:14 +0000)] 
Merge support for partial integrity checks.

FossilOrigin-Name: b5443b47af95f4f0ef527bee90f186ee25faa5df197dbcc3e14d48eee095e4aa

4 years agoAdd the ability to do a PRAGMA integrity_check (or quick_check) on a single
drh [Thu, 23 Jul 2020 00:45:06 +0000 (00:45 +0000)] 
Add the ability to do a PRAGMA integrity_check (or quick_check) on a single
table by specifying the table name as the argument.

FossilOrigin-Name: 65dd321432e8f80bc1cb11be8ca06656b41ac997a74a5eb271c797cf0fbb764e

4 years agoDetect out-of-bounds rootpage values in the schema.
drh [Wed, 22 Jul 2020 21:11:10 +0000 (21:11 +0000)] 
Detect out-of-bounds rootpage values in the schema.

FossilOrigin-Name: e4a92688fca31335bf15933dec10ecba04cf340ee2f726fd36d46d4c76660eee

4 years agoDisable rootpage bounds checking when the SQLITE_TESTCTRL_EXTRA_SCHEMA_CHECKS rootpage-bounds-check
drh [Wed, 22 Jul 2020 21:05:23 +0000 (21:05 +0000)] 
Disable rootpage bounds checking when the SQLITE_TESTCTRL_EXTRA_SCHEMA_CHECKS
setting is off, to facilitate reaching obscure error states during testing.

FossilOrigin-Name: d7dd4fc464c791915f646b1ad228697d1fa16f530fc7d0e9aa702c8df3068c65

4 years agoImprovements to rootpage bounds checking during schema parse.
drh [Wed, 22 Jul 2020 20:12:10 +0000 (20:12 +0000)] 
Improvements to rootpage bounds checking during schema parse.

FossilOrigin-Name: 75599a9731be19e213a8ae174b038a43381bc6883a6b7f4058c2c1625fdea432

4 years agoWhen parsing the schema, detect out-of-bounds rootpage values and throw an
drh [Wed, 22 Jul 2020 18:03:56 +0000 (18:03 +0000)] 
When parsing the schema, detect out-of-bounds rootpage values and throw an
error.

FossilOrigin-Name: 6c3a2727dc912ed800146e07db5d15d0f3468d13701165ba763c4b114c3e18e8

4 years agoAll TCL tests now passing.
drh [Wed, 22 Jul 2020 17:12:59 +0000 (17:12 +0000)] 
All TCL tests now passing.

FossilOrigin-Name: 4c5f3c6cacf84a36d0347790d98d82d1f584cd1537a13a2736348405c4d20367

4 years agoMost test cases now passing.
drh [Wed, 22 Jul 2020 13:56:14 +0000 (13:56 +0000)] 
Most test cases now passing.

FossilOrigin-Name: 92e2ab38930c76811dbf5abfe6b9ea9e12562a4bb4bb06cdb0cf49ac30da0bc3

4 years agoContinuing work toward supporting unsigned 32-bit page numbers.
drh [Wed, 22 Jul 2020 13:38:04 +0000 (13:38 +0000)] 
Continuing work toward supporting unsigned 32-bit page numbers.

FossilOrigin-Name: 9ce1710aad43cebe5ad50859c7685fb83e40cdd4a60913bd2b7e659bc59942fd

4 years agoEnhance showdb to be 32-bit clean.
drh [Wed, 22 Jul 2020 11:42:50 +0000 (11:42 +0000)] 
Enhance showdb to be 32-bit clean.

FossilOrigin-Name: a8200327d4e8e78abef09c64345e0036f730fbbb20ae88935ef6c9972e6c7d5e

4 years agoMerge fixes from trunk.
drh [Wed, 22 Jul 2020 10:36:49 +0000 (10:36 +0000)] 
Merge fixes from trunk.

FossilOrigin-Name: d2aac001204621062e6cb3230ce2ac1b4545cb83b3ebb6bfebccee4d51162e97

4 years agoWork-around for [https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96270|GCC bug 96270].
drh [Tue, 21 Jul 2020 18:36:06 +0000 (18:36 +0000)] 
Work-around for [https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96270|GCC bug 96270].

FossilOrigin-Name: 9679c0c61131f0e986551701a64191da0ee0f50880eaa57fe4bf520e3fecf634

4 years agoAdd the sqlite3Int64ToText() routine and use it to convert integers to text,
drh [Tue, 21 Jul 2020 18:25:19 +0000 (18:25 +0000)] 
Add the sqlite3Int64ToText() routine and use it to convert integers to text,
as it is much faster than the generic text formatter.

FossilOrigin-Name: 14eed318aa9e6e16d1aa13a9f34e3822aa135c39ba06c77df7743509fed6c95e