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

4 years agoFix the ".read" command so that it gives an error when its argument is
drh [Mon, 20 Jul 2020 23:33:11 +0000 (23:33 +0000)] 
Fix the ".read" command so that it gives an error when its argument is
a directory.
See [https://sqlite.org/forum/forumpost/4c53c434ca|forum message 4c53c434ca].

FossilOrigin-Name: 6d258c3c7ecafa1114e4a63739971ff527580868659c2f2c47d2c0adb92c1453

4 years agoFix a corner-case error in the new UPDATE FROM logic helpfully discovered
drh [Mon, 20 Jul 2020 18:07:35 +0000 (18:07 +0000)] 
Fix a corner-case error in the new UPDATE FROM logic helpfully discovered
by OSSFuzz.

FossilOrigin-Name: 5cc200939d3a33566ddb858fc74c878acc72cfe5cf4c9b1d08e7b13e4d5ff566

4 years agoAdd the "enlargedb" utility program used to construct very large database
drh [Mon, 20 Jul 2020 14:54:36 +0000 (14:54 +0000)] 
Add the "enlargedb" utility program used to construct very large database
files for testing.

FossilOrigin-Name: 66858d87507bfdd17bb76c0afb1108ad5dec752438a79bf57f0f51690232e943

4 years agoFaster column name lookup in the columnIndex() routine using hashing.
drh [Mon, 20 Jul 2020 13:11:19 +0000 (13:11 +0000)] 
Faster column name lookup in the columnIndex() routine using hashing.

FossilOrigin-Name: de2a90812498e504c9b8eeb83bfc48a948b45e87bdfa242c0aa9f0377d90740f

4 years agoInitial changes to allow database up to 281TB in size.
drh [Mon, 20 Jul 2020 12:47:32 +0000 (12:47 +0000)] 
Initial changes to allow database up to 281TB in size.

FossilOrigin-Name: 9cb7da9bdb666ea40771513b89591dca275f1e92092b39190df747e3797178a3

4 years agoFix test case result on a DELETE with an INDEXED BY clause due to
drh [Sat, 18 Jul 2020 18:59:11 +0000 (18:59 +0000)] 
Fix test case result on a DELETE with an INDEXED BY clause due to
improvements in the query planner at [d901837fea1ed54d]

FossilOrigin-Name: 020dbfa2aef20e5872cc3e785d99f45903843401292114b5092b9c8aa829b9c3

4 years agoMore harmless compiler warning fixes.
drh [Sat, 18 Jul 2020 18:44:59 +0000 (18:44 +0000)] 
More harmless compiler warning fixes.

FossilOrigin-Name: 4c0d208c455abb983217a6dfea7634f677f8360fb57857e1421334fe7a5a23e2

4 years agoFix a harmless compiler warning.
drh [Sat, 18 Jul 2020 18:03:26 +0000 (18:03 +0000)] 
Fix a harmless compiler warning.

FossilOrigin-Name: 5a0b0c6e11146e200c3417903232e6932102b02d7bf128bac4b7cd74c257acd1

4 years agoAdd UPDATE FROM compatible with postgresql.
drh [Sat, 18 Jul 2020 15:52:15 +0000 (15:52 +0000)] 
Add UPDATE FROM compatible with postgresql.

FossilOrigin-Name: 88baf1eb0706503214012520be4d872594ccc5b4c9674c44cc07b67ade2bfcf2

4 years agoAdd ALWAYS() around a conditional that is always true. update-from
drh [Fri, 17 Jul 2020 22:20:23 +0000 (22:20 +0000)] 
Add ALWAYS() around a conditional that is always true.

FossilOrigin-Name: 270e17bba1d35f8c300844e75b2aa15f79a1ab62e40bc5e6bc9694902f8f7dde

4 years agoUse #ifdef to omit code that is only reachable when the
drh [Fri, 17 Jul 2020 18:07:36 +0000 (18:07 +0000)] 
Use #ifdef to omit code that is only reachable when the
SQLITE_ENABLE_UPDATE_DELETE_LIMIT compile-time option is used.

FossilOrigin-Name: 587ded6035a3ce91db81a29fe34ed30d0e59022cba6f107f25b04d034ef37ba9

4 years agoMake it an error to repeat the target object/alias of an UPDATE statement in its...
dan [Fri, 17 Jul 2020 16:31:37 +0000 (16:31 +0000)] 
Make it an error to repeat the target object/alias of an UPDATE statement in its FROM clause.

FossilOrigin-Name: d90a37e930c66afe95165955ae47efde08f52c8ce16c4fb239da0233335db050

4 years agoAdd a couple of "#ifdef SQLITE_ENABLE_UPDATE_DELETE_LIMIT" blocks missing from new...
dan [Fri, 17 Jul 2020 15:34:54 +0000 (15:34 +0000)] 
Add a couple of "#ifdef SQLITE_ENABLE_UPDATE_DELETE_LIMIT" blocks missing from new code on this branch.

FossilOrigin-Name: cc471df04aecf344d0aa47138014c07d3f93462ae1f8ff86ec5589cfb62c658d

4 years agoRelax pointless restrictions on allowing tables in the FROM clause from
drh [Thu, 16 Jul 2020 18:55:58 +0000 (18:55 +0000)] 
Relax pointless restrictions on allowing tables in the FROM clause from
crossing over LEFT JOINs, as long as the table being moved is not the
right table of the LEFT JOIN.

FossilOrigin-Name: c1ea064948ba08c4be209ad6efc2126a7367bcb06266ea35eb957bf2d4e2cb9f

4 years agoModifications to test code so that the sqlite3MemdebugHastype() assert() statements...
dan [Thu, 16 Jul 2020 14:52:24 +0000 (14:52 +0000)] 
Modifications to test code so that the sqlite3MemdebugHastype() assert() statements are enabled for Tcl tests.

FossilOrigin-Name: e3c423cb1407c06a3806ae6304e4713c37cd446f4cc399731884e3d009938e57

4 years agoSmall performance improvement and size reduction in sqlite3DbStrNDup().
drh [Thu, 16 Jul 2020 14:19:57 +0000 (14:19 +0000)] 
Small performance improvement and size reduction in sqlite3DbStrNDup().

FossilOrigin-Name: 35cd87063d1933b87bc2176f957ecd758d7d167e9473fa615e33caec3be14783

4 years agoAdd OOM test for UPDATE...FROM statements inside triggers.
dan [Thu, 16 Jul 2020 10:48:37 +0000 (10:48 +0000)] 
Add OOM test for UPDATE...FROM statements inside triggers.

FossilOrigin-Name: 917a479b0d11fb59abf41d0317ffc541eb4b83928df9382b4782953c0035fa3e

4 years agoFix a double-free of the FROM clause of an UPDATE inside of triggers.
drh [Thu, 16 Jul 2020 02:36:24 +0000 (02:36 +0000)] 
Fix a double-free of the FROM clause of an UPDATE inside of triggers.

FossilOrigin-Name: 706c8da2f6d9299f0ad3b3c93332b38071e8e88b4d1660c1841309919b64fd18

4 years agoSeparate VdbeCoverage() macro for different jumps.
drh [Thu, 16 Jul 2020 00:45:25 +0000 (00:45 +0000)] 
Separate VdbeCoverage() macro for different jumps.

FossilOrigin-Name: da593e57df042527decfea68baacc72d463728544cab81c70fbb25839791f706

4 years agoFix a problem in UPDATE FROM in which it tries to free using sqlite3_free()
drh [Wed, 15 Jul 2020 21:53:53 +0000 (21:53 +0000)] 
Fix a problem in UPDATE FROM in which it tries to free using sqlite3_free()
instead of sqlite3DbFree().

FossilOrigin-Name: 8ca87526523a985674fed5a8770726587b3a2e48d65721916902063ab5dba49c

4 years agoSupport a FROM clause in UPDATE statements, as postgres does.
dan [Wed, 15 Jul 2020 20:01:07 +0000 (20:01 +0000)] 
Support a FROM clause in UPDATE statements, as postgres does.

FossilOrigin-Name: 7d7d5ecbd70cc39ab7a641ae26af0d3b69d5cb02e626b620102a6e19e7d8a577

4 years agoAdd tests for UPDATE...FROM and foreign keys.
dan [Wed, 15 Jul 2020 19:38:49 +0000 (19:38 +0000)] 
Add tests for UPDATE...FROM and foreign keys.

FossilOrigin-Name: 6c3668f9ed898337e664bec95865f15688a6bba43f095358dda5d08abef2bbaa

4 years agoFix problems that could occur if a table with the same name as the table being update...
dan [Wed, 15 Jul 2020 18:30:01 +0000 (18:30 +0000)] 
Fix problems that could occur if a table with the same name as the table being updated appeared in the FROM clause of an UPDATE statement.

FossilOrigin-Name: 13224cbd75990615088f3e30ccba05d31b3099fae4300c9ab8f7663bc5f0eb6f

4 years agoFix a problem in SQLITE_ENABLE_HIDDEN_COLUMN builds occuring when an UPDATE...FROM...
dan [Wed, 15 Jul 2020 15:32:59 +0000 (15:32 +0000)] 
Fix a problem in SQLITE_ENABLE_HIDDEN_COLUMN builds occuring when an UPDATE...FROM fired an INSTEAD OF trigger.

FossilOrigin-Name: 5176cb7a6a4e8cfa1973aaae46fcd7d39baedb70ae20bfacc82d62ca39fb0aa3

4 years agoUpdate this branch with changes from trunk.
dan [Wed, 15 Jul 2020 11:00:29 +0000 (11:00 +0000)] 
Update this branch with changes from trunk.

FossilOrigin-Name: 53b8b507a10364f5d580655d89c950a5f14c2a8114625fd8749d77f289413b22

4 years agoNew test cases for decimal and ieee754.
drh [Wed, 15 Jul 2020 02:15:03 +0000 (02:15 +0000)] 
New test cases for decimal and ieee754.

FossilOrigin-Name: 73d62f82f94347c60e026bc9cb859fec2d8b5f0c756df0c4941f11817234bff8

4 years agoImprovements to the min()/max() optimization so that it is able to use
drh [Tue, 14 Jul 2020 23:58:04 +0000 (23:58 +0000)] 
Improvements to the min()/max() optimization so that it is able to use
indexes where terms are constrained by IN operators.

FossilOrigin-Name: b8ba2f17f938c03543a89dd29d6987163f7a4085a51de1aa14ea5504501c4f72