]> git.ipfire.org Git - thirdparty/sqlite.git/log
thirdparty/sqlite.git
3 years agoMerge 3.37.2 changes into the begin-concurrent-pnu branch. begin-concurrent-3.37
drh [Fri, 7 Jan 2022 14:09:33 +0000 (14:09 +0000)] 
Merge 3.37.2 changes into the begin-concurrent-pnu branch.

FossilOrigin-Name: e525892d3dcdd9914000b169ddab2cf651d7f9bcd5ff4d8a74f591e017149985

3 years agoVersion 3.37.2 version-3.37.2
drh [Thu, 6 Jan 2022 13:25:41 +0000 (13:25 +0000)] 
Version 3.37.2

FossilOrigin-Name: 872ba256cbf61d9290b571c0e6d82a20c224ca3ad82971edc46b29818d5d17a0

3 years agoRemove two NEVER() macros that can sometimes be true if the database is
drh [Wed, 5 Jan 2022 21:08:48 +0000 (21:08 +0000)] 
Remove two NEVER() macros that can sometimes be true if the database is
corrupt.  dbsqlfuzz 0414d2c18290fc80fd5fb540def7d3e46c1ae9c6.

FossilOrigin-Name: e1871201e73c1d970f0434d3c7190da2c1c49ded3a359640d959ec0c0450b8ed

3 years agoIncrease the version number to 3.37.2
drh [Wed, 5 Jan 2022 18:56:59 +0000 (18:56 +0000)] 
Increase the version number to 3.37.2

FossilOrigin-Name: 7b911356af8f985eefdb190e1205933eaa0bef35e5d755b279514e7b96f9d0c4

3 years agoFix an assert() failure that could follow an OOM when coding a RETURNING trigger...
drh [Wed, 5 Jan 2022 16:02:23 +0000 (16:02 +0000)] 
Fix an assert() failure that could follow an OOM when coding a RETURNING trigger. dbsqlfuzz case 5d3e2438f15dc32b473d9f29413157857efa1212.

FossilOrigin-Name: 93965e67e2478fc99d7abfd6790edac353358373873bb6ac82c7c65dbe52a5de

3 years agoImproved handling of OOM errors in sqlite3ExpandReturning().
drh [Wed, 5 Jan 2022 12:01:34 +0000 (12:01 +0000)] 
Improved handling of OOM errors in sqlite3ExpandReturning().
dbsqlfuzz 1040b720f0bbc3bdcfe7336acffbf71517e3ef82.

FossilOrigin-Name: b9ed2a2921a8f3f07a3a2c9b954806df924b3806795ab876bbbda28578175288

3 years agoDo not open a rollback journal file when the journal_mode is OFF, even if
drh [Sun, 2 Jan 2022 19:43:58 +0000 (19:43 +0000)] 
Do not open a rollback journal file when the journal_mode is OFF, even if
such a file exists on disk. See
[forum/forumpost/ec2a102440|forum post ec2a102440] for a description.  I so
far have been unable to find any harm to come of the problem, other than the
assertion fault when in DEBUG mode.

FossilOrigin-Name: 71f21f172cbc033f70604d166f17118472491fcf8b78350bd347de016132b464

3 years agoClear the cache of triggers used to implement CASCADE foreign key constraints
drh [Sun, 2 Jan 2022 18:10:48 +0000 (18:10 +0000)] 
Clear the cache of triggers used to implement CASCADE foreign key constraints
whenever the schema changes.  Fix for the problem identified by
[forum:/forumpost/2831335356|forum post 2831335356].

FossilOrigin-Name: 4f1313c67f8c3025ed15793e370617d14e950c13217f179bfb01f8f48fbbead9

3 years agoEarlier detection of corruption in sqlite3BtreeDelete(). Fix for
drh [Sun, 2 Jan 2022 17:46:49 +0000 (17:46 +0000)] 
Earlier detection of corruption in sqlite3BtreeDelete().  Fix for
the assertion fault reported by
[forum:/forumpost/9d78389221|forum post 9d78389221].

FossilOrigin-Name: eb07219965721e0a2017d0462747b07178c23f51e3333036e0cb8f5b4751f404

3 years agoDo not raise an SQLITE_SCHEMA error if in sqlite3Init(). Fix for PoC #2 in
drh [Sun, 2 Jan 2022 17:37:56 +0000 (17:37 +0000)] 
Do not raise an SQLITE_SCHEMA error if in sqlite3Init().  Fix for PoC #2 in
[forum:/forumpost/b03d86f951|forum post b03d86f951].  See TH3 for test
cases.

FossilOrigin-Name: 25beca31cf3dbad0e78085c5ceed797a461cfaddc2d41fb7a093aa27098e50d5

3 years agoFix an obscure problem with releasing savepoints stored in an in-memory journal that...
drh [Sun, 2 Jan 2022 17:24:29 +0000 (17:24 +0000)] 
Fix an obscure problem with releasing savepoints stored in an in-memory journal that could cause subsequent savepoint rollback to fail.

FossilOrigin-Name: 3c0806e4df3ba795962b0111236b2b6f27f63a35a02055c251f750ef02622803

3 years agoRemove an obsolete assert() statement that no longer does anything useful
drh [Sun, 2 Jan 2022 17:14:39 +0000 (17:14 +0000)] 
Remove an obsolete assert() statement that no longer does anything useful
and which is not always true.  Fix for PoC #1 of
[forum:/forumpost/b03d86f951|forum post b03d86f951].

FossilOrigin-Name: 0829c1001bcfadf0d0af2b2c2e01ed60b24156b7c4e7c49cb29f3002ce8e36db

3 years agoFix a faulty assert() statement - adding a CORRUPT_DB term - based on a test
drh [Sun, 2 Jan 2022 17:13:36 +0000 (17:13 +0000)] 
Fix a faulty assert() statement - adding a CORRUPT_DB term - based on a test
case derived from [562805cf488a455c].  Also add a test case to that prior
issue.

FossilOrigin-Name: f9505fcb28d05ac2319a56d936f840b8de502a49dda16ded8b7ed9dd9dffe509

3 years agoFix harmless compiler warnings seen with MSVC.
drh [Sun, 2 Jan 2022 17:02:54 +0000 (17:02 +0000)] 
Fix harmless compiler warnings seen with MSVC.

FossilOrigin-Name: 6e08a542ad6af7032e5badcdd50a8ed95c07bf7b15ae2b62334376b75a2e9731

3 years agoMove the pTriggerPrg and pCleanup elements of the Parse object up into the
drh [Sun, 2 Jan 2022 17:00:19 +0000 (17:00 +0000)] 
Move the pTriggerPrg and pCleanup elements of the Parse object up into the
section of that object that is persisted across calls to sqlite3NestedParse().
This fixes a memory leak
[forum:/info/24bd1fef7e9323ef|reported in forum post 24bd1fef7e9323ef].

FossilOrigin-Name: ee8b2397a67c14badb836570f815ca6c59f6936100669adafe815d7cb997cb43

3 years agoVersion 3.37.1 version-3.37.1
drh [Thu, 30 Dec 2021 15:30:28 +0000 (15:30 +0000)] 
Version 3.37.1

FossilOrigin-Name: 378629bf2ea546f73eee84063c5358439a12f7300e433f18c9e1bddd948dea62

3 years agoDisable the atoi1.test test module on non-x64 hardware.
drh [Thu, 30 Dec 2021 12:26:16 +0000 (12:26 +0000)] 
Disable the atoi1.test test module on non-x64 hardware.

FossilOrigin-Name: 986a94d036f029539c3bb3873096f4a85ee26fc674f56856c57ca3dfd3bd0f37

3 years agoFix windowC tests to specify little-endian or big-endian UTF16, for cross-platform...
drh [Thu, 30 Dec 2021 11:35:38 +0000 (11:35 +0000)] 
Fix windowC tests to specify little-endian or big-endian UTF16, for cross-platform portability. [forum post 559b84a5c6|forum:/forumpost/559b84a5c6].  And
give the correct prefix to tests in the windowC.test module.

FossilOrigin-Name: 8af7cb2a3e7ca778695a7a44359537457bf57dc8bdad9b2b4d20a73385c028d8

3 years agoDo not attempt to reprepare a prepared statement that returns SQLITE_SCHEMA
drh [Thu, 30 Dec 2021 11:27:53 +0000 (11:27 +0000)] 
Do not attempt to reprepare a prepared statement that returns SQLITE_SCHEMA
if there was an OOM.  This enhancement supercedes check-in
[fee469925231d074].

FossilOrigin-Name: 103f95db3e17d7d021b489c160b84e66c630b4f13516be11d10fffe2b42599fa

3 years agoChange an assert() in FTS3 into assert_fts3_nc(), since it is a harmless
drh [Thu, 30 Dec 2021 11:13:44 +0000 (11:13 +0000)] 
Change an assert() in FTS3 into assert_fts3_nc(), since it is a harmless
condition that can occur when processing a corrupt database file.

FossilOrigin-Name: 35e2b27af7242a3f74b31e0e25a0ea892f6aec66341b9194c0f5957f9d1926bc

3 years agoFix a minor issue in the configure script.
drh [Thu, 30 Dec 2021 03:56:30 +0000 (03:56 +0000)] 
Fix a minor issue in the configure script.

FossilOrigin-Name: 0413d37e327525d7747d9f9643eb73197a83d9e810bcdc3e0cd35762a94ba22b

3 years agoFollowing a prior error, an ALWAYS() in sqlite3ExprCanBeNull() might be false.
drh [Thu, 30 Dec 2021 03:22:21 +0000 (03:22 +0000)] 
Following a prior error, an ALWAYS() in sqlite3ExprCanBeNull() might be false.
dbsqlfuzz 5dbec6678a20e7595a34dfdd869a3b9722b3ca43.

FossilOrigin-Name: b33e47709a2eb56b543ee3a34af201cd05e316bde8dcf45cebcf4e157d728508

3 years agoWhen a table has an INTEGER PRIMARY KEY ON CONFLICT REPLACE and some other
drh [Thu, 30 Dec 2021 03:12:37 +0000 (03:12 +0000)] 
When a table has an INTEGER PRIMARY KEY ON CONFLICT REPLACE and some other
uniqueness constraint, and it participates in an upsert on that other
constraint, ensure that code that checks for conflicts on the INTEGER PRIMARY
KEY is well-formed.  Fix for the problem reported by
[forum:/forumpost/06b16b8b29f8c8c3|forum post 06b16b8b29f8c8c3].

FossilOrigin-Name: 1f1e0b4e6d3a63fecaef8fafc8374ff17cff6d7af4c03994fa245e9953ee42cb

3 years agoFix an OOB read that could occur in fts5 when processing corrupt records.
drh [Mon, 6 Dec 2021 19:03:56 +0000 (19:03 +0000)] 
Fix an OOB read that could occur in fts5 when processing corrupt records.

FossilOrigin-Name: 734606ea1a42c2e31ea62c114f2480b52182114b6bd87eb2f1145a171daad80f

3 years agoDo not allow SQLITE_LIMIT_LENGTH to be set lower than 1 as an
drh [Mon, 6 Dec 2021 16:56:06 +0000 (16:56 +0000)] 
Do not allow SQLITE_LIMIT_LENGTH to be set lower than 1 as an
SQLITE_LIMIT_LENGTH of 0 causes lots of unnecessary problems for
users of the sqlite3_str object.

FossilOrigin-Name: 286243f3a49f721b2ed5b278738e9edd8ca0f190abdbec645866bce97fcc7d04

3 years agoDo not allow certain dangerous ".testctrl" commands in safe mode.
drh [Mon, 6 Dec 2021 16:51:03 +0000 (16:51 +0000)] 
Do not allow certain dangerous ".testctrl" commands in safe mode.

FossilOrigin-Name: 4602644f858eb3b55fec0ead1de58de1f60cb85165cbb309bfe6bb136099a895

3 years agoFix SQLITE_TESTCTRL_IMPOSTER so that it is a harmless no-op if the schema
drh [Mon, 6 Dec 2021 16:42:31 +0000 (16:42 +0000)] 
Fix SQLITE_TESTCTRL_IMPOSTER so that it is a harmless no-op if the schema
parameter is invalid.

FossilOrigin-Name: b15c553c2ca3143c269e25f41e1a4e6c00f72a89e4b0a382260620567f159081

3 years agoIn the shell tool, avoid modifying internal data structures until after the arguments...
drh [Mon, 6 Dec 2021 16:36:37 +0000 (16:36 +0000)] 
In the shell tool, avoid modifying internal data structures until after the arguments to ".open" have been parsed.

FossilOrigin-Name: cbd69ed8afd3facda39fe8c81a3e8e4a1928923bcfd93e99d1bb8b3868ef3e5b

3 years agoStart a new branch on which to cherrypick fixes against 3.37.0.
drh [Mon, 6 Dec 2021 16:29:53 +0000 (16:29 +0000)] 
Start a new branch on which to cherrypick fixes against 3.37.0.

FossilOrigin-Name: cea9e41aaee9b43496909fa2ba80dddaee1dd77d44bcb4d8d38034d1b003d762

3 years agoMerge version 3.37.0 into the begin-concurrent-pnu branch. begin-concurrent-pnu
drh [Sat, 27 Nov 2021 14:48:36 +0000 (14:48 +0000)] 
Merge version 3.37.0 into the begin-concurrent-pnu branch.

FossilOrigin-Name: 910001f28368896c3e6f11bb6ced3ec3171dcafefd9e6702106b32f3c451e229

3 years agoVersion 3.37.0 version-3.37.0
drh [Sat, 27 Nov 2021 14:13:22 +0000 (14:13 +0000)] 
Version 3.37.0

FossilOrigin-Name: bd41822c7424d393a30e92ff6cb254d25c26769889c1499a18a0b9339f5d6c8a

3 years agoFix a harmless comment typo.
drh [Sat, 27 Nov 2021 12:03:51 +0000 (12:03 +0000)] 
Fix a harmless comment typo.

FossilOrigin-Name: 7c567338ae4dd31097e9ae5c693b84369c35c5a52534797e8186b4be7297ba78

3 years agoAdd platform "Darwin-arm64" to test/releasetest_data.tcl.
drh [Fri, 26 Nov 2021 20:26:37 +0000 (20:26 +0000)] 
Add platform "Darwin-arm64" to test/releasetest_data.tcl.

FossilOrigin-Name: 1d5c9aacb8ab6349935561cc12734cf348c12c86e4663ddc7af113b3ed0f6186

3 years agoImproved defenses against integer overflow when computing the size of a
drh [Fri, 26 Nov 2021 17:10:18 +0000 (17:10 +0000)] 
Improved defenses against integer overflow when computing the size of a
memory allocations.  No bugs were fixed here.  But perhaps future bugs will
be prevented.

FossilOrigin-Name: eb878c01f317f09e8ef6b1bd2ec8d6d5cd6ce0bdfe9da7fa7d92d2047cc9d9e4

3 years agoFixes to internal comments. No changes to code or documentation.
drh [Fri, 26 Nov 2021 15:08:55 +0000 (15:08 +0000)] 
Fixes to internal comments.  No changes to code or documentation.

FossilOrigin-Name: 1489b196ce82cddf7360aff6c89219ca25e666187f0f5ff6419ba3b504cdef8d

3 years agoAvoid splitting Failure-Detection test cases in wapptest.tcl.
dan [Wed, 24 Nov 2021 21:16:32 +0000 (21:16 +0000)] 
Avoid splitting Failure-Detection test cases in wapptest.tcl.

FossilOrigin-Name: 654e6cf8ab493d48b1827bb8100d4e4366a8e889e647c233a9b1b1278a7133d0

3 years agoUpdate Makefile.msc to support target "tcltest" in the same way as the autoconf build...
dan [Wed, 24 Nov 2021 11:33:01 +0000 (11:33 +0000)] 
Update Makefile.msc to support target "tcltest" in the same way as the autoconf build system.

FossilOrigin-Name: 0f131b92252afc95c8c2d160d4be9ac2a737a610ee355efcd819f1af3bae3c56

3 years agoChanges a test pattern for RBU so that it works regardless of whether newer
drh [Tue, 23 Nov 2021 22:28:09 +0000 (22:28 +0000)] 
Changes a test pattern for RBU so that it works regardless of whether newer
TCL versions are used.

FossilOrigin-Name: 5a9921c92ade9e13c3e49c50325c96e3264f3ad352a187387a960783a68bc9d3

3 years agoFix a compiler warning in the dbserialize method of the TCL interface.
drh [Tue, 23 Nov 2021 12:59:25 +0000 (12:59 +0000)] 
Fix a compiler warning in the dbserialize method of the TCL interface.

FossilOrigin-Name: ba71d030fef4cd4251dc882acc6897dbf9aaba498652900c491b082add87404f

3 years agoExclude two recently added tests in where.test from valgrind runs. They fail due...
dan [Tue, 23 Nov 2021 11:34:43 +0000 (11:34 +0000)] 
Exclude two recently added tests in where.test from valgrind runs. They fail due to the subtly different handling of real numbers under valgrind.

FossilOrigin-Name: e842d2085b295ef1c927611f5d3b211fb6b513ca2676c074fe90331da81734eb

3 years agoOmit wal mode tests in memdb1.test for builds and configurations that do not support...
dan [Mon, 22 Nov 2021 16:50:41 +0000 (16:50 +0000)] 
Omit wal mode tests in memdb1.test for builds and configurations that do not support wal mode.

FossilOrigin-Name: 0f13c0d9fd7757c6e0b845a285c0047d2c60293354335660d19d80ad799646fc

3 years agoOmit wal mode tests in vacuum-into.test for builds and configurations that do not...
dan [Mon, 22 Nov 2021 16:48:42 +0000 (16:48 +0000)] 
Omit wal mode tests in vacuum-into.test for builds and configurations that do not support wal mode.

FossilOrigin-Name: 65de17635468791678b9d205552a4faec2d6c3b7d330c559b6f81ab072254533

3 years agoDo not attempt to run the tests in alterfault.est with SQLITE_OMIT_ALTERTABLE builds.
dan [Mon, 22 Nov 2021 16:43:53 +0000 (16:43 +0000)] 
Do not attempt to run the tests in alterfault.est with SQLITE_OMIT_ALTERTABLE builds.

FossilOrigin-Name: 6f6f31c7df6831af28a24e69f744beeade739bb7bbb0810d5bbe592e4cd75e3d

3 years agoFix a typo in memdb1.test preventing tests from passing with -DSQLITE_DEFAULT_AUTOVAC...
dan [Mon, 22 Nov 2021 16:27:36 +0000 (16:27 +0000)] 
Fix a typo in memdb1.test preventing tests from passing with -DSQLITE_DEFAULT_AUTOVACUUM=1 builds.

FossilOrigin-Name: eff4187c50790827d05bb28867cc6546196e7eee3b4c4de54b4e68bfb4e2830e

3 years agoMerge the latest trunk enhancements into the begin-concurrent-pnu branch.
drh [Mon, 22 Nov 2021 16:27:23 +0000 (16:27 +0000)] 
Merge the latest trunk enhancements into the begin-concurrent-pnu branch.

FossilOrigin-Name: aa045e7b09ee47fb281579178add904fffc2299b05cfc67cf872ec3caaffd69b

3 years agoThere are two possible error messages from stat-9.1, depending on
drh [Mon, 22 Nov 2021 16:06:57 +0000 (16:06 +0000)] 
There are two possible error messages from stat-9.1, depending on
compile-time options.  Adjust the test case to accept either one.

FossilOrigin-Name: 0f567b61072e214c40cae1441889f83622a975f429b41803dfbed687718731c8

3 years agoIn fuzzcheck, improve the defense against long delays due to
drh [Mon, 22 Nov 2021 13:59:06 +0000 (13:59 +0000)] 
In fuzzcheck, improve the defense against long delays due to
rogue busy_timeout macros in fuzzer-generated scripts.

FossilOrigin-Name: 3024d7ca03541a6fe3d264fdc82dd49f8f6b51d2fbeec4dfc9c6dd72806b271a

3 years agoFix the build for SQLITE_OMIT_CTE.
drh [Mon, 22 Nov 2021 13:35:40 +0000 (13:35 +0000)] 
Fix the build for SQLITE_OMIT_CTE.

FossilOrigin-Name: d7ef96bae459f800241483fe8784552d18ee7f92f408f6453ac687de5530bbb9

3 years agoIn the previous check-in, do not overwrite the SQLITE_CORRUPT signal with
drh [Mon, 22 Nov 2021 12:59:44 +0000 (12:59 +0000)] 
In the previous check-in, do not overwrite the SQLITE_CORRUPT signal with
an SQLITE_OK before exiting fts3auxNextMethod().

FossilOrigin-Name: 396688ae5c10b9e7df1c76a3c6f548abf7a7ddad50c25fb23e194201dbb2e857

3 years agoFix a crash in the fts3aux code that could occur handling corrupt records.
dan [Mon, 22 Nov 2021 08:12:14 +0000 (08:12 +0000)] 
Fix a crash in the fts3aux code that could occur handling corrupt records.

FossilOrigin-Name: cdcd65b89ecffd380483404f5b1379beffd7ff107acaa5bc1185651cfacaa220

3 years agoNew test cases for STRICT and NOT NULL in PRIMARY KEY.
drh [Sat, 20 Nov 2021 13:30:03 +0000 (13:30 +0000)] 
New test cases for STRICT and NOT NULL in PRIMARY KEY.

FossilOrigin-Name: 0eafbc2f31b83f48833b19894ff3252a63c319ff501506ef9f744cca813a3a24

3 years agoSmall performance increase and size reduction for sqlite3ExprCompare().
drh [Fri, 19 Nov 2021 19:11:58 +0000 (19:11 +0000)] 
Small performance increase and size reduction for sqlite3ExprCompare().
This change also handles some corner cases without the need for ALWAYS().

FossilOrigin-Name: d814ba6effc7c5b021ff625b57371627f3ee326687c508da99f78bc164386b7e

3 years agoFix a benign data race in os_unix.c that might trouble tsan and similar tools.
dan [Fri, 19 Nov 2021 14:02:43 +0000 (14:02 +0000)] 
Fix a benign data race in os_unix.c that might trouble tsan and similar tools.

FossilOrigin-Name: 95806ac1dabe4598170061d903ae30f09bafac149ff6696963a7e056ac846cdb

3 years agoMinor tweaks to the way auxiliary tools are built, to make it easier to
drh [Thu, 18 Nov 2021 20:56:59 +0000 (20:56 +0000)] 
Minor tweaks to the way auxiliary tools are built, to make it easier to
customize the builds without having to alter the code.

FossilOrigin-Name: 90b06b6f42918852cfb15258be462c6bed260c6a618b86fa9084bac72fa2f58f

3 years agoFix a performance regression in rtree introduced by the previous commit.
dan [Thu, 18 Nov 2021 20:11:31 +0000 (20:11 +0000)] 
Fix a performance regression in rtree introduced by the previous commit.

FossilOrigin-Name: 7f42b8e1a25c0830fe81e4668318998af595826784a50780a5c1c0b4d95a2482

3 years agoFix a problem slowing down the handling of == constraints in the rtree module.
dan [Thu, 18 Nov 2021 19:15:40 +0000 (19:15 +0000)] 
Fix a problem slowing down the handling of == constraints in the rtree module.

FossilOrigin-Name: 509027e964f28efca088a41fe32f01c38316f7a919de63a8835e3bc7c3fb0787

3 years agoImprove CSV quoting in the CLI using the strstr() function.
drh [Thu, 18 Nov 2021 15:40:05 +0000 (15:40 +0000)] 
Improve CSV quoting in the CLI using the strstr() function.

FossilOrigin-Name: b7927bf91049c903730a280484bbcdcdedc259a31fbcc3d3b0c7d046ec321633

3 years agoFix an obscure problem associated with quoting of CSV output in the CLI.
drh [Thu, 18 Nov 2021 13:25:31 +0000 (13:25 +0000)] 
Fix an obscure problem associated with quoting of CSV output in the CLI.

FossilOrigin-Name: 38a9b660214c06aa6650c6bb11a429a8c74c09f1e0e5c18d691e36de4af7af71

3 years agoFix a problem causing an OOM within an ALTER TABLE ADD COLUMN command that adds a...
dan [Tue, 16 Nov 2021 13:36:50 +0000 (13:36 +0000)] 
Fix a problem causing an OOM within an ALTER TABLE ADD COLUMN command that adds a column with a CHECK constraint to go unreported.

FossilOrigin-Name: a33f5e93ecb7d84291f6fecc7b60f0c555034aa47e24584c63c78d8a94710d82

3 years agoStrengthen the sticky-CORRUPT idea of check-in [3feb0f1c3840904d] by
drh [Mon, 15 Nov 2021 19:10:13 +0000 (19:10 +0000)] 
Strengthen the sticky-CORRUPT idea of check-in [3feb0f1c3840904d] by
automatically changing the first COMMIT after an SQLITE_CORRUPT error into
a ROLLBACK.

FossilOrigin-Name: bd66ab8a1bc3c43a57c7caff5f54545b0feb0177f1f51492f30d308c123c43ba

3 years agoSmall performance optimization in sqlite3VdbeHalt().
drh [Mon, 15 Nov 2021 18:50:02 +0000 (18:50 +0000)] 
Small performance optimization in sqlite3VdbeHalt().

FossilOrigin-Name: 9e1ecf438cb01d3d76950bcce1b3e4df29bedbb8176c8cede27e66f8e53e2098

3 years agoFix a problem causing the count(*) optimization to be misapplied in some cases where...
dan [Mon, 15 Nov 2021 14:11:23 +0000 (14:11 +0000)] 
Fix a problem causing the count(*) optimization to be misapplied in some cases where an aggregate sub-query uses a count() expression that is aggregated against the outer query.

FossilOrigin-Name: e30917278c0ec750b1756ddc5e32d65c55464531d6ef64d2e72a412dfe634f58

3 years agoImproved context shown for the "ABORT-due-to-error" output line when using
drh [Mon, 15 Nov 2021 13:22:42 +0000 (13:22 +0000)] 
Improved context shown for the "ABORT-due-to-error" output line when using
"PRAGMA vdbe_debug=on" in an SQLITE_DEBUG build.

FossilOrigin-Name: c7776369bcd0dbeb418b14d5dc681a81ee426234cc3f4f79a3c899d7892e1560

3 years agoFix a faulty JSON assert() added 30 days ago by check-in [7b8ea2298927fd34].
drh [Mon, 15 Nov 2021 01:45:11 +0000 (01:45 +0000)] 
Fix a faulty JSON assert() added 30 days ago by check-in [7b8ea2298927fd34].
dbsqlfuzz f30366e7b02562398a387ddcc681422fd4251190.

FossilOrigin-Name: 0e0c23fcc493a5d6beb6ab9554981bbc36ba1554fea0f8ba78dc41738f4bd1c2

3 years agoImproved handling of OOM while reallocating a column name to add type
drh [Fri, 12 Nov 2021 14:39:49 +0000 (14:39 +0000)] 
Improved handling of OOM while reallocating a column name to add type
information.  dbsqlfuzz 5a195b4233649e49e0aa34f1b743ca192d85b198

FossilOrigin-Name: 5995dd4de4997c43b43befc1281ef6378f33f781134c7f368299d64db2344f1d

3 years agoMake sure the rowid value returned by the VUpdate opcode is always initialized.
drh [Thu, 11 Nov 2021 23:52:44 +0000 (23:52 +0000)] 
Make sure the rowid value returned by the VUpdate opcode is always initialized.

FossilOrigin-Name: 150b5be5d5771485f521e3a58312596ecdcd35f3a0ae9d42d88bb99348a197c4

3 years agoRemove a NEVER() that was add yesterday. The fuzzer found a new test case
drh [Thu, 11 Nov 2021 16:26:46 +0000 (16:26 +0000)] 
Remove a NEVER() that was add yesterday.  The fuzzer found a new test case
to make it happen.

FossilOrigin-Name: 83e6ac71073edfa0cd73788c30bdd5f09cb04c8a6a7d5123123dbcd354f430b8

3 years agoNew assert() statements to help prove correct usage of VdbeCursor objects.
drh [Thu, 11 Nov 2021 11:23:08 +0000 (11:23 +0000)] 
New assert() statements to help prove correct usage of VdbeCursor objects.

FossilOrigin-Name: 7cee62f77a9e7c3cf886f136e75a93c3bbbb88e48b66035883bea5503d9fc03c

3 years agoLoad new test cases into test/fuzzdata8.db
drh [Wed, 10 Nov 2021 15:23:00 +0000 (15:23 +0000)] 
Load new test cases into test/fuzzdata8.db

FossilOrigin-Name: 8b53ffe99df6f5443bd22a9d95433819eb44c7e8f044c2f3e9d52661741d5612

3 years agoMake SQLITE_CORRUPT sticky: If a CORRUPT error is returned, all subsequent
drh [Wed, 10 Nov 2021 10:59:10 +0000 (10:59 +0000)] 
Make SQLITE_CORRUPT sticky:  If a CORRUPT error is returned, all subsequent
write statements within the same transaction also fail early with
SQLITE_CORRUPT.

FossilOrigin-Name: 3feb0f1c3840904d28fc9a61262820e2b9b764addc1dd178aecc2cd0f952042c

3 years agoMerge all recent trunk enhancements into the begin-concurrent-pnu branch.
drh [Tue, 9 Nov 2021 15:26:28 +0000 (15:26 +0000)] 
Merge all recent trunk enhancements into the begin-concurrent-pnu branch.

FossilOrigin-Name: b9802d0b479ee910b7f50ea7995776040ec183ecbdc44fc00086154fb819ef12

3 years agoChange test case error message text to match the current implementation.
drh [Tue, 9 Nov 2021 13:31:42 +0000 (13:31 +0000)] 
Change test case error message text to match the current implementation.

FossilOrigin-Name: de10795a1cf70925088e9652998e813665b2e147ffa4a4edab18c7e2c66bf5ae

3 years agoFix lempar.c so that Lemon can compile with NDEBUG defined.
drh [Tue, 9 Nov 2021 01:48:15 +0000 (01:48 +0000)] 
Fix lempar.c so that Lemon can compile with NDEBUG defined.
[forum:/forumpost/f331adca0b|Forum post f331adca0b]

FossilOrigin-Name: ba4fb51853fbcb8c142a350b4db0d59153f28ba0a63ad9a2d6fea7096d3dd544

3 years agoRefactor the code that figures out which SELECT in a cascade of nested queries
drh [Mon, 8 Nov 2021 23:24:00 +0000 (23:24 +0000)] 
Refactor the code that figures out which SELECT in a cascade of nested queries
a particular aggregate function belongs to.  This fixes the problem
reported by [forum:/forumpost/c7cc2aa3546e39c1|forum post c7cc2aa3546e39c1].
New test cases in dbsqlfuzz and th3.

FossilOrigin-Name: 74aec5dd1df95b5635f4da1f13753f113ea1d61de3dc3a1523ba51089c1900e4

3 years agoFix the zeroblob() function and related APIs so that they work with SQLITE_OMIT_INCRB...
dan [Mon, 8 Nov 2021 19:35:26 +0000 (19:35 +0000)] 
Fix the zeroblob() function and related APIs so that they work with SQLITE_OMIT_INCRBLOB builds.

FossilOrigin-Name: bc401a75dd9f3c29c5969ae36264e68ccefc0937e44e232ca1f6b550f7fd6e22

3 years agoFix an assert() in memdbTruncate() that could fail when processing a corrupt database.
dan [Mon, 8 Nov 2021 15:46:08 +0000 (15:46 +0000)] 
Fix an assert() in memdbTruncate() that could fail when processing a corrupt database.

FossilOrigin-Name: b1e2929860557cf88f98f0a4f2472e1a16be126bbb8050f0d728350f0cfe987a

3 years agoEnsure that the window function rewrite does not leave the parse tree
drh [Sun, 7 Nov 2021 23:33:01 +0000 (23:33 +0000)] 
Ensure that the window function rewrite does not leave the parse tree
in an invalid state that might cause problems downstream before the
error is recognized and unwinds the stack.  Also take steps such that
an invalid parse tree does not cause problems even if it goes
unrecognized.
[forum:/forumpost/398e9d5aa9|Forum post 398e9d5aa9].

FossilOrigin-Name: 0f9fc6b6073365d5159cd71e7fe08f8dadbc7b42abd324361e809502f4359155

3 years agoAdd ALWAYS() to a branch made unreachable by the previous check-in.
drh [Sat, 6 Nov 2021 20:25:29 +0000 (20:25 +0000)] 
Add ALWAYS() to a branch made unreachable by the previous check-in.

FossilOrigin-Name: 0dc963f63aebc42960125f96865029f16b3f6867126aab350da12882505edb82

3 years agoReturn an error if an attempt is made to drop an eponymous virtual table.
dan [Sat, 6 Nov 2021 18:22:50 +0000 (18:22 +0000)] 
Return an error if an attempt is made to drop an eponymous virtual table.

FossilOrigin-Name: 889dea52de874cd3bda9e811ef1e4ca53ab794ecabc65e9c780d9fb01eff3b2c

3 years agoAvoid accessing the sqlite3_module.xShadowName field if (sqlite3_module.iVersion<3).
drh [Sat, 6 Nov 2021 10:59:27 +0000 (10:59 +0000)] 
Avoid accessing the sqlite3_module.xShadowName field if (sqlite3_module.iVersion<3).

FossilOrigin-Name: a024764cef955099b498ea120d4127144880db6da411f074cf0fd1276989204e

3 years agoAdd the rbu_exclusive_checkpoint query parameter to RBU.
drh [Fri, 5 Nov 2021 22:35:09 +0000 (22:35 +0000)] 
Add the rbu_exclusive_checkpoint query parameter to RBU.

FossilOrigin-Name: c2d33ea9d81975b27fe157d698033e7c01569cc0aa6178b7f0c43afbfba4a9e2

3 years agoNew test cases for rbu_exclusive_checkpoint query parameter. rbu_exclusive_checkpoint
drh [Fri, 5 Nov 2021 22:23:17 +0000 (22:23 +0000)] 
New test cases for rbu_exclusive_checkpoint query parameter.

FossilOrigin-Name: 00285ff10c771066876896b28cd5185ec3792166b00702326954ef6678f19da8

3 years agoUpdate an assert() statement to conform to the changes of the previous check-in.
drh [Fri, 5 Nov 2021 19:52:27 +0000 (19:52 +0000)] 
Update an assert() statement to conform to the changes of the previous check-in.

FossilOrigin-Name: b5c668cac831425fd3e370142f9ea501bf2ca1c77c3eb0c5b8f0a574f7667b3c

3 years agoAdd the SQLITE_OPEN_EXRESCODE flag for sqlite3_open_v2().
drh [Fri, 5 Nov 2021 19:36:26 +0000 (19:36 +0000)] 
Add the SQLITE_OPEN_EXRESCODE flag for sqlite3_open_v2().

FossilOrigin-Name: ff9373f42d8479be5cae6cc15dc7fe0cc125c6c0157f5375bf7e1e77c624655d

3 years agoIf the target database URI passed to sqlite3rbu_open() is contains the option "rbu_ex...
dan [Fri, 5 Nov 2021 19:04:01 +0000 (19:04 +0000)] 
If the target database URI passed to sqlite3rbu_open() is contains the option "rbu_exclusive_checkpoint=1", hold an exclusive lock for the duration of any incremental checkpoint operation.

FossilOrigin-Name: 7cb77296a22a87e7ed4c3544792f0204f704f01f384590c32c256bec4517c9bc

3 years agoUpdate sqllimits1.test to account for recent changes to SQL function strftime().
dan [Fri, 5 Nov 2021 14:13:12 +0000 (14:13 +0000)] 
Update sqllimits1.test to account for recent changes to SQL function strftime().

FossilOrigin-Name: 7bba415f91884a20f665e982376c2c5e91a4431e218c8eefe275be3684f2e59a

3 years agoUse the FTS_CORRUPT_VTAB macro rather than a direct call to
drh [Fri, 5 Nov 2021 12:34:06 +0000 (12:34 +0000)] 
Use the FTS_CORRUPT_VTAB macro rather than a direct call to
sqlite3Fts3Corrupt() in [2fad2a89527757b3] so that the build works
in all cases.

FossilOrigin-Name: 029c59cdf9e7dbb431f5d110bc69c3597458edc9b6b009b2e91422de705a19fa

3 years agoRemove an incorrect NEVER() reported at
drh [Fri, 5 Nov 2021 11:52:33 +0000 (11:52 +0000)] 
Remove an incorrect NEVER() reported at
[forum:/forumpost/5bbabfb7ce|forum post 5bbabfb7ce].  Also use this
opportunity to improve the isSimpleCount() function with better formatting,
an expanded header comment, and some extra assert() and textcase() macros.

FossilOrigin-Name: 2927185be81a5aa0dce70dd06040d05c2816a4d18b5094a6f709732cfd6968dc

3 years agoFix vacuum3.test so that it works with SQLITE_OMIT_ALTERTABLE builds.
dan [Fri, 5 Nov 2021 11:26:00 +0000 (11:26 +0000)] 
Fix vacuum3.test so that it works with SQLITE_OMIT_ALTERTABLE builds.

FossilOrigin-Name: 07cca2fa891e9a60ea128a4b96ee407e9dd0f2b9e31fcffbfc2ac594a0e1ffe6

3 years ago Update a test case in sqllimits1.test to account for the updated implementation...
dan [Fri, 5 Nov 2021 11:18:31 +0000 (11:18 +0000)] 
  Update a test case in sqllimits1.test to account for the updated implementation of SQL function strftime().

FossilOrigin-Name: f474ac370accc5c780e7cb3e11c35f2b6104df929d3394a27db00c6b995e71b3

3 years agoFix a couple of problems with test scripts and SQLITE_OMIT_ALTERTABLE builds.
dan [Fri, 5 Nov 2021 10:43:14 +0000 (10:43 +0000)] 
Fix a couple of problems with test scripts and SQLITE_OMIT_ALTERTABLE builds.

FossilOrigin-Name: 3ab5414d337536acad5675a3f1ca10e1ca925f0e7182def604b8b7a8fb53bf5a

3 years agoFix a crash that could occur in fts3 when processing a corrupt database.
dan [Thu, 4 Nov 2021 18:04:55 +0000 (18:04 +0000)] 
Fix a crash that could occur in fts3 when processing a corrupt database.

FossilOrigin-Name: 2fad2a89527757b3956538a6bf91ebebe9c483f22f94e889e8b50c58f5100c5c

3 years agoFix corruptN.test so that it works with SQLITE_DEFAULT_AUTOVACUUM=1 builds.
dan [Thu, 4 Nov 2021 16:25:47 +0000 (16:25 +0000)] 
Fix corruptN.test so that it works with SQLITE_DEFAULT_AUTOVACUUM=1 builds.

FossilOrigin-Name: f60e05bdbabe0449e5a12275b254ca9da39a2a5fdbff078ce28007a23044749e

3 years agoUpdate a test case in corruptN.test to account for the fact that if writable_schema...
dan [Thu, 4 Nov 2021 16:15:46 +0000 (16:15 +0000)] 
Update a test case in corruptN.test to account for the fact that if writable_schema=1 is set, no error is raised if a DELETE statement finds that an index entry is missing ([19e56291a7344c7a]).

FossilOrigin-Name: a90c5f0b5ba1ef0f41449cee10a65beb8b55b09fd1976e0e35814b1848979416

3 years agoHave wapptest.tcl avoid attempting to build fuzztest for SQLITE_OMIT_VIRTUALTABLE...
dan [Thu, 4 Nov 2021 16:03:24 +0000 (16:03 +0000)] 
Have wapptest.tcl avoid attempting to build fuzztest for SQLITE_OMIT_VIRTUALTABLE configurations.

FossilOrigin-Name: 53ee208d4ee8db1499a63b6652a8c5269e8fe85a75376adffdb912094ac1a681

3 years agoFix typo in the sqlite3ext.h file.
drh [Thu, 4 Nov 2021 15:17:42 +0000 (15:17 +0000)] 
Fix typo in the sqlite3ext.h file.
[forum:/forumpost/63802db4ce|forum post 63802db4ce]

FossilOrigin-Name: d4a48ee0c28def416f75eb7840ba6462389e3f97e0dc02287bf1a726c8642f04

3 years agoShow the preferred schema table names in the output of "PRAGMA table_list".
drh [Thu, 4 Nov 2021 14:04:20 +0000 (14:04 +0000)] 
Show the preferred schema table names in the output of "PRAGMA table_list".

FossilOrigin-Name: 9147390d9885a37a62edc1058f313434627f1b59965c890877d2cb119e355c78

3 years agoChange a branch made unreachable by the previous check-in into an assert().
drh [Thu, 4 Nov 2021 11:34:04 +0000 (11:34 +0000)] 
Change a branch made unreachable by the previous check-in into an assert().

FossilOrigin-Name: 685a987c9afd1c30629c36f1ffb5e349eb2e26182837523036b916c6f81632c4

3 years agoFirst the shadow table mechanism so that it works even if the shadow table
drh [Thu, 4 Nov 2021 00:51:53 +0000 (00:51 +0000)] 
First the shadow table mechanism so that it works even if the shadow table
comes before the virtual table in the sqlite_schema table, as can happen
after a VACUUM.

FossilOrigin-Name: 005a8642773556825fe4c5d0b2c12517d35289308a30df0151ef7f080acb0172

3 years agoRemove two incorrect assert() statements added by a check-in from earlier
drh [Wed, 3 Nov 2021 16:35:23 +0000 (16:35 +0000)] 
Remove two incorrect assert() statements added by a check-in from earlier
today.

FossilOrigin-Name: 3206edff947b9edb485466f05b2baadf725d798229630c7e83e88c0b9ae278ca