]> git.ipfire.org Git - thirdparty/sqlite.git/log
thirdparty/sqlite.git
3 years agoFix a minor typo in a comment. archive_remove
drh [Tue, 2 Nov 2021 10:54:39 +0000 (10:54 +0000)] 
Fix a minor typo in a comment.

FossilOrigin-Name: 06a5bf4348d3125bb5407fe9b7d451800b113a91fd1a9dff7d840e2317a7284d

3 years agoAdd globbing option to shell's .archive command.
larrybr [Tue, 2 Nov 2021 00:18:11 +0000 (00:18 +0000)] 
Add globbing option to shell's .archive command.

FossilOrigin-Name: 13fb74ac5e7578ab612af2ccc8147569d60dc35af84f496bcc5d648d223d6d6e

3 years agozap trailing whitespace
larrybr [Mon, 1 Nov 2021 22:33:20 +0000 (22:33 +0000)] 
zap trailing whitespace

FossilOrigin-Name: f2a908e9c86efb11bb179ce7121f0d510f952284891abfa69517b773fd88324c

3 years agoAdd a test for .ar -r and fix a use-of-uninitialized-variable bug
larrybr [Mon, 1 Nov 2021 22:30:24 +0000 (22:30 +0000)] 
Add a test for .ar -r and fix a use-of-uninitialized-variable bug

FossilOrigin-Name: 978d5ed4379b631a79cd46a75d9b5b403f3ec4ce7d9d52ed36a5678cdf04f7f2

3 years agoAdd --remove subcommand to shell's .archive command
larrybr [Mon, 1 Nov 2021 17:22:52 +0000 (17:22 +0000)] 
Add --remove subcommand to shell's .archive command

FossilOrigin-Name: 23525449b883ae6e1d62100bdbc9ff2ca788f67e8ae7d7e4b1a770413a70a7f0

3 years agoThe VVA() macro in json1.c must be active during SQLITE_COVERAGE_TEST because
drh [Mon, 1 Nov 2021 12:53:01 +0000 (12:53 +0000)] 
The VVA() macro in json1.c must be active during SQLITE_COVERAGE_TEST because
it affects the outcome of testcase() macros.

FossilOrigin-Name: 92c3d253797f9bde4670984d60bbd50b7b28540d2b5f503f318843580bab8765

3 years agoAdd the sqlite3_autovacuum_pages() interface.
drh [Sat, 30 Oct 2021 20:22:32 +0000 (20:22 +0000)] 
Add the sqlite3_autovacuum_pages() interface.

FossilOrigin-Name: ca2703c339f76101f25051a2ed380398b018782883bfee68b5f2d69a1de9091a

3 years agoFix an incorrect assert() statement in sqlite3GenerateConstraintChecks().
drh [Sat, 30 Oct 2021 18:17:59 +0000 (18:17 +0000)] 
Fix an incorrect assert() statement in sqlite3GenerateConstraintChecks().
dbsqlfuzz 4190cff310aeab359a55f354e560db95d3a6f47d

FossilOrigin-Name: 623c0d086bda135c49bfc238c31498facdcbe8ecc7659cc1af61594df0c6e899

3 years agoFix a memory leak in test code on this branch. autovacuum-pages-callback
dan [Sat, 30 Oct 2021 17:58:25 +0000 (17:58 +0000)] 
Fix a memory leak in test code on this branch.

FossilOrigin-Name: 60cd9da9258e0b701d4bb3f9c91c5d0a12e925b9b937df619b09f33a287b4a33

3 years agoMerge trunk changes into this branch.
dan [Sat, 30 Oct 2021 17:30:48 +0000 (17:30 +0000)] 
Merge trunk changes into this branch.

FossilOrigin-Name: 638c1b0c50229800067eb1ba29d829b4d6e008256c21a1f67b4ce4d19ea307b3

3 years agoReorder a test add earlier today to OP_Transaction for easier testing.
drh [Fri, 29 Oct 2021 16:19:03 +0000 (16:19 +0000)] 
Reorder a test add earlier today to OP_Transaction for easier testing.

FossilOrigin-Name: 8ba73b3cadb72ffcf176d19f9f946c1b90b224e5ab9a0e9eb9a83affa7476d23

3 years agoAllow "VACUUM INTO" to change the page_size of a database even if the
drh [Fri, 29 Oct 2021 13:10:02 +0000 (13:10 +0000)] 
Allow "VACUUM INTO" to change the page_size of a database even if the
original database is in WAL mode.  Enhancement suggested by
[forum:/forumpost/033f2c9d1f|forum post 033f2c9d1f].

FossilOrigin-Name: efc7e8c99a86e9d9eb81655ce96353847bd2cca64eb8f8d10e297f6f4d38e563

3 years agoAdd pragmas "multiplex_enabled", "multiplex_chunksize", and "multiplex_filecount...
drh [Fri, 29 Oct 2021 12:29:22 +0000 (12:29 +0000)] 
Add pragmas "multiplex_enabled", "multiplex_chunksize", and "multiplex_filecount" to the multiplexer implementation.

FossilOrigin-Name: 39c5e80dbf94ac3079b3e0c2c3e6608ac366e3f3de3cea4f4947addc3f52bc36

3 years agoFix the OP_Transaction opcode so that if an error other than SQLITE_SCHEMA
drh [Fri, 29 Oct 2021 09:59:06 +0000 (09:59 +0000)] 
Fix the OP_Transaction opcode so that if an error other than SQLITE_SCHEMA
occurs first, the original error is not overwritten by SQLITE_SCHEMA.
dbsqlfuzz 85bf7e262017c6c7bddb03ff6d8541511985d36c.

FossilOrigin-Name: 5374226df4a2c1b59258839532b67a399c447ac8ec1408fdf2dffb9c41e1349e

3 years agoFix .import -skip issue reported at https://sqlite.org/forum/forumpost/4c0816c24fc9d1...
larrybr [Thu, 28 Oct 2021 19:49:23 +0000 (19:49 +0000)] 
Fix .import -skip issue reported at https://sqlite.org/forum/forumpost/4c0816c24fc9d16f?t=h

FossilOrigin-Name: 3aadbe17edc1efc7fa6c9600de84e23242ba7866d2dcef2189afd7ba4c97979f

3 years agoMinor changes to make it easier for static analyzers to reason about the code.
drh [Thu, 28 Oct 2021 12:07:43 +0000 (12:07 +0000)] 
Minor changes to make it easier for static analyzers to reason about the code.

FossilOrigin-Name: ba4104aa02625b51113978c1bb540b75bd88cb1959c7e9bfb4113db4159df5d4

3 years agoEnsure that the WAL code correctly handles all possible outcomes from the
drh [Thu, 28 Oct 2021 00:09:31 +0000 (00:09 +0000)] 
Ensure that the WAL code correctly handles all possible outcomes from the
walIndexPage() routine.

FossilOrigin-Name: 6979efbf07d93e7afad508165df684dcc6fe33b91ca772397c8afa00d16d1a0d

3 years agoEnsure that all possible outcomes for walIndexPage() are accounted for by wal-tuneup
drh [Wed, 27 Oct 2021 23:55:30 +0000 (23:55 +0000)] 
Ensure that all possible outcomes for walIndexPage() are accounted for by
callers.

FossilOrigin-Name: 12715c6b234a04627ca27e94bfa8bd456998360a9f0117480e0038f4747818d6

3 years agoAvoid the 1-based indexing on the WalHashLoc.aPgno[] array. Make it 0-indexed
drh [Wed, 27 Oct 2021 20:23:59 +0000 (20:23 +0000)] 
Avoid the 1-based indexing on the WalHashLoc.aPgno[] array.  Make it 0-indexed
instead.

FossilOrigin-Name: 28f5f709b4b28ba7f6f56bdd4a9e8c04d0d2df90d13d6df1a589fa4a65163f4d

3 years agoImprove the comment on walIndexPage() to more accurately describe the
drh [Wed, 27 Oct 2021 19:57:59 +0000 (19:57 +0000)] 
Improve the comment on walIndexPage() to more accurately describe the
post-conditions.

FossilOrigin-Name: b619e936455f4001b543a9a58dea2ac9ebd598327d6be01130ca6e7e9764ffe6

3 years agoNew assert()s to help prove correctness in sqlite3VdbeMemExpandBlob().
drh [Wed, 27 Oct 2021 19:05:04 +0000 (19:05 +0000)] 
New assert()s to help prove correctness in sqlite3VdbeMemExpandBlob().

FossilOrigin-Name: 7238d58051bfdcea8f7a4aeab89145849d0659c987df9063aacafe97be6657fe

3 years agoFix the build for various the OMIT-everything compile-time option. No impact
drh [Wed, 27 Oct 2021 17:15:08 +0000 (17:15 +0000)] 
Fix the build for various the OMIT-everything compile-time option.  No impact
on regular builds.

FossilOrigin-Name: 947805719bc8629619af5358ad50a6365c01f8d9ceabfe8e4df947696d3819b3

3 years agoFix a harmless compiler warning in memdb.c.
drh [Wed, 27 Oct 2021 15:19:01 +0000 (15:19 +0000)] 
Fix a harmless compiler warning in memdb.c.

FossilOrigin-Name: 22fdc658a7cc6d2c50957f92c19de74c9ac7d7d3498731d73e035b99a82bc406

3 years agoFix a harmless compiler warning in fuzzcheck.
drh [Wed, 27 Oct 2021 15:16:30 +0000 (15:16 +0000)] 
Fix a harmless compiler warning in fuzzcheck.

FossilOrigin-Name: 1cfb7e8a095e1e24df5117aa7be97470d8ce91837ff83dabebac53fafee0b09c

3 years agoChange fuzzcheck so that it accepts binary dbsql files.
drh [Wed, 27 Oct 2021 13:16:33 +0000 (13:16 +0000)] 
Change fuzzcheck so that it accepts binary dbsql files.

FossilOrigin-Name: c87a2426b81f22bd21543aa2408625ae472d8fe6cbe6b04145937066e61123c9

3 years agoAdd the --script option to fuzzcheck.
drh [Wed, 27 Oct 2021 12:05:28 +0000 (12:05 +0000)] 
Add the --script option to fuzzcheck.

FossilOrigin-Name: 5a9676bd4945ca098652780515e94d04859e73588d9db5558ab42f8b068a9ddb

3 years agoEnhance fuzzcheck so that if an argument is an ordinary disk file (not
drh [Tue, 26 Oct 2021 22:36:41 +0000 (22:36 +0000)] 
Enhance fuzzcheck so that if an argument is an ordinary disk file (not
a database) it is read in and processed as a script.

FossilOrigin-Name: 978dc89df521f5855678128b3c0eb503c67c1b97ddb297076e5f2c03d6297605

3 years agoImproved CLI error messages.
drh [Tue, 26 Oct 2021 17:36:26 +0000 (17:36 +0000)] 
Improved CLI error messages.

FossilOrigin-Name: 8443a2724f463bd2e14ea3aa337e8987104f63365767ca2b0993f3f3196cff95

3 years agoAdd phase and error number to CLI error messages. detail_cli_errors
larrybr [Tue, 26 Oct 2021 16:57:09 +0000 (16:57 +0000)] 
Add phase and error number to CLI error messages.

FossilOrigin-Name: 7f87a298688c37bbad8fd2e1cf0e8fbcc36f0c211dcfa3685298525648dbe21b

3 years agoFix the busy_timeout restriction on fuzzcheck so that it can deal with
drh [Tue, 26 Oct 2021 09:53:51 +0000 (09:53 +0000)] 
Fix the busy_timeout restriction on fuzzcheck so that it can deal with
hexadecimal integer literals.

FossilOrigin-Name: 4b41535b096dec4b15a85e657102a72d4288728da6103f3fdcbe0e6f244c673a

3 years agoRemove a NEVER() in rebuildPage that is reachable, as is demonstrated by
drh [Mon, 25 Oct 2021 18:51:56 +0000 (18:51 +0000)] 
Remove a NEVER() in rebuildPage that is reachable, as is demonstrated by
dbsqlfuzz case beac09b2756b5d285aa68f9737fdb06c972f159a.

FossilOrigin-Name: ac3f617827e06800d26ef688c5f5480b9621676f141d2eac134f877e0c454149

3 years agoDo not allow large busy_timeout pragmas in fuzzcheck, as they accomplish
drh [Mon, 25 Oct 2021 12:54:23 +0000 (12:54 +0000)] 
Do not allow large busy_timeout pragmas in fuzzcheck, as they accomplish
nothing other than making the tests unnecessarily slow.

FossilOrigin-Name: fba441bf9f6ed729a66ccd4e42b5a8859bf3952d70a66bc9a2496ec49d90a60c

3 years agoImprove the authorizer filter for ATTACH on fuzzcheck.
drh [Sat, 23 Oct 2021 22:14:11 +0000 (22:14 +0000)] 
Improve the authorizer filter for ATTACH on fuzzcheck.

FossilOrigin-Name: 87d49e80878674470d280de79c8ade222dd006e65c90e79616c4f72c7c32dabb

3 years agoProvide an assert() to fire for applications that should never open or create
drh [Sat, 23 Oct 2021 22:11:18 +0000 (22:11 +0000)] 
Provide an assert() to fire for applications that should never open or create
a disk-based database file.

FossilOrigin-Name: 5218ac788ca35fdd7f98117758f0bef9d55fe7517098e7bf62fda3fed2af3d51

3 years agoThe pager now remembers when a VFS reports that a database file is
drh [Sat, 23 Oct 2021 20:32:27 +0000 (20:32 +0000)] 
The pager now remembers when a VFS reports that a database file is
SQLITE_OPEN_MEMORY and treats that database as an in-memory database.

FossilOrigin-Name: 967b65623807ff992869da0a7d9b0105701939c4658a7aee37a30fb267869c6d

3 years agoFix the memdb VFS so that it does not allow mmap if it is resizable, and so
drh [Sat, 23 Oct 2021 17:46:00 +0000 (17:46 +0000)] 
Fix the memdb VFS so that it does not allow mmap if it is resizable, and so
that it never opens a disk file for any reason.

FossilOrigin-Name: 5ee14715a561d7522e9c6fd35a2ad3e6de526450025a99d2a523c2b27151be4f

3 years agoUpdate fuzzcheck so that it allows ATTACH statements with memdb filenames.
drh [Sat, 23 Oct 2021 11:30:35 +0000 (11:30 +0000)] 
Update fuzzcheck so that it allows ATTACH statements with memdb filenames.

FossilOrigin-Name: 31671237e560b52dc27f707309269069a6bdcd017df9844908e77b57dc11f180

3 years agoFix harmless compiler warnings. Improve the independence of some TCL tests.
drh [Fri, 22 Oct 2021 11:17:29 +0000 (11:17 +0000)] 
Fix harmless compiler warnings.  Improve the independence of some TCL tests.

FossilOrigin-Name: 1a038242dc6c0cab97dd9375acfce62aa1c386debc36aaed388d366b87ddd931

3 years agoEnable FTS5 for fuzzcheck.
drh [Thu, 21 Oct 2021 20:08:00 +0000 (20:08 +0000)] 
Enable FTS5 for fuzzcheck.

FossilOrigin-Name: 559ba38b8a0f7795d781838ec78969874fd678f749b26cd49cf6112afc838732

3 years agoFix the previous check-in so that it works with virtual tables that add new
drh [Thu, 21 Oct 2021 19:48:14 +0000 (19:48 +0000)] 
Fix the previous check-in so that it works with virtual tables that add new
shadow tables the first time they are referenced.

FossilOrigin-Name: f73b499e539b9551a70deecec4fc10c3a4af3830324977861cd0558f9782a1d3

3 years agoFix the new "table_list" pragma so that it shows the correct number of
drh [Thu, 21 Oct 2021 17:01:10 +0000 (17:01 +0000)] 
Fix the new "table_list" pragma so that it shows the correct number of
columns for views and virtual tables even when the object has not been
previously used.

FossilOrigin-Name: fb0ed8c55f6362d2639687392a72cc3ed9dc318929e11893edd2a0f023929f7e

3 years agoFix an incorrect JSON assert() that was added 5 days ago by check-in [7b8ea2298927fd34].
drh [Wed, 20 Oct 2021 20:22:37 +0000 (20:22 +0000)] 
Fix an incorrect JSON assert() that was added 5 days ago by check-in [7b8ea2298927fd34].

FossilOrigin-Name: e162da3ab4c183b67872be004035c48fc8f20084bc5757aec27410ce23a36631

3 years agoFix the finish_test proc in tester.tcl so that it works for Windows test
drh [Wed, 20 Oct 2021 18:17:31 +0000 (18:17 +0000)] 
Fix the finish_test proc in tester.tcl so that it works for Windows test
builds.  Fix for problem introduced yesterday by check-in [3658417bf300e004].

FossilOrigin-Name: f52b84e69e5fcbe59ccc6163e7e78aa3822f2c354c88f8a76a2d1d4c90a99821

3 years agoEnabled the testcase() macros under SQLITE_DEBUG.
drh [Wed, 20 Oct 2021 17:58:33 +0000 (17:58 +0000)] 
Enabled the testcase() macros under SQLITE_DEBUG.

FossilOrigin-Name: 0ae8dd132db8331ca9cc42ad511066924f9d3a1d158ecdb630cebc41b6bd2493

3 years agoFix a problem with the CARRAY extension when the SQLITE_TRANSIENT destructor
drh [Wed, 20 Oct 2021 13:48:12 +0000 (13:48 +0000)] 
Fix a problem with the CARRAY extension when the SQLITE_TRANSIENT destructor
is used for non-text arrays.
[forum:/forumpost/48e525b266|Forum thread 48e525b266].

FossilOrigin-Name: cac910c15f409c5358843643b2f90252eb90328b9e5ff84cedbccb604d9891af

3 years agoEnsure that valid bytecode is generated for RETURNING clauses even if
drh [Wed, 20 Oct 2021 12:52:12 +0000 (12:52 +0000)] 
Ensure that valid bytecode is generated for RETURNING clauses even if
the schema is corrupt and PRAGMA writable_schema is set so that the
schema parse returns no errors.
dbsqlfuzz cb21825bdcd6fdb4b686ce4f6e2f45e781d2f220

FossilOrigin-Name: 699117156e0b5a7beda606de56bd511af322e3efa4eee6e60f0a8d60561def64

3 years agoFix a case in the fts3 offsets() function where a corrupt database record could lead...
dan [Wed, 20 Oct 2021 11:40:34 +0000 (11:40 +0000)] 
Fix a case in the fts3 offsets() function where a corrupt database record could lead to dereferencing an uninitialized pointer.

FossilOrigin-Name: 7b7d31a6153b1505288eb3e849d0d9ef9e88e961c7b2f918ef5582fd77990f6d

3 years agoMerge multi-module test logic improvements from trunk.
drh [Tue, 19 Oct 2021 19:26:27 +0000 (19:26 +0000)] 
Merge multi-module test logic improvements from trunk.

FossilOrigin-Name: e00a44ac10d68b7bdaff1d9c237b598696eddc2d7392574aee1a95d94b4f165a

3 years agoImproved cleanup in finish_test so that specifying multiple test modules
drh [Tue, 19 Oct 2021 18:59:10 +0000 (18:59 +0000)] 
Improved cleanup in finish_test so that specifying multiple test modules
on the "./testfixture" command-line is more likely to work.

FossilOrigin-Name: 3658417bf300e004e5166ee69aa2d8c70697b87ea7456cb6337b0ad6d60257d5

3 years agoFix permutations.test so that it can be called with a test file pattern that uses...
dan [Tue, 19 Oct 2021 18:53:30 +0000 (18:53 +0000)] 
Fix permutations.test so that it can be called with a test file pattern that uses square brackets.

FossilOrigin-Name: 55b6241871a3b52d835ebdc52a1ce6c736861cf7a03331391c5d6ffd39720514

3 years agoUpdate test scripts to unregister the test devsim VFS after it is used.
dan [Tue, 19 Oct 2021 18:40:00 +0000 (18:40 +0000)] 
Update test scripts to unregister the test devsim VFS after it is used.

FossilOrigin-Name: bb0e18ae4a49c305dd8b26886a3a4f3c6dad380edca57af835da4ad470ca8eb6

3 years agoMerge trunk enhancements into the autovacuum-pages-callback branch.
drh [Tue, 19 Oct 2021 18:00:05 +0000 (18:00 +0000)] 
Merge trunk enhancements into the autovacuum-pages-callback branch.

FossilOrigin-Name: c26c9e5040ef4c52f2a99597e3a7c3eabd52c905d874fc76ca10fd54b749fa97

3 years agoRemove an incorrect assert() added 4 days ago by check-in [9e2f06b84f994277].
drh [Sun, 17 Oct 2021 10:31:09 +0000 (10:31 +0000)] 
Remove an incorrect assert() added 4 days ago by check-in [9e2f06b84f994277].
Replace it with a testcase() macro.

FossilOrigin-Name: 03dff7196bb00f8e32f574f65745ceafb33ee3fdd169263121342859c362eca5

3 years agoFix a harmless scan-build warning in FTS5.
drh [Sat, 16 Oct 2021 19:50:03 +0000 (19:50 +0000)] 
Fix a harmless scan-build warning in FTS5.

FossilOrigin-Name: 0bf42bb5611dc3f672cb898b8be245fd25f7a3862c1e0734effd18d75e812f22

3 years agoAdd NEVER() macros on branches that become unreachable due to the
drh [Sat, 16 Oct 2021 18:53:36 +0000 (18:53 +0000)] 
Add NEVER() macros on branches that become unreachable due to the
previous check-in.

FossilOrigin-Name: 5fa272cc033216ed2d3b16078db58accf4d9a3d10e6dd64d362ef844b3e267b6

3 years agoHave the btree layer detect when a "DELETE FROM tbl" statement is clearing a database...
dan [Sat, 16 Oct 2021 17:09:36 +0000 (17:09 +0000)] 
Have the btree layer detect when a "DELETE FROM tbl" statement is clearing a database page that is still in use (due to database corruption) and report SQLITE_CORRUPT.

FossilOrigin-Name: a6fda39e81d0da98dd6b60b32e6df786f0089c1f4ac7f3a2936afd118bd04353

3 years agoFix an assert() in fts5 that could fail with a corrupt database.
dan [Sat, 16 Oct 2021 13:59:08 +0000 (13:59 +0000)] 
Fix an assert() in fts5 that could fail with a corrupt database.

FossilOrigin-Name: e99979855de937ed5ee0994b180054501400bf8776fb70acd31786d2ba1ad49a

3 years agoDemostrate a prototype sqlite3_autovacuum_pages() interface.
drh [Fri, 15 Oct 2021 23:02:27 +0000 (23:02 +0000)] 
Demostrate a prototype sqlite3_autovacuum_pages() interface.

FossilOrigin-Name: bb6f2b8b486c225043bc64e5f74ff6bbad6c5d1f337f0c81eeb6172b087bb943

3 years agoProtect the WhereTerm.u union using nearby assert()s and/or branches.
drh [Fri, 15 Oct 2021 17:06:16 +0000 (17:06 +0000)] 
Protect the WhereTerm.u union using nearby assert()s and/or branches.

FossilOrigin-Name: 8a56de5b9c6f4522000f8d991373490b67b9e9d97f03c1ca2cf32816d84789ef

3 years agoProtect the JsonNode.u union using nearby assert()s and branches.
drh [Fri, 15 Oct 2021 16:15:04 +0000 (16:15 +0000)] 
Protect the JsonNode.u union using nearby assert()s and branches.

FossilOrigin-Name: 7b8ea2298927fd34f27b3345add3ce751ed728387fe3d9207b601ba6449d5af9

3 years agoFix a signed integer overflow in fts5 leading to a segfault that could occur when...
dan [Thu, 14 Oct 2021 21:13:02 +0000 (21:13 +0000)] 
Fix a signed integer overflow in fts5 leading to a segfault that could occur when processing corrupt records.

FossilOrigin-Name: 69a3ff0cc159cdf84a5367eaf708882ddeda4fa65c96a5b546ae4a0114f02cb7

3 years agoProtect access to the WhereLoop.u union using nearby assert()s and
drh [Thu, 14 Oct 2021 19:28:28 +0000 (19:28 +0000)] 
Protect access to the WhereLoop.u union using nearby assert()s and
branches.

FossilOrigin-Name: bdd840216cc4c5293c112f182a189f7562b3cc0f6270e3c4af5eb2e8bd61ccc9

3 years agoUpdate requirement marks. No changes to code.
drh [Thu, 14 Oct 2021 17:30:32 +0000 (17:30 +0000)] 
Update requirement marks.  No changes to code.

FossilOrigin-Name: 3a6887a543ac348d1a0d4b7f54b13c9dae929c3fa3408c5a44420943ba8c116f

3 years agoNew tests added to test/fuzzdata8.db.
drh [Wed, 13 Oct 2021 20:29:05 +0000 (20:29 +0000)] 
New tests added to test/fuzzdata8.db.

FossilOrigin-Name: e944d71760e3ee3de5dd518a04dad54d66ae4d40dac172b64d16c508471e30a1

3 years agoConvert an assert() into a corruption detection branch in
drh [Wed, 13 Oct 2021 20:11:30 +0000 (20:11 +0000)] 
Convert an assert() into a corruption detection branch in
sqlite3BtreePayload().  dbsqlfuzz 848171b5d58f6e4a62257466e0e7de16696d4f02.

FossilOrigin-Name: f038d7f90e04838479e44ded00f627ec5ad8e1bd477edea8e87e66dd37485f30

3 years agoAttempt to clarify the sqlite3_open_v2() documentation so that people do not
drh [Wed, 13 Oct 2021 15:09:37 +0000 (15:09 +0000)] 
Attempt to clarify the sqlite3_open_v2() documentation so that people do not
come away with the idea that SQLITE_OPEN_EXCLUSIVE is an allowed bit value
for the 3rd argument bitmask.

FossilOrigin-Name: 1310a126deae6974277d281ff78a7c34bd21829dd822a9fd8d6bda23cfba3f15

3 years agoBack out the SQLITE_OPEN_EXCLUSIVE changes because it does not work on
drh [Wed, 13 Oct 2021 14:45:35 +0000 (14:45 +0000)] 
Back out the SQLITE_OPEN_EXCLUSIVE changes because it does not work on
Windows and it does not work always on unix.

FossilOrigin-Name: d008ad793dfb11c287f366377cbc561acedef6c9d08b1557f463484eda41a84e

3 years agoRemove a NEVER() macro in ALTER TABLE due to an
drh [Wed, 13 Oct 2021 14:01:44 +0000 (14:01 +0000)] 
Remove a NEVER() macro in ALTER TABLE due to an
obscure case of a nested CTE inside an UPDATE within a
trigger.  dbsqlfuzz e89174cbfad2d904f06b5e24df0a22510b6a1c1e

FossilOrigin-Name: 9e2f06b84f9942772c30bed2ac71b3296c9adf9661dbf8916d56996253ee8d28

3 years agoThe sqlite3_result_text() routine (and similar) should record OOM errors
drh [Wed, 13 Oct 2021 13:00:34 +0000 (13:00 +0000)] 
The sqlite3_result_text() routine (and similar) should record OOM errors
in addition to SQLITE_TOOBIG errors.
dbsqlfuzz

FossilOrigin-Name: eca434362652fe2edd6090b29417b35bc88a170609810aa9d266f6fc27baeab8

3 years agoFix the group_concat() inverse function implementation so that it correctly
drh [Tue, 12 Oct 2021 22:55:04 +0000 (22:55 +0000)] 
Fix the group_concat() inverse function implementation so that it correctly
handles BLOB inputs when database text encoding is UTF16.

FossilOrigin-Name: 38a1326b4bd11bbe2846990d099c28520d17ab4cace1af67248c2472f89df929

3 years agoFix an incorrect assert() in SQLITE_ENABLE_SORTER_REFERENCES logic - a new
drh [Tue, 12 Oct 2021 18:05:55 +0000 (18:05 +0000)] 
Fix an incorrect assert() in SQLITE_ENABLE_SORTER_REFERENCES logic - a new
assert() introduced 5 days ago by [87e2f5eb436fc448].

FossilOrigin-Name: 7cfc839e5f1f28514cba7d11b0c0eb56d5ea65caacb8893dcf9fcf2d409e2ba5

3 years agoFix a use-after-free in fts3 that could follow an optimize() in the middle of a SELEC...
dan [Tue, 12 Oct 2021 11:30:07 +0000 (11:30 +0000)] 
Fix a use-after-free in fts3 that could follow an optimize() in the middle of a SELECT statement when the hash table is non-empty.

FossilOrigin-Name: 8124b2ceb71447157283b16f9a7fa6e250003b9ddf1c1b45f91db64aed79b5da

3 years agoFix another harmless compiler warning for MSVC.
mistachkin [Tue, 12 Oct 2021 02:26:32 +0000 (02:26 +0000)] 
Fix another harmless compiler warning for MSVC.

FossilOrigin-Name: b54c0db0fd686b85269cf4c301c9b483c5272269d0cd69a1c7141a91101192f0

3 years agoFix harmless compiler warnings in the debug build for MSVC.
mistachkin [Tue, 12 Oct 2021 02:17:39 +0000 (02:17 +0000)] 
Fix harmless compiler warnings in the debug build for MSVC.

FossilOrigin-Name: 1ceb73f316ddc736aebd1e82ef3a0d9c173d025ac5b7fcfbde0a65a0eeb60a4b

3 years agoFail a schema parse if a virtual table or view has a positive integer
drh [Mon, 11 Oct 2021 15:54:05 +0000 (15:54 +0000)] 
Fail a schema parse if a virtual table or view has a positive integer
rootpage.

FossilOrigin-Name: 02656760406add06303afc94eaf9f2be021cbdbc7ac1ca79b139a7d2de9c0dc5

3 years agoUse the IsOrdinaryTable() macro, not a test of tnum, to distinguish tables
drh [Mon, 11 Oct 2021 15:21:42 +0000 (15:21 +0000)] 
Use the IsOrdinaryTable() macro, not a test of tnum, to distinguish tables
from views and virtual tables.

FossilOrigin-Name: 6189b7809d774bf697d14e27a4bd961df5c318d261dce97db7801ce83f12c59a

3 years agoNew test cases added to test/fuzzdata8.db
drh [Mon, 11 Oct 2021 09:48:59 +0000 (09:48 +0000)] 
New test cases added to test/fuzzdata8.db

FossilOrigin-Name: 2e475fecadc6d9e9a0537435827f56a5c7345f69a9b713d7812da4c9a0f27a96

3 years agoFix an over-zealous assert().
drh [Mon, 11 Oct 2021 09:39:42 +0000 (09:39 +0000)] 
Fix an over-zealous assert().

FossilOrigin-Name: e2bb82a4095427eb810903180fa27fb85b52144bdcfe33388352638428d017f5

3 years agoDetect any attempt to use an INDEXED BY clause on a CTE and report an
drh [Sat, 9 Oct 2021 16:00:56 +0000 (16:00 +0000)] 
Detect any attempt to use an INDEXED BY clause on a CTE and report an
error.

FossilOrigin-Name: 35a9de2c97b9a386070e7827a0842bb1caf3af69ea0d6f67ce2a50be3426fb63

3 years agoFurther to the previous check-in, remove the "harmless()" macro definition as
drh [Fri, 8 Oct 2021 18:15:50 +0000 (18:15 +0000)] 
Further to the previous check-in, remove the "harmless()" macro definition as
it is no longer used.

FossilOrigin-Name: b8c9a54664a87ac464b413390572c3feb912e1efc9c8a78c61f1b370e2165c05

3 years agoRemove a "harmless()" macro that is no longer relevant.
drh [Fri, 8 Oct 2021 18:12:37 +0000 (18:12 +0000)] 
Remove a "harmless()" macro that is no longer relevant.

FossilOrigin-Name: 87c357c60168fdc52c82382aa7288d66886f5fbe2ae6af68344dbcfdbca9069b

3 years agoAdd support for "PRAGMA writable_schema=RESET".
drh [Fri, 8 Oct 2021 16:39:33 +0000 (16:39 +0000)] 
Add support for "PRAGMA writable_schema=RESET".

FossilOrigin-Name: a51b305bd068f8d8e85b9fc38d61cdf5957f3a2ad2eb2e77015547910088e681

3 years agoImproved detection of database corruption.
drh [Fri, 8 Oct 2021 16:15:17 +0000 (16:15 +0000)] 
Improved detection of database corruption.

FossilOrigin-Name: c7fae46c8a3bd78adc5a01340eff6c1efa75f9384dc7f42cb81717b029e7c56f

3 years agoMinor improvements to comments in the data structure definitions. No
drh [Fri, 8 Oct 2021 10:25:06 +0000 (10:25 +0000)] 
Minor improvements to comments in the data structure definitions.  No
changes to code.

FossilOrigin-Name: e77ac4050cf6c24118ce2af4c075f60e3eeb2dafe6d222c848bc4e541eef7172

3 years agoNew assert() statements to protect the u1 and u2 unions of SrcList.
drh [Thu, 7 Oct 2021 23:04:50 +0000 (23:04 +0000)] 
New assert() statements to protect the u1 and u2 unions of SrcList.

FossilOrigin-Name: 9b91fbcfcc14048f7d0755d47d9b7f9212fa2eaa6f3c04f417fa16c3a47943bf

3 years agoProtect access to the Expr.y union using nearby assert()s and branches.
drh [Thu, 7 Oct 2021 20:46:29 +0000 (20:46 +0000)] 
Protect access to the Expr.y union using nearby assert()s and branches.

FossilOrigin-Name: 87e2f5eb436fc448427b0e24fb70f29688796b513b8c7b12f1a21540dae1e56d

3 years agoBreak the tcl release tests into smaller units to better take advantage of multi...
dan [Thu, 7 Oct 2021 19:27:17 +0000 (19:27 +0000)] 
Break the tcl release tests into smaller units to better take advantage of multi-processor systems.

FossilOrigin-Name: 03cef1c30d96cd42682f57667bb3072c7643ef43fe05eda2d8b82c30789234af

3 years agoProtect all accesses to the Expr.x union using nearby assert()s and branches.
drh [Thu, 7 Oct 2021 17:43:30 +0000 (17:43 +0000)] 
Protect all accesses to the Expr.x union using nearby assert()s and branches.

FossilOrigin-Name: 8eaa1d4a98b24adf245bbd2fe9212aa6a924a0f09c445906d7f87574f36a7423

3 years agoFix an incorrect assert() on PRAGMA table_xinfo added by the previous check-in.
drh [Thu, 7 Oct 2021 14:19:32 +0000 (14:19 +0000)] 
Fix an incorrect assert() on PRAGMA table_xinfo added by the previous check-in.

FossilOrigin-Name: f85cb287c52baa729aeb223038e979a3b74a1eb3d97bf59c01f5417998204f84

3 years agoProtect all accesses to the FuncDef.u and Expr.u unions using nearby
drh [Thu, 7 Oct 2021 13:40:29 +0000 (13:40 +0000)] 
Protect all accesses to the FuncDef.u and Expr.u unions using nearby
assert()s or branches.

FossilOrigin-Name: 9af863f065e0bef491c2ab7525194505f9516f4e6dfc789d2e3a9d2c2438533a

3 years agoProtect every access to the Table.u union using a nearby assert() or branch.
drh [Thu, 7 Oct 2021 12:11:20 +0000 (12:11 +0000)] 
Protect every access to the Table.u union using a nearby assert() or branch.

FossilOrigin-Name: 50e08338aed7ac0cee600098d2ecd4b3b7bfd31a597bb26773badf3d2e2582c8

3 years agoFix a macro typo introduced by [5da112c02f9e8d0b] that prevented coverage
drh [Wed, 6 Oct 2021 10:36:56 +0000 (10:36 +0000)] 
Fix a macro typo introduced by [5da112c02f9e8d0b] that prevented coverage
tests from working.

FossilOrigin-Name: 566e6974892ebd3d3de8d77b24655257a5efe14434c553e1a25fc680b201b336

3 years agoOnce corner case for the fix at [8b24c177061c3836] was not quite right.
drh [Wed, 6 Oct 2021 10:04:04 +0000 (10:04 +0000)] 
Once corner case for the fix at [8b24c177061c3836] was not quite right.
Caught overnight by both OSSFuzz and dbsqlfuzz and repaired here.

FossilOrigin-Name: 79e90a8225b90593e384eab49a8d1d3c93a3deaf2739dcc30f6c88852df80d04

3 years agoFix a harmless typo in a comment.
drh [Tue, 5 Oct 2021 22:51:26 +0000 (22:51 +0000)] 
Fix a harmless typo in a comment.
[forum:/forumpost/218c116fdf|forum post 218c116fdf].

FossilOrigin-Name: 8ca0c7d826622c9660ecbd9664eba2bac9bb1b850f96f35d6c959d0acde2309b

3 years agoFix harmless compiler warnings, mostly caused by prior efforts to get static
drh [Tue, 5 Oct 2021 18:59:05 +0000 (18:59 +0000)] 
Fix harmless compiler warnings, mostly caused by prior efforts to get static
analyzers to run without warnings.

FossilOrigin-Name: cddd3b382a118bb16be3a602ae711fe2c2a7d1c673dd30dd3977b67ee555e666

3 years agoFix more harmless static-analyzer warnings. As of this check-in, no warnings
drh [Tue, 5 Oct 2021 18:33:38 +0000 (18:33 +0000)] 
Fix more harmless static-analyzer warnings.  As of this check-in, no warnings
are generated by scan-build for clang-6 or clang-10.

FossilOrigin-Name: a7835bead85b1b18a8affd9835240b0baf9c7af887196bbdcc3f5d58055042fc

3 years agoFixes for harmless static-analyzer warnings. This also makes the code easier
drh [Tue, 5 Oct 2021 17:41:12 +0000 (17:41 +0000)] 
Fixes for harmless static-analyzer warnings.  This also makes the code easier
for humans to understand.

FossilOrigin-Name: 36177a62feeb4fa93ab6e3c6f4dbe1ddcf63bb02f93284abab979da0261b218e

3 years agoFix separate compilation of json1.c, which was apparently broken by
drh [Tue, 5 Oct 2021 15:30:52 +0000 (15:30 +0000)] 
Fix separate compilation of json1.c, which was apparently broken by
check-in [32f33f356931242b].

FossilOrigin-Name: 0c7ece6792d30bdb314e2a6e61d0c051c3619a2d749f8b1df7dc2b1f521388bf

3 years agoSmall change to FTS5 to help static analyzers understand that it is not
drh [Tue, 5 Oct 2021 13:00:50 +0000 (13:00 +0000)] 
Small change to FTS5 to help static analyzers understand that it is not
dereferencing a NULL pointer.

FossilOrigin-Name: 0d853df1b19a0270b2cb0ebdf5df8067572f19ab9a82d047cb047f3f9e850348

3 years agoEnsure that geopoly does not invoke sqlite3_result_error_nomem() with a
drh [Tue, 5 Oct 2021 12:34:54 +0000 (12:34 +0000)] 
Ensure that geopoly does not invoke sqlite3_result_error_nomem() with a
NULL pointer.

FossilOrigin-Name: 2483310d15022b47109b44c86e100f5894be7a45a0568dfef6aea80e6c518654