]> git.ipfire.org Git - thirdparty/sqlite.git/log
thirdparty/sqlite.git
3 years agoRemove unused code and fix comments. Final cleanup before merging. bloom-filter
drh [Thu, 9 Dec 2021 19:42:52 +0000 (19:42 +0000)] 
Remove unused code and fix comments.  Final cleanup before merging.

FossilOrigin-Name: ce42039f5647b1f276acf5d9911528ecb47df1544a587def72c8cd6b2f664289

3 years agoEnable bloom filters for the right table of a LEFT JOIN. Fix unreachable
drh [Thu, 9 Dec 2021 18:44:03 +0000 (18:44 +0000)] 
Enable bloom filters for the right table of a LEFT JOIN.  Fix unreachable
branches.

FossilOrigin-Name: d342ab722de1fc3f34219c9755253db9d88eb50a6fa5cc257207008b00e7fc03

3 years agoAdd ".mode off" and ".mode count" to the CLI.
drh [Thu, 9 Dec 2021 16:17:43 +0000 (16:17 +0000)] 
Add ".mode off" and ".mode count" to the CLI.

FossilOrigin-Name: b11f4d080aa9e6f694e2ec401e871f42bf25997e8e8bf77fa9b6014a50466e3c

3 years agoAdd SQLITE_TESTCTRL_LOGEST and enhance the LogEst utility program.
drh [Thu, 9 Dec 2021 01:28:15 +0000 (01:28 +0000)] 
Add SQLITE_TESTCTRL_LOGEST and enhance the LogEst utility program.
Improvements to testability of bloom filters.

FossilOrigin-Name: 88b43d798cc5aa59855e92d3e658aee9f0a5def6ffbc5db77af048d75ecdf8cc

3 years agoImprovements on the decision of whether or not to use a Bloom filter.
drh [Wed, 8 Dec 2021 19:50:45 +0000 (19:50 +0000)] 
Improvements on the decision of whether or not to use a Bloom filter.

FossilOrigin-Name: 0fb2a4e08f518cb38ea3edc6a084d1e4874fd622ba3cf9101b49b3e7dc1a3f2b

3 years agoMerge the WhereClause fix from trunk
drh [Wed, 8 Dec 2021 16:15:41 +0000 (16:15 +0000)] 
Merge the WhereClause fix from trunk

FossilOrigin-Name: d3250256772e3348abe887c0ca3550a6647cce3804c9456a9d0112aea7ee1c46

3 years agoIn the WhereClause object, do not assume that all TERM_VIRTUAL terms appear
drh [Wed, 8 Dec 2021 16:07:22 +0000 (16:07 +0000)] 
In the WhereClause object, do not assume that all TERM_VIRTUAL terms appear
at the end of the list, because that is no longer true.  Instead, keep a
separate nBase count that is the size of the list excluding the tail of
virtual terms.  Use nBase instead of nTerm when scanning terms that are not
virtual.  Add assert()s to validate correctness of WhereClause.

FossilOrigin-Name: 6024682ca467fa4fe49608772b0bbfa2f8a419b32cebfa715941073c8b29da49

3 years agoDo not generate a Bloom filter if it cannot be used prior to the next seek,
drh [Tue, 7 Dec 2021 22:37:50 +0000 (22:37 +0000)] 
Do not generate a Bloom filter if it cannot be used prior to the next seek,
as that leads to a misleading EXPLAIN QUERY PLAN.

FossilOrigin-Name: 2739ed5192058fbcc816ecbc252be687efc606e038bfcd6cf71194a3f4f5684e

3 years agoImproved EXPLAIN QUERY PLAN output for Bloom filters.
drh [Mon, 6 Dec 2021 23:07:59 +0000 (23:07 +0000)] 
Improved EXPLAIN QUERY PLAN output for Bloom filters.

FossilOrigin-Name: 00070e1fff6aec3d7c7b121f2b02bbca38a1664aca9afc3fb7e293f07fd1704f

3 years agoAdd SQLITE_STMTSTATUS_FILTER_HIT and _MISS for tracking the effectiveness
drh [Mon, 6 Dec 2021 21:45:31 +0000 (21:45 +0000)] 
Add SQLITE_STMTSTATUS_FILTER_HIT and _MISS for tracking the effectiveness
of Bloom filters.

FossilOrigin-Name: 24ba535d200fc8a99dd8e66c6d100b5f6ae442098bafb152008429398eefe3e7

3 years agoOmit the OP_FilterInit opcode. Use OP_Blob to initialize each Bloom filter
drh [Mon, 6 Dec 2021 20:16:53 +0000 (20:16 +0000)] 
Omit the OP_FilterInit opcode.  Use OP_Blob to initialize each Bloom filter
instead.  Size the Bloom filter based on sqlite_stat1 size estimates rather
than a run-time measurement for improved testability.

FossilOrigin-Name: 8a9036ee617a6ad93bfe827b0789773c49d3d45b085cb76fa4b9b20a41b79b97

3 years agoMerge trunk fixes into the bloom-filter branch.
drh [Mon, 6 Dec 2021 19:11:31 +0000 (19:11 +0000)] 
Merge trunk fixes into the bloom-filter branch.

FossilOrigin-Name: edacf8034dc6bd892038c220c480ea512dbb4005db2a6b1f8e679e8a4929c6ed

3 years agoFix an OOB read that could occur in fts5 when processing corrupt records.
dan [Mon, 6 Dec 2021 18:57:02 +0000 (18:57 +0000)] 
Fix an OOB read that could occur in fts5 when processing corrupt records.

FossilOrigin-Name: bb9b1a15f7e80483162049dfd981d059dc69d03348b521f7ac164a8cd3ae3cc4

3 years agoDo not allow SQLITE_LIMIT_LENGTH to be set lower than 1 as an
drh [Mon, 6 Dec 2021 15:40:24 +0000 (15:40 +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: 8fd5b8ec4ab9b5554d27f25a4638d56e347eab78b60900f24b15a815d3731330

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

FossilOrigin-Name: 080e72d119b836c49916201bf135445aa7d53cefe40a47437a93448c4d0f41cd

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

FossilOrigin-Name: 2d9a45ab10aaad681e11d639195430c0988b6ca1b96db6bf0b31b889e88a5430

3 years agoAttempt to vary the size of Bloom filters based on an estimate of how many
drh [Mon, 6 Dec 2021 13:07:28 +0000 (13:07 +0000)] 
Attempt to vary the size of Bloom filters based on an estimate of how many
keys the filter will hold.

FossilOrigin-Name: a7adcf69088cba4b86cc5731a45c9a5263af4355bc0a38f5225cab421c915f7f

3 years agoRun as many Bloom filters as possible before index lookups.
drh [Sun, 5 Dec 2021 20:19:47 +0000 (20:19 +0000)] 
Run as many Bloom filters as possible before index lookups.

FossilOrigin-Name: 06f6fefd67086896bc49272c6319545ff6c6792f18babe23aced27b60b032119

3 years agoTry to run all Bloom filters before any Seeks. This gives a small performance
drh [Sun, 5 Dec 2021 00:45:55 +0000 (00:45 +0000)] 
Try to run all Bloom filters before any Seeks.  This gives a small performance
gain on the Star-Schema Benchmark.

FossilOrigin-Name: 5be2470f8755ef454f813c880e659bdbf82f2396be9320cf3079cd4ca8e81a19

3 years agoMiscellaneous cleanup of the new Bloom-filter code.
drh [Sat, 4 Dec 2021 21:11:18 +0000 (21:11 +0000)] 
Miscellaneous cleanup of the new Bloom-filter code.

FossilOrigin-Name: 201b6dd875b0ae2bbc9969b098e88abfc09e37b59e857decd41f2dcbeeb13e01

3 years agoAdd VdbeCoverage() macros. Adjust the Bloom-filter hash function so that it
drh [Sat, 4 Dec 2021 18:45:08 +0000 (18:45 +0000)] 
Add VdbeCoverage() macros.  Adjust the Bloom-filter hash function so that it
correctly deals with zero-blobs.

FossilOrigin-Name: 629ee2e3e3125bfd2af435c6713d49e46691213ad15db0a5e93a63a77f1130c2

3 years agoApply the Bloom filter only on those terms of an index that have equality
drh [Sat, 4 Dec 2021 14:24:30 +0000 (14:24 +0000)] 
Apply the Bloom filter only on those terms of an index that have equality
constraints.

FossilOrigin-Name: a70429596a3c6a413b03118b0d800521b3526d99dcf88a48acc3189b51518d82

3 years agoAdd the "WITH BLOOM FILTER" clause to the EXPLAIN QUERY PLAN output for
drh [Sat, 4 Dec 2021 13:52:08 +0000 (13:52 +0000)] 
Add the "WITH BLOOM FILTER" clause to the EXPLAIN QUERY PLAN output for
cases were a Bloom filter is used.

FossilOrigin-Name: 8e078c0e404fe4b3661dd4a11a992a8914c99e2a144cecc417421cbd68fa08cc

3 years agoFirst attempt to use Bloom filters to optimize star-schema queries.
drh [Sat, 4 Dec 2021 13:43:57 +0000 (13:43 +0000)] 
First attempt to use Bloom filters to optimize star-schema queries.

FossilOrigin-Name: 28161fba9bcde5ae4b36b22d766c881b795af111a3a323c90f6149d0fea9297d

3 years agoMerge the sqlite3WhereBegin() simplification from trunk.
drh [Fri, 3 Dec 2021 19:10:17 +0000 (19:10 +0000)] 
Merge the sqlite3WhereBegin() simplification from trunk.

FossilOrigin-Name: 41ba2dfdd3a18671fc78d60935a16fa50f36af3d6481eff2ca9fba88e7093997

3 years agoFactor the noop-join-elimination optimization out of the sqlite3WhereBegin()
drh [Fri, 3 Dec 2021 18:53:53 +0000 (18:53 +0000)] 
Factor the noop-join-elimination optimization out of the sqlite3WhereBegin()
routine and into a separate "no-inline" subroutine, in order to reduce the
complexity of sqlite3WhereBegin() and thereby encourage C compilers to
inline sqlite3WhereCodeOneLoopStart().

FossilOrigin-Name: 6225e9abcb0261fefca4a26530524ffc449f937f8ae1ece718af2c3c3d73d78d

3 years agoMerge recent trunk enhancements into the bloom-filter branch.
drh [Fri, 3 Dec 2021 16:02:05 +0000 (16:02 +0000)] 
Merge recent trunk enhancements into the bloom-filter branch.

FossilOrigin-Name: 11d97fb8be6b5155f38df130d7e828edd0f381e32f651458939b1cb9cb973fff

3 years agoFix exprAnalyze() after recent performance enhancements so that it is able
drh [Fri, 3 Dec 2021 15:48:42 +0000 (15:48 +0000)] 
Fix exprAnalyze() after recent performance enhancements so that it is able
to handle IF_NULL_ROW opcode correctly, again.

FossilOrigin-Name: 8029e6bab508bf0b8ec1df00a829c5d4de2a84d66dc56b9ff03da879ceef7788

3 years agoFix unreachable branches resulting from prior optimizations.
drh [Fri, 3 Dec 2021 14:57:05 +0000 (14:57 +0000)] 
Fix unreachable branches resulting from prior optimizations.

FossilOrigin-Name: f3d6853ee80be2dc6d7236d98b850beb0e1931a624d4f5b194c8db742cde7ec5

3 years agoFix an over-length source code line in build.c. No logic changes.
drh [Fri, 3 Dec 2021 14:43:49 +0000 (14:43 +0000)] 
Fix an over-length source code line in build.c.  No logic changes.

FossilOrigin-Name: b9db5c5fc618a36d70ea2aced9c96094d665935b5c15a987013334f1bd79eb00

3 years agoPerformance optimization in the B-Tree cursor allocator btreeCursor(), making
drh [Fri, 3 Dec 2021 13:42:41 +0000 (13:42 +0000)] 
Performance optimization in the B-Tree cursor allocator btreeCursor(), making
it about 800K CPU cycles faster in speedtest1, and reducing the executable
size by about 100 bytes.

FossilOrigin-Name: 9df939716ace8cfe60340bbe83fc52d452ea40c29c856c588f9a1b8973282391

3 years agoOptimizations to exprAnalyze() and sqlite3WhereExprUsage() save about 1.5
drh [Thu, 2 Dec 2021 18:15:16 +0000 (18:15 +0000)] 
Optimizations to exprAnalyze() and sqlite3WhereExprUsage() save about 1.5
million CPU cycles for speedtest1, and result in a smaller binary.

FossilOrigin-Name: 1f2252e65dc5847c82246fab87dcad035bf594ba7c45362de87a009b7ebcf2d6

3 years agoMove the TK_IS token so that it is adjacent to the TK_IN token, as this
drh [Thu, 2 Dec 2021 14:28:36 +0000 (14:28 +0000)] 
Move the TK_IS token so that it is adjacent to the TK_IN token, as this
allows the C compiler to optimize better, resulting in a slightly smaller
and faster executable.

FossilOrigin-Name: 8832fa9088414a8d285a457a4effad0b7d610a87ca73cfb5c5812e784649761e

3 years agoIn the shell tool, avoid modifying internal data structures until after the arguments...
dan [Thu, 2 Dec 2021 14:16:30 +0000 (14:16 +0000)] 
In the shell tool, avoid modifying internal data structures until after the arguments to ".open" have been parsed.

FossilOrigin-Name: fcc509d325dabe06275e7804183bb8b4ba6470a45b443bc8292eecd0974e6367

3 years agoRemove an unnecessary branch from exprAnalyze(), resulting in a small
drh [Thu, 2 Dec 2021 13:45:10 +0000 (13:45 +0000)] 
Remove an unnecessary branch from exprAnalyze(), resulting in a small
performance gain.

FossilOrigin-Name: 3312be1db3519074393573265459f6a1eeabce541a9ef4d93689529ea2b8f739

3 years agoSmall performance optimization in sqlite3WhereClauseClear().
drh [Thu, 2 Dec 2021 12:55:05 +0000 (12:55 +0000)] 
Small performance optimization in sqlite3WhereClauseClear().

FossilOrigin-Name: 080b35e62e5c6bb4ea162bc75232b81e54da5e3e01e762127e228400e8afef1d

3 years agoMore small performance optimizations for sqlite3WhereGetMask().
drh [Thu, 2 Dec 2021 12:34:05 +0000 (12:34 +0000)] 
More small performance optimizations for sqlite3WhereGetMask().

FossilOrigin-Name: 3de2c557d915d1b4a9b0e540d5e80ffb243e7123d0ec65c5052f4d6f1cce56b2

3 years agoSmall performance optimization in sqlite3WhereGetMask().
drh [Thu, 2 Dec 2021 04:00:45 +0000 (04:00 +0000)] 
Small performance optimization in sqlite3WhereGetMask().

FossilOrigin-Name: 7edec54ab045c0493fc5d27d47d7bf0e08d3b0b298f428646fd3f0ee24dfcade

3 years agoSmall performance enhancement for whereScanInit().
drh [Thu, 2 Dec 2021 02:22:35 +0000 (02:22 +0000)] 
Small performance enhancement for whereScanInit().

FossilOrigin-Name: ed84e124c6097b756ca687ac64df7ee801d14b16c835f1a9e8b336f785157d85

3 years agoPerformance improvement in query planning.
drh [Thu, 2 Dec 2021 01:30:16 +0000 (01:30 +0000)] 
Performance improvement in query planning.

FossilOrigin-Name: ca59533bbb7f21d7b39dee7999d3f36ac516f8c75b2203039beeb2852ada42d4

3 years agoMerge trunk fixes into the bloom-filter branch.
drh [Wed, 1 Dec 2021 21:07:05 +0000 (21:07 +0000)] 
Merge trunk fixes into the bloom-filter branch.

FossilOrigin-Name: 0864bfbf079a98beaa484911edb17c3dc728e78eca231d4247b282fd824cc098

3 years agoCheck for foreign key constraint errors prior to returning the results from
drh [Wed, 1 Dec 2021 19:17:14 +0000 (19:17 +0000)] 
Check for foreign key constraint errors prior to returning the results from
a RETURNING clause.  See [forum:/forumpost/793beaf322|forum post 793beaf322].

FossilOrigin-Name: a818ba2ed635b91e279dde44236fc7446a33db2b46c9409b67021248c01bf4e5

3 years agoAdd a Bloom filter to the automatic-index mechanism.
drh [Wed, 1 Dec 2021 16:31:02 +0000 (16:31 +0000)] 
Add a Bloom filter to the automatic-index mechanism.

FossilOrigin-Name: 50ac4de1d7cbb586ea7969e1ae80ea8b021e194edc2fa7db19374b4ee9369bee

3 years agoAdd the "static" qualifier to some internal functions in code for various SQLite...
dan [Wed, 1 Dec 2021 11:03:50 +0000 (11:03 +0000)] 
Add the "static" qualifier to some internal functions in code for various SQLite extensions.

FossilOrigin-Name: 8c986782547211098eb0e4e722eda0097421223af279381373d0055211b5e9d2

3 years agoIn the automatic index generator logic, be more precise about when a
drh [Tue, 30 Nov 2021 14:07:58 +0000 (14:07 +0000)] 
In the automatic index generator logic, be more precise about when a
partial automatic index is allowed in order to capture more cases where it
is legal to use a partial automatic index.

FossilOrigin-Name: 664b461bb5063d98047fc2e51a3827235cd9f55ca2e23cb66e719eac53fb5437

3 years agoMerge in the proposed date/time function enhancements: (1) Add the
drh [Mon, 29 Nov 2021 18:09:54 +0000 (18:09 +0000)] 
Merge in the proposed date/time function enhancements:  (1) Add the
unixepoch() function, (2) the 'auto' modifier and (3) the 'julianday' modifier.

FossilOrigin-Name: 19c51b46e4095ee28badb10f4e08bbd330bda320c9a8806e93b8fc60ba211a2e

3 years agoBump the version number up to 3.38.0 in order to begin the next development
drh [Mon, 29 Nov 2021 17:55:12 +0000 (17:55 +0000)] 
Bump the version number up to 3.38.0 in order to begin the next development
cycle.

FossilOrigin-Name: 8ad1fcaa1b734e32d8d67c4cca7a23d2b9717ae5c7c2c5ad5a3411a503ee23ae

3 years agoAdd the unixepoch() function and the 'auto' and 'julianday' modifiers. unixepoch
drh [Mon, 29 Nov 2021 17:23:27 +0000 (17:23 +0000)] 
Add the unixepoch() function and the 'auto' and 'julianday' modifiers.

FossilOrigin-Name: 559fdc0aa76f4c207f99f7b0cee42043b402dc388165817529d9963b115a798c

3 years agoFollowing a prior error, an ALWAYS() in sqlite3ExprCanBeNull() might be false.
drh [Sun, 28 Nov 2021 19:54:38 +0000 (19:54 +0000)] 
Following a prior error, an ALWAYS() in sqlite3ExprCanBeNull() might be false.
dbsqlfuzz 5dbec6678a20e7595a34dfdd869a3b9722b3ca43.

FossilOrigin-Name: 4e207401acce1bdc17025f2d55bd94234b435e286cd43e1eda03b6949a2a91d3

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 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 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