]> git.ipfire.org Git - thirdparty/sqlite.git/log
thirdparty/sqlite.git
2 years agoThe ability to DROP multiple tables (or views or indexes or triggers) at once, multi-drop
drh [Mon, 4 Mar 2024 18:02:36 +0000 (18:02 +0000)] 
The ability to DROP multiple tables (or views or indexes or triggers) at once,
as implemented by this branch, appears to work.  However, this branch adds over
1000 bytes to the code footprint.  And the changes is significant, adding risk.
The benefit of being able to drop multiple tables in a single statement is not
seen to be enough to overcome those downsides, and so there are no immediate
plans to merge this branch.

FossilOrigin-Name: 1a49788afd90fa4415c6aae4b6bbad68f9306c1df1026762a9d88bcb40e4cd8f

2 years agoRemove an unused line of code.
drh [Sat, 2 Mar 2024 12:17:08 +0000 (12:17 +0000)] 
Remove an unused line of code.

FossilOrigin-Name: 26272590691aee8569a1ea9c233f9b0e55ece63ed167696cc1ecfe3ca2548ba1

2 years agoSimplifications to multi-DROP logic.
drh [Sat, 2 Mar 2024 11:02:04 +0000 (11:02 +0000)] 
Simplifications to multi-DROP logic.

FossilOrigin-Name: e70d6be7511837ff11deac10b335e0f613dfa6dedcab269df9ce61c8d8495d2a

2 years agoImproved rebustness against OOM and corruption.
drh [Sat, 2 Mar 2024 00:29:11 +0000 (00:29 +0000)] 
Improved rebustness against OOM and corruption.

FossilOrigin-Name: 3992f45033d7c1eb7b2bf7790fbf301c495f3e6ef1610a8d66d7357270a227e4

2 years agoWhen doing DROP TABLE or DROP INDEX, use a heap to ensure that the various
drh [Fri, 1 Mar 2024 22:42:16 +0000 (22:42 +0000)] 
When doing DROP TABLE or DROP INDEX, use a heap to ensure that the various
btrees are dropped in the right order for autovacuum.

FossilOrigin-Name: e5bf9556ffd1d0880cc982d389e229246d0f3ddce4264905c6a7dd9c55d735e8

2 years agoRTREE uses multi-DROP to erase shadow tables.
drh [Fri, 1 Mar 2024 19:08:45 +0000 (19:08 +0000)] 
RTREE uses multi-DROP to erase shadow tables.

FossilOrigin-Name: cf8a58d679d0cd30bf7c9208780855f0567b5e086422d59e3254b907923e0dd1

2 years agoOmit unreachable branches in the parser.
drh [Fri, 1 Mar 2024 18:05:57 +0000 (18:05 +0000)] 
Omit unreachable branches in the parser.

FossilOrigin-Name: 90de1f73f9aaab321c0f94b41b6d76ea966d8413d5ad864311d462780e1eadcc

2 years agoFix harmless compiler warning.
drh [Fri, 1 Mar 2024 15:56:51 +0000 (15:56 +0000)] 
Fix harmless compiler warning.

FossilOrigin-Name: 33d3bb848b578d8e7d1029c6603785d90c399d6bc5075d306561fc3c1ab8f202

2 years agoImproved handling of foreign-key constraints on a multi-drop of tables.
drh [Fri, 1 Mar 2024 14:47:01 +0000 (14:47 +0000)] 
Improved handling of foreign-key constraints on a multi-drop of tables.

FossilOrigin-Name: 144e332f44b266a0e594f990088faccd1f0f08fe8e84f2efc9467d99fc14e84b

2 years agoWhen doing a multi-drop, delete btrees beginning with the largest root page
drh [Fri, 1 Mar 2024 12:21:45 +0000 (12:21 +0000)] 
When doing a multi-drop, delete btrees beginning with the largest root page
first and working toward smaller root pages, to avoid problems with root page
renumbering due to autovacuum.

FossilOrigin-Name: 37d4c5e207888b49c224275b05abfc1f63a2d8d2133bcc8970188b15387926ef

2 years agoAttempt to fix multi-object DROP. Working better, but still not perfect.
drh [Thu, 29 Feb 2024 19:40:38 +0000 (19:40 +0000)] 
Attempt to fix multi-object DROP.  Working better, but still not perfect.

FossilOrigin-Name: 02f9fc73eef80f528097581580977aae46942baac2d7fb205c52f7f25472f2a8

2 years agoAdd the ability to DROP one or more objects of the same class
drh [Thu, 29 Feb 2024 13:44:15 +0000 (13:44 +0000)] 
Add the ability to DROP one or more objects of the same class
in a single statement by listing the objects as multiple arguments to the
DROP command.

FossilOrigin-Name: 2266086cf08ee710338667d1cf0b1e81ce7380101707db272ce27124404068a0

2 years agoFix two -Werror=lto-type-mismatch warnings reported in [forum:ef62b57bd5|forum post...
stephan [Thu, 29 Feb 2024 10:55:02 +0000 (10:55 +0000)] 
Fix two -Werror=lto-type-mismatch warnings reported in [forum:ef62b57bd5|forum post ef62b57bd5].

FossilOrigin-Name: 803481f25020f3c25941f1e7d1a8071937820dea951e8798198b0b0fa3fb48ce

2 years agoFix two -Werror=lto-type-mismatch warnings reported in [forum:ef62b57bd5|forum post... lto-type-mismatch
stephan [Thu, 29 Feb 2024 03:45:18 +0000 (03:45 +0000)] 
Fix two -Werror=lto-type-mismatch warnings reported in [forum:ef62b57bd5|forum post ef62b57bd5].

FossilOrigin-Name: 29f94610dc8319709b8d3726a60e2a7a33ffbf4998c681f772da26c9701cc0b0

2 years agoAdd in a VdbeCoverage() macro needed by STAT4 that should have been part of
drh [Wed, 28 Feb 2024 15:32:32 +0000 (15:32 +0000)] 
Add in a VdbeCoverage() macro needed by STAT4 that should have been part of
check-in [63ef234e88857a65].

FossilOrigin-Name: d51c699ae413215d534f954c129691ef5d95d540dc5d4304cbba576c976d931c

2 years agoAlways convert 32-bit integer literals into EP_IntValue notation, even if
drh [Wed, 28 Feb 2024 01:12:21 +0000 (01:12 +0000)] 
Always convert 32-bit integer literals into EP_IntValue notation, even if
they contain "_" separators.

FossilOrigin-Name: 2dfc427f676255cbe189a26bfec2405d41d31ccc4512c55b31e6e633261d7a23

2 years agoFix an eputf() macro without its argument in the CLI.
drh [Tue, 27 Feb 2024 20:19:32 +0000 (20:19 +0000)] 
Fix an eputf() macro without its argument in the CLI.

FossilOrigin-Name: c2f5e257d2cfb91341f5261ed3924dc4ec2a6f854f3692fb416043f5c654a963

2 years agoAdd an assert() to help scan-build recognize that a variable is initialized.
drh [Tue, 27 Feb 2024 19:57:31 +0000 (19:57 +0000)] 
Add an assert() to help scan-build recognize that a variable is initialized.

FossilOrigin-Name: 10d26f1ee8e7624cbb957332b4397d2f1fcdaf916acec93077f2ddd33e01f1d8

2 years agoAdjust a VdbeCoverage() macro in PRAGMA integrity_check to account for the
drh [Tue, 27 Feb 2024 16:36:40 +0000 (16:36 +0000)] 
Adjust a VdbeCoverage() macro in PRAGMA integrity_check to account for the
fact that arguments to the OP_Eq opcode used are never NULL.

FossilOrigin-Name: 759ccea3f6e21493c0153f884b601988efd59e409b113b28f8cf23f59a74e418

2 years agoRemove unreachable branches from the PRAGMA integrity_check enhancement of
drh [Tue, 27 Feb 2024 15:33:54 +0000 (15:33 +0000)] 
Remove unreachable branches from the PRAGMA integrity_check enhancement of
[b736519d3d2e93c7].

FossilOrigin-Name: 6d02fb233fb86f9907cc374d06a7ed71a638091d6e75abc199001c42eab51e5c

2 years agoEnsure memory cells are properly freed before they are overwritten by OP_IntegrityCk.
dan [Tue, 27 Feb 2024 14:31:31 +0000 (14:31 +0000)] 
Ensure memory cells are properly freed before they are overwritten by OP_IntegrityCk.

FossilOrigin-Name: e50acaf934f44f8833bc588e0ae1abd59df907b9a42d4cafd5518427a8c7b627

2 years agoHave "PRAGMA quick_check" compare the number of entries in tables and indexes.
dan [Tue, 27 Feb 2024 11:03:10 +0000 (11:03 +0000)] 
Have "PRAGMA quick_check" compare the number of entries in tables and indexes.

FossilOrigin-Name: b736519d3d2e93c76fa36253143f2664b9dd12e26acba555f0bf9c4d44705499

2 years agoExtend sqlite3.c makefile rule to support EXTRA_SRC=list-of-c-files to append to...
stephan [Tue, 27 Feb 2024 11:02:31 +0000 (11:02 +0000)] 
Extend sqlite3.c makefile rule to support EXTRA_SRC=list-of-c-files to append to the generated sqlite3.c, as discussed in/around [forum:ccda88cf6f1754c5|forum post ccda88cf6f1754c5].

FossilOrigin-Name: 61676f1e18a405e4f3b6007488f2e68f3f55b312c107359ae5e52929f0c104c8

2 years agoAllow "_" characters to appear between any two digits in an integer, real or hexadeci...
dan [Tue, 27 Feb 2024 10:52:41 +0000 (10:52 +0000)] 
Allow "_" characters to appear between any two digits in an integer, real or hexadecimal SQL literal.

FossilOrigin-Name: 0e6700f43f133510c8049b2c5a2610cb3be29da7ed4d39b1fa65dc22c4cf529b

2 years agoBring the extra-src branch up to date with the trunk. extra-src
stephan [Tue, 27 Feb 2024 00:58:51 +0000 (00:58 +0000)] 
Bring the extra-src branch up to date with the trunk.

FossilOrigin-Name: 12ff5c5c4162951a29b638a5bc6cffa50e057c5a5e8f5e9c627af5f4ab1e4cdb

2 years agoThe quote() SQL function should convert +Inf into 9.0e+999 and -Inf into
drh [Mon, 26 Feb 2024 22:28:21 +0000 (22:28 +0000)] 
The quote() SQL function should convert +Inf into 9.0e+999 and -Inf into
-9.0e+999.  See [forum:/forumpost/6675b25108|forum post 6675b25108].

FossilOrigin-Name: 85dd79a6edecfc8c6307c6d215998f76dab086aa14528ddc64eb9955501becfd

2 years agoWhen inserting a 3-byte cell into a btree, ensure that the extra padding byte
drh [Mon, 26 Feb 2024 15:27:33 +0000 (15:27 +0000)] 
When inserting a 3-byte cell into a btree, ensure that the extra padding byte
is 0x00.  This is not necessary for security, as far as I can tell, but it
seems like a reasonable precaution.

FossilOrigin-Name: 5766f1279dab91e030d4dcf5133659e5cedf914a1628ccf00d67d8e50a9957fd

2 years agoAdd the intck extension. For performing incremental integrity-check on a database.
dan [Mon, 26 Feb 2024 12:16:02 +0000 (12:16 +0000)] 
Add the intck extension. For performing incremental integrity-check on a database.

FossilOrigin-Name: 141d8bb059f8987d05d18327b97c4d36e98258f657b41a3d4d8877fe8b4e72e3

2 years agoFix header comments on test scripts. incr-integrity-check
drh [Mon, 26 Feb 2024 11:51:21 +0000 (11:51 +0000)] 
Fix header comments on test scripts.

FossilOrigin-Name: 9fe9670c977ce7ad2c19657783a63998769dbb7741a587889c72ecc04d895793

2 years agoRemove a local variable from sqlite3IntFloatCompare() that was being optimized
drh [Mon, 26 Feb 2024 11:43:44 +0000 (11:43 +0000)] 
Remove a local variable from sqlite3IntFloatCompare() that was being optimized
out anyhow, in order to get back to 100% MC/DC.

FossilOrigin-Name: 52b13d6acbb738b9281f7dd44edd6c3c9585d22d98b1951b7059534fbd16fac0

2 years agoMerge latest trunk changes into this branch.
dan [Mon, 26 Feb 2024 10:56:54 +0000 (10:56 +0000)] 
Merge latest trunk changes into this branch.

FossilOrigin-Name: b6371ff9f5c3d4e87a5b1127a82970202f74c790b828dda20df88dd727bcc9b4

2 years agoMake sure key comprisons are done correctly if the index key contains NaN
drh [Sun, 25 Feb 2024 21:30:33 +0000 (21:30 +0000)] 
Make sure key comprisons are done correctly if the index key contains NaN
values that have not been shifted into NULLs.  That can only happen due to
database corruption, but we need to deal with it nevertheless.

FossilOrigin-Name: 7e4c743f9e6ef33500795543e6db9a77c533025bf00c2ee97abd433a3871b5a1

2 years agoAdd two GIFs that contain the feather logo.
drh [Sat, 24 Feb 2024 19:58:15 +0000 (19:58 +0000)] 
Add two GIFs that contain the feather logo.

FossilOrigin-Name: 5f21e6a8ee709d8c5ec12c45e8dc702a7d0bb041f31b5715e28cd904dfd566b0

2 years agoAdd further tests for the intck module.
dan [Sat, 24 Feb 2024 16:26:15 +0000 (16:26 +0000)] 
Add further tests for the intck module.

FossilOrigin-Name: c253e276b29de28a18270d01b60d95157ce3fc4b37e246d991f9119d26e718d7

2 years agoAdd tests for the new code on this branch.
dan [Fri, 23 Feb 2024 20:51:06 +0000 (20:51 +0000)] 
Add tests for the new code on this branch.

FossilOrigin-Name: 351d46b2373f08bc8033d0902d9f67cd6c8bcc16c0d9f787e4fb279c0a76da87

2 years agoAdd the ".intck ?STEPS_PER_UNLOCK?" command to the shell tool.
dan [Fri, 23 Feb 2024 18:21:51 +0000 (18:21 +0000)] 
Add the ".intck ?STEPS_PER_UNLOCK?" command to the shell tool.

FossilOrigin-Name: cfd051836b72f7d4e38cc9614f6ae5c003de4ce377359fd391adf06fe1ddf6b9

2 years agoTypo fixes [forum:c19bbf245d|reported in the forum]. No code changes.
stephan [Fri, 23 Feb 2024 18:02:31 +0000 (18:02 +0000)] 
Typo fixes [forum:c19bbf245d|reported in the forum]. No code changes.

FossilOrigin-Name: 67d8bae0f695c0839e724c1aadea0a22f736fdd9664d40a29b4d82c91fb89ab3

2 years agoFix detection of surplus index entries when all indexed fields are NULL.
dan [Fri, 23 Feb 2024 17:10:39 +0000 (17:10 +0000)] 
Fix detection of surplus index entries when all indexed fields are NULL.

FossilOrigin-Name: 5f310fb7be450c96f01c21e6fd1377d4a274784377d0bd811922ab63e612bd11

2 years agoFix problems with resuming integrity-check operations on indexes with mixed ASC and...
dan [Fri, 23 Feb 2024 15:13:53 +0000 (15:13 +0000)] 
Fix problems with resuming integrity-check operations on indexes with mixed ASC and DESC columns, and on indexes that contain NULL values.

FossilOrigin-Name: 0f68b35a000ef9f4691c59797c66ed6c3435fc5c503e9d24f891afec6aceeada

2 years agoFix harmless compiler warning seen with MSVC.
mistachkin [Thu, 22 Feb 2024 18:15:08 +0000 (18:15 +0000)] 
Fix harmless compiler warning seen with MSVC.

FossilOrigin-Name: e5db08993127dfc18cc2b621a13cbfef52974f0f504f4d8208093bfad1ffdcc5

2 years agoFix debugging code so that it compiles on MSVC.
drh [Thu, 22 Feb 2024 00:50:54 +0000 (00:50 +0000)] 
Fix debugging code so that it compiles on MSVC.

FossilOrigin-Name: ce5df19dc4aff3fde03ef62261a5e095a16a8f4e46e2924becea4fed56ce49e3

2 years agoFix various issues in sqlite3intck.c.
dan [Wed, 21 Feb 2024 20:58:48 +0000 (20:58 +0000)] 
Fix various issues in sqlite3intck.c.

FossilOrigin-Name: 8a7bfa74525a495f45b1ea212b1718633b637295090d514dd777f9263477d514

2 years agoFix typo in comment. [https://fossil-scm.org/forum/forumpost/cc20266bf2|Fossil forum...
drh [Wed, 21 Feb 2024 20:21:46 +0000 (20:21 +0000)] 
Fix typo in comment. [https://fossil-scm.org/forum/forumpost/cc20266bf2|Fossil forum post cc20266bf2].

FossilOrigin-Name: 7e3c46eed1290964a3e25662686c6ba1149bf8687d05719b684772e65d660c09

2 years agoSimplify the way the restart key is saved internally by the intck extension.
dan [Wed, 21 Feb 2024 19:31:00 +0000 (19:31 +0000)] 
Simplify the way the restart key is saved internally by the intck extension.

FossilOrigin-Name: 0e39962baae8a82a3021077676b792ac30c79426bcd8c075b5e92bee55e8c3a5

2 years agoAdd documentation to ext/intck/sqlite3intck.h.
dan [Wed, 21 Feb 2024 19:17:45 +0000 (19:17 +0000)] 
Add documentation to ext/intck/sqlite3intck.h.

FossilOrigin-Name: 4cc19bd74f05fe92658cc392a1d1afa173d93181a77303af6bc5684436ae832e

2 years agoEnsure intck tests are run by testrunner.tcl.
dan [Wed, 21 Feb 2024 16:15:50 +0000 (16:15 +0000)] 
Ensure intck tests are run by testrunner.tcl.

FossilOrigin-Name: 11d6816c060b6edb9cd61f29297ab95e75e2b46f29c0a796820d94fc13586f6d

2 years agoMerge trunk changes into this branch.
dan [Wed, 21 Feb 2024 16:12:23 +0000 (16:12 +0000)] 
Merge trunk changes into this branch.

FossilOrigin-Name: 63e8846ac1dc1cf1f7071c4634ccbfec3c13560db6afec376cd91515b62430d3

2 years agoHave the intck extension better handle corruption at the b-tree layer.
dan [Tue, 20 Feb 2024 20:18:02 +0000 (20:18 +0000)] 
Have the intck extension better handle corruption at the b-tree layer.

FossilOrigin-Name: ecd775d108f77d39a1303316c1e0f0b0ae3ffc5218222e1ebfe2ef6783829b85

2 years agoUse fewer cycles to generate the "next key" value used by sqlite3_intck_suspend(...
dan [Tue, 20 Feb 2024 18:17:06 +0000 (18:17 +0000)] 
Use fewer cycles to generate the "next key" value used by sqlite3_intck_suspend() function in the intck extension.

FossilOrigin-Name: 95f01426f948cf435d0b400dc7ae06fa699eee32cff498fe77e74a1257a4e09b

2 years agoConsider using "=" and IS operators with even low-quality indexes in cases where...
dan [Tue, 20 Feb 2024 16:04:27 +0000 (16:04 +0000)] 
Consider using "=" and IS operators with even low-quality indexes in cases where they are selected explicitly using an INDEXED BY clause.

FossilOrigin-Name: 43cbbea82132db2d0ddb4f34cc2b6910b3a1243ae6d4e837b1b27bfe91b84834

2 years agoFixes to comments associated with the recent PRAGMA optimize enhancements.
drh [Tue, 20 Feb 2024 15:38:36 +0000 (15:38 +0000)] 
Fixes to comments associated with the recent PRAGMA optimize enhancements.
No changes to code.

FossilOrigin-Name: 27a2113d78b35e324e9aedda7403c96c56ad0bed8c6b139fc5a179e8800b9109

2 years agoRemove an unreachable branch from printf(). Change it into an assert().
drh [Tue, 20 Feb 2024 13:11:27 +0000 (13:11 +0000)] 
Remove an unreachable branch from printf().  Change it into an assert().

FossilOrigin-Name: 4c9886b692706723f4b68f58dfef07ab19b192fd19b953917f23b55655af3e02

2 years agoRemove an unused variable from the merge in the previous check-in.
drh [Tue, 20 Feb 2024 13:10:46 +0000 (13:10 +0000)] 
Remove an unused variable from the merge in the previous check-in.

FossilOrigin-Name: 5c26bf379e18e28d800525bd03e2d5597e2f37674979302f351b99abfc064749

2 years agoEnhancements to PRAGMA optimize and ANALYZE. Add the 0x10000 flag to
drh [Tue, 20 Feb 2024 12:48:00 +0000 (12:48 +0000)] 
Enhancements to PRAGMA optimize and ANALYZE.  Add the 0x10000 flag to
PRAGMA optimize.  ANALYZE now records zero-size partial indexes in the
sqlite_stat1 table.  PRAGMA optimize looks for both growth and shrinkage
in table sizes, and uses tighter bounds (10x rather than 25x) to trigger
a re-analyze.  PRAGMA optimize automatically uses are reasonable
analysis_limit to prevent excessive runtimes.

FossilOrigin-Name: 63ef234e88857a653fa3541e80d59802ceccb806ac8296e8bae79a385b7086f7

2 years agoAnother simplification of the PRAGMA optimize logic for improved coverage. better-pragma-optimize
drh [Tue, 20 Feb 2024 12:14:07 +0000 (12:14 +0000)] 
Another simplification of the PRAGMA optimize logic for improved coverage.

FossilOrigin-Name: 6c5a0c85454e3c658e51fab611c169c034447174022eebc52fd8619b528a4765

2 years agoMinor fixes.
drh [Mon, 19 Feb 2024 23:58:26 +0000 (23:58 +0000)] 
Minor fixes.

FossilOrigin-Name: ed5afebc410e3d430e2428d35f027bffb218e5f11036a42f97b080153e89016e

2 years agoFix a minor hiccup in the computation of the number of btrees to be scanned.
drh [Mon, 19 Feb 2024 20:47:59 +0000 (20:47 +0000)] 
Fix a minor hiccup in the computation of the number of btrees to be scanned.

FossilOrigin-Name: 91302d9b2720d6b5184e1c24db55d351544adfde4b3d2ddcdc1561f79f11985a

2 years agoUse more efficient SQL to verify that indexes contain entries that match their tables.
dan [Mon, 19 Feb 2024 20:15:44 +0000 (20:15 +0000)] 
Use more efficient SQL to verify that indexes contain entries that match their tables.

FossilOrigin-Name: c01e008c28895e50b14531b2a1f3f1110aab3b54df41ebdbd416fbac7b1bba94

2 years agoIf there is no mention of a table in sqlite_stat1, use OP_Rewind to see if
drh [Mon, 19 Feb 2024 20:12:30 +0000 (20:12 +0000)] 
If there is no mention of a table in sqlite_stat1, use OP_Rewind to see if
the table is empty prior to invoking ANALYZE.

FossilOrigin-Name: 0cc93b19de597866292e0696f89fbd0e22a6cbb374678f5cc096fb889210fe3c

2 years agoIn PRAGMA optimize, scale back the analysis_limit when many different tables
drh [Mon, 19 Feb 2024 19:56:40 +0000 (19:56 +0000)] 
In PRAGMA optimize, scale back the analysis_limit when many different tables
and indexes must be scanned.

FossilOrigin-Name: 636615358aebfef80a657d09f15f608df9e64882b2aaa5574ce31a4f1c71fd70

2 years agoMerge trunk fixes into the better-optimize branch.
drh [Mon, 19 Feb 2024 18:55:32 +0000 (18:55 +0000)] 
Merge trunk fixes into the better-optimize branch.

FossilOrigin-Name: 2cf78a5b5fce7f2d49ce185d27f50722c91a1d6c91bbcecebd4bb5244a76769f

2 years agoAdd implementation of sqlite3_intck_suspend().
dan [Mon, 19 Feb 2024 18:03:53 +0000 (18:03 +0000)] 
Add implementation of sqlite3_intck_suspend().

FossilOrigin-Name: c36ada868da74e030ff5002de1f3b31b639b0c43714b91c2e5ca0eda16bb6bc2

2 years agoIf a table has one or more rows and it has a partial index has zero rows, optimize-after-shrink
drh [Mon, 19 Feb 2024 16:22:58 +0000 (16:22 +0000)] 
If a table has one or more rows and it has a partial index has zero rows,
still make an entry in the sqlite_stat1 table for the partial index, so that
we know that "PRAGMA optimize" does not need to redo the whole table.

FossilOrigin-Name: e147b18991dd462fff367442acb0504fdf193a31843ed34ec8c1ced30747bf8a

2 years agoSimplifications to PRAGMA optimize to make it easier to use. It always
drh [Mon, 19 Feb 2024 13:50:09 +0000 (13:50 +0000)] 
Simplifications to PRAGMA optimize to make it easier to use.  It always
tries to ANALYZE unanalyzed indexes.  The 0x10000 flag just makes it check
for size changes in all tables.

FossilOrigin-Name: 44ed7f4cd07a88a2fdd303a2c78e6babe01d7344b399bd2b80ed68d75a77aaa2

2 years agoChange the 0x20000 bit (use analysis limit) to 0x10, meaning that this feature
drh [Mon, 19 Feb 2024 13:06:27 +0000 (13:06 +0000)] 
Change the 0x20000 bit (use analysis limit) to 0x10, meaning that this feature
is on by default.  The default analysis limit is changed to 2000 which is
almost always sufficient for accurate analysis results.

FossilOrigin-Name: 4abd47b5917099a2f74e53e12c987da0722304a5e9a93b6d43015c1f45c48444

2 years agoExtend the strerror_r() result type discrepancy check in os_unix.c to include the...
stephan [Mon, 19 Feb 2024 12:20:46 +0000 (12:20 +0000)] 
Extend the strerror_r() result type discrepancy check in os_unix.c to include the Android NDK, as reported in [forum post 3f13857fa4062301|forum:3f13857fa4062301]. The NDK's strerror_r() signature is version-dependent, whereas this change assumes int return (POSIX semantic) across all versions.

FossilOrigin-Name: f18b2524da6bbbcf372b292df52fbe6efa49fd6e1f1f13ef2447279d559f7a08

2 years agoHold a transaction during PRAGMA optimize, for performance.
drh [Sun, 18 Feb 2024 01:12:22 +0000 (01:12 +0000)] 
Hold a transaction during PRAGMA optimize, for performance.

FossilOrigin-Name: d13b79eae6df7f9d1f3b8062ddc75a12ff038196b3d752d2672a9925fa45ca56

2 years agoAdd start of extension for incremental integrity-checks to ext/intck/.
dan [Sat, 17 Feb 2024 20:55:01 +0000 (20:55 +0000)] 
Add start of extension for incremental integrity-checks to ext/intck/.

FossilOrigin-Name: 444e3c9210026da7eae1ed98850722e002433aa2cc77dbc6b6f80327a6b7a390

2 years agoAdd new MASK bits to PRAGMA optimize: 0x70000.
drh [Sat, 17 Feb 2024 16:39:52 +0000 (16:39 +0000)] 
Add new MASK bits to PRAGMA optimize:  0x70000.

FossilOrigin-Name: dd4497062569eec9ddfdaa7d6394c83ff40a7a59c6697a161bc4ff6d8af3bb29

2 years agoFix rounding in zero-precision %f and %g printf conversions.
drh [Sat, 17 Feb 2024 03:32:31 +0000 (03:32 +0000)] 
Fix rounding in zero-precision %f and %g printf conversions.
[forum:/info/393708f4a8|Forum post 393708f4a8].  This bug was
introduced by check-in [32befb224b254639] and first appeared in version 3.43.0.

FossilOrigin-Name: 7fca1bc482fc2456d75392eb42f768fda72631c9070de46b8123b1126e78306f

2 years agoThe PRAGMA optimize command invokes ANALYZE if a table shrinks by 25 times
drh [Sat, 17 Feb 2024 01:12:58 +0000 (01:12 +0000)] 
The PRAGMA optimize command invokes ANALYZE if a table shrinks by 25 times
in addition to if it grows by 25 times.

FossilOrigin-Name: 40532ffba91cf332c1ea4add80184031a9d6e10514d2d9b9a6cfd613091b81f7

2 years agoFix the subtype on the value column from json_each/json_tree for cases
drh [Fri, 16 Feb 2024 21:30:08 +0000 (21:30 +0000)] 
Fix the subtype on the value column from json_each/json_tree for cases
when the value is an array or object.  Fix for the bug reported by
[forum:/forumpost/ecb94cd210|forum post ecb94cd210].

FossilOrigin-Name: 1c33c5db2e05019d1a375109f79ad8588a3c17f81e4f4b8d66c880c3c860e87e

2 years agoRetweak last check-in to retain compile-time checking of xprintf() arguments.
larrybr [Fri, 16 Feb 2024 18:34:21 +0000 (18:34 +0000)] 
Retweak last check-in to retain compile-time checking of xprintf() arguments.

FossilOrigin-Name: 670174916c660b24ba70e96a42984eb65ee52da50e9828bdeca4c9ff4bf92e20

2 years agoWork around a __VA_ARGS__ complaint in fiddle builds.
stephan [Fri, 16 Feb 2024 16:04:31 +0000 (16:04 +0000)] 
Work around a __VA_ARGS__ complaint in fiddle builds.

FossilOrigin-Name: 7d750248c58ccbf87036ea7db053def1c83c7a8ed428a5c47895756302b36200

2 years agoRename the TF_StatsUsed flag to TF_MaybeReanalyze, to more accurately
drh [Fri, 16 Feb 2024 12:57:04 +0000 (12:57 +0000)] 
Rename the TF_StatsUsed flag to TF_MaybeReanalyze, to more accurately
reflect its usage.  No logic changes.

FossilOrigin-Name: b4790da5e0d6f0f617e6c3a17fc2606842e41cab14339392abd335410fec0aa3

2 years agoHandle an OOM case in fts5 code to query tokendata=1 tables.
dan [Fri, 16 Feb 2024 11:41:47 +0000 (11:41 +0000)] 
Handle an OOM case in fts5 code to query tokendata=1 tables.

FossilOrigin-Name: 01222d96b9ab24c7013a2587544304ba32c1f039b08c06a04d8d58ec9c790db0

2 years agoFix a bug in PRAGMA integrity_check introduced by enhancement (8a) in
drh [Tue, 13 Feb 2024 18:41:46 +0000 (18:41 +0000)] 
Fix a bug in PRAGMA integrity_check introduced by enhancement (8a) in
[https://sqlite.org/releaselog/3_42_0.html|release 3.42.0] and first reported by
[forum:/forumpost/ee4f6fa5ab|forum post ee4f6fa5ab].

FossilOrigin-Name: 460353dfff8f2fb03f9c8666d0c367ec7be4cfa96dfcb0cea10f144d043223bb

2 years agoChanges to vtabCallConstructor() to avoid a harmless static analyzer warning
drh [Tue, 13 Feb 2024 17:11:19 +0000 (17:11 +0000)] 
Changes to vtabCallConstructor() to avoid a harmless static analyzer warning
and to help prove that the UAF reported by
[forum:/forumpost/cafbe582e8|forum post cafbe582e8] is a false-positive.

FossilOrigin-Name: 4892440b93306e5a245f18c0d3d295d851e6712260e420016c0d70e12abf8901

2 years agoReplace the assert() that was removed by [f023cb541b5dd72c] because
drh [Mon, 12 Feb 2024 19:12:30 +0000 (19:12 +0000)] 
Replace the assert() that was removed by [f023cb541b5dd72c] because
[1cd5d4623f44af25] made it true again.

FossilOrigin-Name: 189a49f165dfc348a8730ad2b2288b9b2b2089b1de99fa2d515f2a90c9e7bd4e

2 years agoHave rtree avoid keeping a blob handle open following an error.
dan [Mon, 12 Feb 2024 16:12:25 +0000 (16:12 +0000)] 
Have rtree avoid keeping a blob handle open following an error.

FossilOrigin-Name: 1cd5d4623f44af25ab4f5af580354b3ae22cf5de4109e008ca41055125bb708d

2 years agoAdd a new sqlite3FaultSim() to btree for better fault analysis.
drh [Mon, 12 Feb 2024 14:44:35 +0000 (14:44 +0000)] 
Add a new sqlite3FaultSim() to btree for better fault analysis.

FossilOrigin-Name: 2c675bd30568d3c530300beb3fcfaa17c9f063cdcb9a39ac68b9902100f641a6

2 years agoAdd a new sqlite3FaultSim() call in the btree logic, for testing. new-btree-faultsim
drh [Mon, 12 Feb 2024 13:51:08 +0000 (13:51 +0000)] 
Add a new sqlite3FaultSim() call in the btree logic, for testing.

FossilOrigin-Name: e0558f79b8184ea6741fb20b710dab854f5bdb71aa47d5a6701eeb7389540c8c

2 years agoAdd support for the ".testctrl fault_install" dot-command in the CLI when
drh [Mon, 12 Feb 2024 13:28:10 +0000 (13:28 +0000)] 
Add support for the ".testctrl fault_install" dot-command in the CLI when
launched with the --unsafe-testing option.

FossilOrigin-Name: 5ba7fee1a9b49df82387e355d2ab7de58663d3fa824e50717608b27e0f7ac874

2 years agoIn the RTREE extension, allow the xBeginTransaction() entry point to be
drh [Sun, 11 Feb 2024 22:56:12 +0000 (22:56 +0000)] 
In the RTREE extension, allow the xBeginTransaction() entry point to be
invoked multiple times without intervening calls to xEndTransaction().

FossilOrigin-Name: f023cb541b5dd72c996f0574210344179217666a2229bc8d3fe057fdbc5c2245

2 years agoIf a term of an ORDER BY or GROUP BY contains an aggregate function or column,
drh [Sun, 11 Feb 2024 20:53:14 +0000 (20:53 +0000)] 
If a term of an ORDER BY or GROUP BY contains an aggregate function or column,
then it is not an alias that needs to be resolved, so don't try to.  This fixes
a harmless assertion found by dbsqlfuzz.  This yet another problem that
orginated at check-in [6e6b3729e0549de0].

FossilOrigin-Name: d4ec2a5d2297cd9ead0a8768dcf003ea76c74d8d68d88c40f62363f484a4a4d3

2 years agoImproved AggInfo tracing in debug builds. No changes to deliverable code.
drh [Sun, 11 Feb 2024 18:53:48 +0000 (18:53 +0000)] 
Improved AggInfo tracing in debug builds.  No changes to deliverable code.

FossilOrigin-Name: bb31f9c44794e02a46ed3edbcc96eb48c5870d3f82cb404586ded9a3efa7a859

2 years agoFurther clarify sqlite3_exec() callback parameter lifetime.
larrybr [Sat, 10 Feb 2024 03:11:42 +0000 (03:11 +0000)] 
Further clarify sqlite3_exec() callback parameter lifetime.

FossilOrigin-Name: 993a1a843177b19a9cb5598f57d1e05c01e1695f164faaa9ae22810ad4533eba

2 years agoMention limited lifetime of string arrays passed to sqlite3_exec() callback.
larrybr [Thu, 8 Feb 2024 01:19:46 +0000 (01:19 +0000)] 
Mention limited lifetime of string arrays passed to sqlite3_exec() callback.

FossilOrigin-Name: 717f67f3189a59842f5c17a25e8db0e24ec4405886fc22ab6eeb3954fba5a964

2 years agoFix an #endif (added in the wrong place by [8f4b1ceafe4a271b]) so that
drh [Wed, 7 Feb 2024 20:45:38 +0000 (20:45 +0000)] 
Fix an #endif (added in the wrong place by [8f4b1ceafe4a271b]) so that
the build works with SQLITE_OMIT_VIRTUAL_TABLE.

FossilOrigin-Name: 7070924eebce1d089fde911dc0427ab8f3764d57ace24caff2b79954b42d1b51

2 years agoBring test cases into alignment with the latest enhancements.
drh [Wed, 7 Feb 2024 19:52:03 +0000 (19:52 +0000)] 
Bring test cases into alignment with the latest enhancements.

FossilOrigin-Name: cd017c28d516399e25b5ee9e8fcd7390ca2be9128c7c41f1007f37bc01a35717

2 years agoTurns out the branch is reachable, so back out the NEVER().
drh [Wed, 7 Feb 2024 19:17:44 +0000 (19:17 +0000)] 
Turns out the branch is reachable, so back out the NEVER().

FossilOrigin-Name: 0af36a3223d2dabda887830390a603ab4781baca7e2f1698ec6c5f2cf03faf04

2 years agoDetect and respond to an OOM on the jsonStringTerminate() call of
drh [Wed, 7 Feb 2024 14:05:38 +0000 (14:05 +0000)] 
Detect and respond to an OOM on the jsonStringTerminate() call of
jsonReturnStringAsBlob() routine.

FossilOrigin-Name: 881f814c09b6896a448a2360b0b43dc99592ea3a1d72ac359770cbb0a2c7d38a

2 years agoSlight change to OOM handling in JSON to catch a corner case found by
drh [Tue, 6 Feb 2024 18:33:01 +0000 (18:33 +0000)] 
Slight change to OOM handling in JSON to catch a corner case found by
dbsqlfuzz.

FossilOrigin-Name: 6a2b3266c586d12b51e11fe63cda5881be9373207aa16671ab77f547830eb790

2 years agoCorrect docs about the first OFPS VFS's importDb() method being synchronous (it's...
stephan [Tue, 6 Feb 2024 08:59:59 +0000 (08:59 +0000)] 
Correct docs about the first OFPS VFS's importDb() method being synchronous (it's not, whereas the second VFS's importDb() is).

FossilOrigin-Name: ae7505fa5e112f39a329befb35eff6ddf46a53f5deb610906550bf67f56fc157

2 years agoMake explicit that using the importDb() methods of the OPFS VFSes has undefined resul...
stephan [Tue, 6 Feb 2024 08:25:23 +0000 (08:25 +0000)] 
Make explicit that using the importDb() methods of the OPFS VFSes has undefined results if the being-imported db is currently open. Doc changes only.

FossilOrigin-Name: f28b9924b401b359e59a73918a34b29cde719164a6b4ac5a9d23da6294b701bd

2 years agoReturn SQLITE_ABORT if the underlying shadow tables change in the middle of an rtree...
dan [Mon, 5 Feb 2024 17:54:03 +0000 (17:54 +0000)] 
Return SQLITE_ABORT if the underlying shadow tables change in the middle of an rtree query in such a way as to invalidate an rtree internal priority queue entry. This replaces the SQLITE_ABORT_ROLLBACK mechanism added in [af5c4251].

FossilOrigin-Name: 32f85a5ce8e32506ad0cf309c86589958f38d924b4b3de532bec8bdb8e385fad

2 years agoReturn SQLITE_ABORT if the underlying shadow tables change in the middle of an rtree... rtree-fix
dan [Mon, 5 Feb 2024 17:35:36 +0000 (17:35 +0000)] 
Return SQLITE_ABORT if the underlying shadow tables change in the middle of an rtree query in such a way as to invalidate an rtree internal priority queue entry.

FossilOrigin-Name: 478280ef67efed854988ab4f740a38ae1937204c0434ad8da11f1869a12a6d06

2 years agoExtend [d294a23ed6d] to apply to all wasm speedtest1 builds.
stephan [Mon, 5 Feb 2024 03:56:02 +0000 (03:56 +0000)] 
Extend [d294a23ed6d] to apply to all wasm speedtest1 builds.

FossilOrigin-Name: 26f848e5e0ac34e545d2f27cf33abc46eac13e04ed9cd71084b0f7d47136ff97

2 years agowasm: pass the promiser function to the promiser onready() callback to simplify acces...
stephan [Mon, 5 Feb 2024 03:37:54 +0000 (03:37 +0000)] 
wasm: pass the promiser function to the promiser onready() callback to simplify access to it in certain usage patterns.

FossilOrigin-Name: f8a8b9ee2eddf5f875c7c4399e750ccf1941f767560ebc2c88c083560f5aaae0

2 years agowasm: squelch a new (and, in our case, invalid) warning from emcc 3.1.52.
stephan [Mon, 5 Feb 2024 02:36:10 +0000 (02:36 +0000)] 
wasm: squelch a new (and, in our case, invalid) warning from emcc 3.1.52.

FossilOrigin-Name: d294a23ed6d1d2b567a02552b8a2e4921cd21891ee86e63f8f9945569e3262d3