]> git.ipfire.org Git - thirdparty/sqlite.git/log
thirdparty/sqlite.git
2 years agoAdd comment on CLI ^C fix (because it is a bit subtle.) cli-no-dump
larrybr [Tue, 18 Apr 2023 22:53:30 +0000 (22:53 +0000)] 
Add comment on CLI ^C fix (because it is a bit subtle.)

FossilOrigin-Name: 19c062f1cd814a33bf9c10928217464cddaea7c3291ff44e605901a86b82a06d

2 years agoCLI to cease dumping back to OS shel on ^C.
larrybr [Tue, 18 Apr 2023 22:28:48 +0000 (22:28 +0000)] 
CLI to cease dumping back to OS shel on ^C.

FossilOrigin-Name: 7b1f635268bd5b093b22f832c3ac9e5d642d1aac5ebc620619be5a24930feb83

2 years agoEnsure that the VACUUM command is not confused by alternative encodings when
drh [Tue, 18 Apr 2023 15:21:55 +0000 (15:21 +0000)] 
Ensure that the VACUUM command is not confused by alternative encodings when
it is the first command run on new database connection.
[forum:/forumpost/09503b4d33|Forum post 09503b4d33].

FossilOrigin-Name: 8b0fe63f873661037351fc1eba6071b98b5c97a0fc8bd8a504a90d047f78bc0d

2 years agoAnother fix to the indexed expressions in aggregate queries with GROUP BY
drh [Tue, 18 Apr 2023 14:13:54 +0000 (14:13 +0000)] 
Another fix to the indexed expressions in aggregate queries with GROUP BY
enhancement of ticket [99378177930f87bd] and implemented by
check-in [b9190d3da70c4171] to address a problem described by
[forum:/forumpost/f34e32d120|forum post f34e32d120],

FossilOrigin-Name: 5acc3ef83e16a9f2803981a6e61eca62fe177cac4eed1befe2ade3a5977a1eab

2 years agoAdd the --fullsync option to speedtest1.
drh [Tue, 18 Apr 2023 11:35:09 +0000 (11:35 +0000)] 
Add the --fullsync option to speedtest1.

FossilOrigin-Name: 960fe54c8227a376c97bb2a3ba604d97e79e27e51a9798be9d318cf56c04fa99

2 years agoFix an assert() in fts5 that could fail following an OOM or IO error.
dan [Tue, 18 Apr 2023 11:33:35 +0000 (11:33 +0000)] 
Fix an assert() in fts5 that could fail following an OOM or IO error.

FossilOrigin-Name: 49595083ba58e13d404b6a11c28f53768a257c59f3f36be3591438127df7e875

2 years agoWhen CLI -utf8 active, do no translation to MBCS for output to Windows console. plus...
larrybr [Mon, 17 Apr 2023 23:59:15 +0000 (23:59 +0000)] 
When CLI -utf8 active, do no translation to MBCS for output to Windows console. plus code style improvements

FossilOrigin-Name: 25edf6089724bf9f97c796e5abf838ec508ebc132895d8325620c16d63996fef

2 years agoMinor coding style changes.
mistachkin [Mon, 17 Apr 2023 22:28:02 +0000 (22:28 +0000)] 
Minor coding style changes.

FossilOrigin-Name: 481aa3ccf6f12c2c2fd11a1a20d8fb59f4f9b1cd8dcff0586b4f52222463d720

2 years agoWhen CLI -utf8 active, do no translation to MBCS for output to Windows console.
larrybr [Mon, 17 Apr 2023 21:18:53 +0000 (21:18 +0000)] 
When CLI -utf8 active, do no translation to MBCS for output to Windows console.

FossilOrigin-Name: cc1d4296d71ee6e2ba133edc581385e201c89657911c2ed39108843c776633a4

2 years agoFix some problems with using fts5 options 'secure-delete' and detail=none together.
dan [Mon, 17 Apr 2023 18:32:22 +0000 (18:32 +0000)] 
Fix some problems with using fts5 options 'secure-delete' and detail=none together.

FossilOrigin-Name: 4d3f27ba90aa59837e49ceaae9f36cad426af3a33707d85d1bb848fc1bda6fed

2 years agoFix problems handling corrupt records in new fts5 code.
dan [Mon, 17 Apr 2023 11:41:42 +0000 (11:41 +0000)] 
Fix problems handling corrupt records in new fts5 code.

FossilOrigin-Name: 2f63d4a8bac6dc72197df32efd84c148adbc4794943088dff08da57b15dd7900

2 years agoFix an assert() in fts5 that may be true when dealing with corrupt records.
dan [Mon, 17 Apr 2023 10:39:51 +0000 (10:39 +0000)] 
Fix an assert() in fts5 that may be true when dealing with corrupt records.

FossilOrigin-Name: e8de2774463c07b76cd6b9a44ab32a583fe973f42a21b21af46fe82ab177c1b8

2 years agoChange a memcpy() to memmove() in new fts5 code.
dan [Sat, 15 Apr 2023 21:00:55 +0000 (21:00 +0000)] 
Change a memcpy() to memmove() in new fts5 code.

FossilOrigin-Name: 8de4542553ae20947787b4daf5e88bbe69f815679960e700e19f9c1148234b08

2 years agoFix a use-after-free that could follow an OOM or IO error in fts5 when using 'secure...
dan [Sat, 15 Apr 2023 19:58:58 +0000 (19:58 +0000)] 
Fix a use-after-free that could follow an OOM or IO error in fts5 when using 'secure-delete' mode.

FossilOrigin-Name: 904be83d9f3dd4b21a3aa47dde337b5c045b925ffdde4bccd1f8e8fdbef68c18

2 years agoAvoid dropping the error code following an OOM in fts5 when using 'secure-delete...
dan [Sat, 15 Apr 2023 19:13:51 +0000 (19:13 +0000)] 
Avoid dropping the error code following an OOM in fts5 when using 'secure-delete' mode.

FossilOrigin-Name: 9ee24a499c7b4a048f269f1c03c7c0b22b2898a3c23ea3e2511c2ba0342afa30

2 years agoAdd -utf8 option to CLI, for improved console behavior on Windows.
larrybr [Sat, 15 Apr 2023 17:56:43 +0000 (17:56 +0000)] 
Add -utf8 option to CLI, for improved console behavior on Windows.

FossilOrigin-Name: 414010d2366477285cb238f7af1e3d511ab4cda4bd4493441bd9868387dd5b66

2 years agoAdd the 'secure-delete' option to the fts5 extension. For configuring fts5 to delete...
dan [Sat, 15 Apr 2023 17:47:32 +0000 (17:47 +0000)] 
Add the 'secure-delete' option to the fts5 extension. For configuring fts5 to delete old entries directly from the full-text index instead of using delete keys.

FossilOrigin-Name: 394980e4fe12125460ab14da41edae9089a4da332a46f3124bf0b9778793791f

2 years agoFor CLI -utf8, set output codepage too. Adjust PP vars so that the code can be entire...
larrybr [Sat, 15 Apr 2023 16:12:46 +0000 (16:12 +0000)] 
For CLI -utf8, set output codepage too. Adjust PP vars so that the code can be entirely omitted for targets pretending to be "WIN32" but not quite doing so.

FossilOrigin-Name: 543594a7277b12d1c58af8e3cba3841667cf924172995536489ce7da704a11d7

2 years agoFix stray edits in comments in last check-in.
larrybr [Fri, 14 Apr 2023 21:34:58 +0000 (21:34 +0000)] 
Fix stray edits in comments in last check-in.

FossilOrigin-Name: fa3ce7f013d40147f012e26d0ede75b134174f144d314336310c9ac585e23fb7

2 years agoSet CLI -utf8 option and build with line-editing package to be mutually exclusive...
larrybr [Fri, 14 Apr 2023 21:23:08 +0000 (21:23 +0000)] 
Set CLI -utf8 option and build with line-editing package to be mutually exclusive. Integration of console-invasive UTF-8 handling with line-editing takeover of console may come later.

FossilOrigin-Name: 047344a91583f273a55fe3659bb8020ffc947c05c4274fbda54ee0608e62adb1

2 years agoCure CLI double-prompting (by ditching gcc fgetws()), general cleanup. Work remaining...
larrybr [Fri, 14 Apr 2023 19:56:32 +0000 (19:56 +0000)] 
Cure CLI double-prompting (by ditching gcc fgetws()), general cleanup. Work remaining is to avoid effect of -utf8 when a line editor is linked/used as part of CLI.

FossilOrigin-Name: 73a5f54231e9f6ad8f013df3987ea48c516080f9193ed873b56f982ee75658c2

2 years agoFurther tests for fts5 secure-delete mode. fts5-secure-delete
dan [Fri, 14 Apr 2023 18:00:03 +0000 (18:00 +0000)] 
Further tests for fts5 secure-delete mode.

FossilOrigin-Name: c5a47063b7971868ebbb3f0718434dd6bd22d01c43697f48941df9aae3885abc

2 years agoAdd extra OOM test for the new code on this branch.
dan [Fri, 14 Apr 2023 17:00:29 +0000 (17:00 +0000)] 
Add extra OOM test for the new code on this branch.

FossilOrigin-Name: 846ae7e099ce67dab6b5df0ad5648a01d7bf7f2acf8312d817ed8505d4ea5aec

2 years agoAdd tests for the new feature on this branch.
dan [Fri, 14 Apr 2023 16:11:05 +0000 (16:11 +0000)] 
Add tests for the new feature on this branch.

FossilOrigin-Name: 0268d1a59316d169927cbd4c562725e46a9023b7d7123ade911c12203e222adf

2 years agoFix SQLITE_OMIT_VIRTUALTABLE builds of testfixture.
dan [Fri, 14 Apr 2023 14:36:34 +0000 (14:36 +0000)] 
Fix SQLITE_OMIT_VIRTUALTABLE builds of testfixture.

FossilOrigin-Name: 430ec1a61507d8afd8adc161f577f32856dba21506db9717fae3d14570786439

2 years agoUpdate test script recoverbuild.test so that it may be run using old test harnesses...
dan [Fri, 14 Apr 2023 13:34:26 +0000 (13:34 +0000)] 
Update test script recoverbuild.test so that it may be run using old test harnesses that run more than one test script in a process.

FossilOrigin-Name: 5135aab0c0ab39f3b9cc84efbbc57f7266b42d98134fc0c5dace06f707374195

2 years agoWhen setting the column types on a subquery, ensure that the COLFLAG_HASCOLL
drh [Fri, 14 Apr 2023 10:40:50 +0000 (10:40 +0000)] 
When setting the column types on a subquery, ensure that the COLFLAG_HASCOLL
flag is cleared from column names from when the collating sequence name has
been removed.
[forum:/forumpost/6916dacf83|Forum post 6916dacf83].

FossilOrigin-Name: 8d9dcd7cfdd53034e21cdb2cb997b6f5fe3207ca5d0d7a0b841b8a68e6ce8624

2 years agoFix a cosmetic indentation issue.
drh [Fri, 14 Apr 2023 10:35:29 +0000 (10:35 +0000)] 
Fix a cosmetic indentation issue.

FossilOrigin-Name: 90deb84486494b903bab065fbf0174b56483c190353992b907359661393f2c54

2 years agoAvoid double de-quoting of table names when processing RESTRICT actions
drh [Fri, 14 Apr 2023 00:20:16 +0000 (00:20 +0000)] 
Avoid double de-quoting of table names when processing RESTRICT actions
in foreign key constraints.
[https://bugs.chromium.org/p/chromium/issues/detail?id=1405220|Chromium 1405220].

FossilOrigin-Name: bb2b5ab172f0751c00343facf36fb12db10c88220caece31849f2711f12293d9

2 years agoFix an obscure issue with ALTER TABLE RENAME that comes up with triggers
drh [Thu, 13 Apr 2023 18:44:59 +0000 (18:44 +0000)] 
Fix an obscure issue with ALTER TABLE RENAME that comes up with triggers
that have UPDATE statements that contain errors.
[forum:/forumpost/ff3840145a|Forum post ff3840145a].

FossilOrigin-Name: c4845a7c5f7f219848d3ee32eef0f9c69ad6dc6e8509da84d612f41e1e05f007

2 years agoAdd extra test cases to window1.test.
dan [Thu, 13 Apr 2023 14:53:19 +0000 (14:53 +0000)] 
Add extra test cases to window1.test.

FossilOrigin-Name: ebc844fbfb046c5789efe21fd607c9301cb7b3d78edef72b2926b8c889b048a9

2 years agoFix a code-generator issue associated with very unusual use of window
drh [Thu, 13 Apr 2023 14:50:50 +0000 (14:50 +0000)] 
Fix a code-generator issue associated with very unusual use of window
functions.  Both the expr.c or the window.c changes will each
independently fix the problem.  They are both included in this patch for
defense in depth.  [forum:/forumpost/0d48347967|Forum post 0d48347967].

FossilOrigin-Name: 1ba22631a7831e3562eda0eb6a5edf7f009c85c7ab4451d9eacd13ef0fb6036a

2 years agoGet CLI utf8_fgets() to not consume more input than it returns. Get console setup...
larrybr [Thu, 13 Apr 2023 14:14:27 +0000 (14:14 +0000)] 
Get CLI utf8_fgets() to not consume more input than it returns. Get console setup restoration to happen for all non-crash exits.

FossilOrigin-Name: b4fa233d3dda54fa83771844cf5156bf1275c687925340af17a7713a9400dfef

2 years agoUnwrap the loop in the WAL hash function.
drh [Wed, 12 Apr 2023 20:23:03 +0000 (20:23 +0000)] 
Unwrap the loop in the WAL hash function.

FossilOrigin-Name: eb94ae13206762a42ddad12e0d1461df83e9759e44a369f188cd3aad82f211c4

2 years agoAutomatically set HAVE_PREAD and HAVE_PWRITE on linux, as has been done in
drh [Wed, 12 Apr 2023 19:40:00 +0000 (19:40 +0000)] 
Automatically set HAVE_PREAD and HAVE_PWRITE on linux, as has been done in
MacOS for a long time now.

FossilOrigin-Name: 2f7a36d2c374100019bd9d38aea51ea10cfcf9b1f0330ba084a75f0773df8ebf

2 years agoSmall performance enhancement to integer-to-text conversion.
drh [Wed, 12 Apr 2023 18:57:50 +0000 (18:57 +0000)] 
Small performance enhancement to integer-to-text conversion.

FossilOrigin-Name: cfb3dba9b015ce7a75857978bfd2540b4d5be985d9d2ec4a5842b3089ed3da60

2 years agoAvoid leaking a database handle in test script rbuexlock.test.
dan [Wed, 12 Apr 2023 18:18:28 +0000 (18:18 +0000)] 
Avoid leaking a database handle in test script rbuexlock.test.

FossilOrigin-Name: 2edf98d128cabc0c9de1295470d7f87eb64e4cc1f13344fe3c198fcf9c7bf019

2 years agoRemove temporary debugging code accidentally left on this branch.
dan [Wed, 12 Apr 2023 18:06:43 +0000 (18:06 +0000)] 
Remove temporary debugging code accidentally left on this branch.

FossilOrigin-Name: 0a0f64870feaf95d2673efc8884ad1236d9bbf9bdb94364f8d2602221bd36ff3

2 years agoWIP: CLI option to take control of console on Windows and make it support UTF-8 input...
larrybr [Wed, 12 Apr 2023 17:54:52 +0000 (17:54 +0000)] 
WIP: CLI option to take control of console on Windows and make it support UTF-8 input pasting (or typing). Needs work to become robust per "ToDo:".

FossilOrigin-Name: 824382393d92d9eb6df8701de7c263280150569a708759c4a539acc6d8d38821

2 years agoAdd the 'secure-delete' option to fts5. Used to configure fts5 to aggressively remove...
dan [Wed, 12 Apr 2023 17:40:44 +0000 (17:40 +0000)] 
Add the 'secure-delete' option to fts5. Used to configure fts5 to aggressively remove old full-text-index entries belonging to deleted or updated rows.

FossilOrigin-Name: 4240fd09b717dbc69dffe3b88ec9149777ca4c3efa12f282af65be3af6fa5bb0

2 years agoNew #ifdef to enable building with -DSQLITE_OMIT_WINDOWFUNC.
drh [Tue, 11 Apr 2023 19:38:47 +0000 (19:38 +0000)] 
New #ifdef to enable building with -DSQLITE_OMIT_WINDOWFUNC.

FossilOrigin-Name: e1ff83fa2565334b28bd0d6582088c4ae0d2d9a590d973615a4a598683fe419c

2 years agoRemove an ALWAYS() that can sometimes be false. Add a test case that makes
drh [Tue, 11 Apr 2023 15:06:20 +0000 (15:06 +0000)] 
Remove an ALWAYS() that can sometimes be false.  Add a test case that makes
the test false.

FossilOrigin-Name: c8fb143d64d8e823684cd26799080da4b42bef121ca3c6315b1803a593490926

2 years agoBetter handling of OOM errors in the cursor-hint logic.
drh [Tue, 11 Apr 2023 02:10:34 +0000 (02:10 +0000)] 
Better handling of OOM errors in the cursor-hint logic.
dbsqlfuzz 60cd5fff91974af91c2c3692beb4a2d7fdafef46

FossilOrigin-Name: 68fcfb58df837b40e401dfa4e505f4f0b87554b9cfeb2c527f3558348b73c1be

2 years agoFor sha3 extension, mention NIST standard implemented.
larrybr [Mon, 10 Apr 2023 23:21:19 +0000 (23:21 +0000)] 
For sha3 extension, mention NIST standard implemented.

FossilOrigin-Name: 529ab138a438379f0cbd170bff5211aee1c327a1b3119a714ee15f68fd2239f3

2 years agoNew assert() statements to validate the parameters to
drh [Mon, 10 Apr 2023 18:44:00 +0000 (18:44 +0000)] 
New assert() statements to validate the parameters to
sqlite3BtreeCursorHint().  Fix a problem with the construction of those
parameters discovered by
[forum:/forumpost/0b53708c95|forum post 0b53708c95].

FossilOrigin-Name: 4c5a3c5fb351cc1c2ce16c33314ce19c53531f09263f87456283d9d756002f9d

2 years agoSync the vt02.c test virtual table with TH3, in order to pull in the fix
drh [Mon, 10 Apr 2023 13:20:51 +0000 (13:20 +0000)] 
Sync the vt02.c test virtual table with TH3, in order to pull in the fix
for long delays when there are huge OFFSET values.

FossilOrigin-Name: 49ba030080dd00b4fdf788fd3da057b333e705fa0fe37d653e2461bf96ca3785

2 years agoFix an assertion fault that can occur when compiling with both
drh [Sun, 9 Apr 2023 20:44:09 +0000 (20:44 +0000)] 
Fix an assertion fault that can occur when compiling with both
SQLITE_ENABLE_UNKNOWN_SQL_FUNCTIONS and SQLITE_ENABLE_STAT4.

FossilOrigin-Name: 9ff69e599817610d14948a3eebcc4d3c18245f78a1433c23ae659211cbbdb017

2 years agoFix a faulty assert() in whereRangeScanEst() that should only apply if there
drh [Sun, 9 Apr 2023 10:09:28 +0000 (10:09 +0000)] 
Fix a faulty assert() in whereRangeScanEst() that should only apply if there
are not prior errors.
dbsqlfuzz 567ad91132879cbab8172b38c6a68ad40fa8d650.

FossilOrigin-Name: 8ba9b08bd976ed2c024f5f378b4dd40a55226e950af77c476c21273fccaf7e26

2 years agoFix a couple harmless compiler warnings seen with MSVC.
mistachkin [Sat, 8 Apr 2023 19:27:03 +0000 (19:27 +0000)] 
Fix a couple harmless compiler warnings seen with MSVC.

FossilOrigin-Name: 1b864a370fd04bba11487e3dab0388394bc71e1f3f006f7bd9d64eefe04e8b61

2 years agoFix a typo in [83e84531b46814ae] that changed the value of
drh [Sat, 8 Apr 2023 19:23:13 +0000 (19:23 +0000)] 
Fix a typo in [83e84531b46814ae] that changed the value of
SQLITE_DBCONFIG_STMT_SCANSTATUS.

FossilOrigin-Name: b71776539183e5fd8678ce8f3272180d3dbb8214ed7b7bb24d35c0ba027a6ac5

2 years agoFaster implementation of keywordCode() - the routine that determines if an
drh [Sat, 8 Apr 2023 16:51:08 +0000 (16:51 +0000)] 
Faster implementation of keywordCode() - the routine that determines if an
identifier is really a keyword and if so, which keyword.

FossilOrigin-Name: 0ff3d3d53709b7f18bf01ded1f988e41b7f8471072cf4f2702a3a8b79964be3f

2 years agoFix a harmless compiler warning.
drh [Sat, 8 Apr 2023 13:31:17 +0000 (13:31 +0000)] 
Fix a harmless compiler warning.

FossilOrigin-Name: c9559ba62191fe7fa2a718233afaa841e2594d1fc833314bf5b0a6b775e87c35

2 years agoOptimizations to btree.c save about 4.5 million CPU cycles:
drh [Sat, 8 Apr 2023 13:01:34 +0000 (13:01 +0000)] 
Optimizations to btree.c save about 4.5 million CPU cycles:
(1) Clone insertCell() into a separate insertCellFast() routine for
use by sqlite3BtreeInsert().  (2) Mark allocateSpace() as always-inline.
(3) Improved coalesence of adjacent free blocks in pageFreeArray().

FossilOrigin-Name: 5c12c400fe8eb4e86e14c69a6c34d0d78d9861e5d40a36c6a596a81c6dd65977

2 years agoGuard against oversized cells in the newly enhanced pageFreeArray(). btree-freespace-opt
drh [Fri, 7 Apr 2023 18:27:32 +0000 (18:27 +0000)] 
Guard against oversized cells in the newly enhanced pageFreeArray().

FossilOrigin-Name: 2dcdbb50356edbd3a79e53fa0bee4e700c2bdea78e27173b62ddabe44b066726

2 years agoAdd NEVER on an unreachable branch.
drh [Fri, 7 Apr 2023 16:30:33 +0000 (16:30 +0000)] 
Add NEVER on an unreachable branch.

FossilOrigin-Name: 9b3febbd988be05807ada20146d3e196ae17c966722fff049feb32292157bff2

2 years agoFix an assert().
drh [Fri, 7 Apr 2023 15:49:42 +0000 (15:49 +0000)] 
Fix an assert().

FossilOrigin-Name: 7eff46ba97dd8a3d6a5d01d5d61e98a2805deceafa47335eded7d784a8304525

2 years agoTweaks to the new insertCellFast().
drh [Fri, 7 Apr 2023 15:07:58 +0000 (15:07 +0000)] 
Tweaks to the new insertCellFast().

FossilOrigin-Name: 203a581a9177c1083e8d5b49e8ff026af33b5c5e3e144aeda126f07a3a2953bf

2 years agoClone insertCell() into insertCellFast() for use by sqlite3BtreeInsert() for
drh [Fri, 7 Apr 2023 14:33:33 +0000 (14:33 +0000)] 
Clone insertCell() into insertCellFast() for use by sqlite3BtreeInsert() for
a substantial performance increase.

FossilOrigin-Name: f225afd90c8e65661d8b855050f0ee1a8fe4c0f3bcec824aa5a66d906f3c7119

2 years agoFix a problem causing the rbu_exclusive_checkpoint=1 to be ignored with zipvfs databases.
dan [Fri, 7 Apr 2023 14:03:30 +0000 (14:03 +0000)] 
Fix a problem causing the rbu_exclusive_checkpoint=1 to be ignored with zipvfs databases.

FossilOrigin-Name: d8f50b31e8d64fce5141da4a016767a15482703364692a55df346f059fc9d30c

2 years agoSmall performance improvement in freeSpace().
drh [Fri, 7 Apr 2023 13:21:20 +0000 (13:21 +0000)] 
Small performance improvement in freeSpace().

FossilOrigin-Name: 8dc5292ee592f16451441e33ad0800ba10a21ecd63f1f9926d6915a59a1552d3

2 years agoAdd further tests for the rbu_exclusive_lock=1 URI option.
dan [Fri, 7 Apr 2023 11:18:08 +0000 (11:18 +0000)] 
Add further tests for the rbu_exclusive_lock=1 URI option.

FossilOrigin-Name: c07b62bef96bb69e9b1ce08f0084fdce8de981f4d8ea9689c87a41f1e4451ac7

2 years agoIncrease the size of the cache of free blocks inside of pageFreeArray() to
drh [Thu, 6 Apr 2023 20:14:10 +0000 (20:14 +0000)] 
Increase the size of the cache of free blocks inside of pageFreeArray() to
reduce the number of calls to freeSpace().

FossilOrigin-Name: 27c59f1ea789f3ff245f23e79ded5cd71c48e3a51ffbb8c220b51101a4e69fd7

2 years agoWork around a harmless assertion fault associated with
drh [Thu, 6 Apr 2023 17:29:38 +0000 (17:29 +0000)] 
Work around a harmless assertion fault associated with
sqlite3VdbeMemAboutToChange() such that the detection of stale values
in registers is preserved in debugging builds, but we avoid a false-positive
assertion fault in cases involving a virtual table with a LIMIT clause
in an IN-operator loop.
dbsqlfuzz 3fd70d4ab4950acf1deb8f610a7a7c67cd38713b

FossilOrigin-Name: 56ea2c2fe6108d39833ac40957afab59ade01a216639d5bafdeeca53bbf4cd67

2 years agoA prepared statement that aborts due to SQLITE_SCHEMA should not invalidate
drh [Thu, 6 Apr 2023 13:35:42 +0000 (13:35 +0000)] 
A prepared statement that aborts due to SQLITE_SCHEMA should not invalidate
cursors in other prepared statements that are already running.
See [forum:/forumpost/cae4367d9b|forum post cae4367d9b] for the original
trouble report.

FossilOrigin-Name: 857d0f5e16ba69ac9e5ee581befca2f7ed933edfe6e36396b10dae7979b44a57

2 years agoIn the CLI, during error processing while looking for a word boundary,
drh [Thu, 6 Apr 2023 01:05:52 +0000 (01:05 +0000)] 
In the CLI, during error processing while looking for a word boundary,
avoid being deceived by malformed input that has a very long sequence
of 0x80 characters.
[forum:/forumpost/ab93a23ba1|forum post ab93a23ba1].

FossilOrigin-Name: 82609d5a2d4eba741d48ea265f4e749578964961903c072c7b222ffe2aefaa3c

2 years agoIn the zipfile extension, defend against corrupt ZIP files that contain
drh [Thu, 6 Apr 2023 00:59:41 +0000 (00:59 +0000)] 
In the zipfile extension, defend against corrupt ZIP files that contain
a zero-length filename.
[forum:/forumpost/b15f5e3ad8|Forum post b15f5e3ad8].

FossilOrigin-Name: 46db2e42a5f9b18da9661ccedca68cb70257ea5c58b33b401db2a5e030c1346a

2 years agoIn the new .scanstatus command in the CLI, make sure the database is opened
drh [Thu, 6 Apr 2023 00:18:31 +0000 (00:18 +0000)] 
In the new .scanstatus command in the CLI, make sure the database is opened
before invoking sqlite3_db_config().
[forum:/forumpost/6e26dcf544|Forum post 6e26dcf544].

FossilOrigin-Name: 1cd993c45cd6b60e00d1426dd01d63efad13f7258636b5fa694f21499e77955a

2 years agoAdd a test case for the ALWAYS() macro removed by the previous check-in.
drh [Wed, 5 Apr 2023 02:55:08 +0000 (02:55 +0000)] 
Add a test case for the ALWAYS() macro removed by the previous check-in.

FossilOrigin-Name: 68a1a837493a0bc5e0e0f2373ac76cb575078cec08990c017fdcb51a4ba363a1

2 years agoRemove an ALWAYS() that might now be false due to the prior check-in.
drh [Wed, 5 Apr 2023 02:50:00 +0000 (02:50 +0000)] 
Remove an ALWAYS() that might now be false due to the prior check-in.

FossilOrigin-Name: fc68993501aaa7180f5457dcb3c296e5b199904a385d98e2bcad7854e34d428e

2 years agoFix the function that determines the collating function for an expression
drh [Wed, 5 Apr 2023 02:21:57 +0000 (02:21 +0000)] 
Fix the function that determines the collating function for an expression
tree to handle new cases that arise as a result of the recently added
ability to use indexed expressions in aggregate queries.
[forum/forumpost/0713a16a44|Forum post 0713a16a44].

FossilOrigin-Name: cc5041f3f067cf610adffb868b4e2d1b5d248dc5a0ecc551339b670800ecb0ff

2 years agoShell to use SQLITE_SHELL_HAVE_RECOVER consistently (correcting check-in 0421cc03e0ef...
larrybr [Tue, 4 Apr 2023 19:56:28 +0000 (19:56 +0000)] 
Shell to use SQLITE_SHELL_HAVE_RECOVER consistently (correcting check-in 0421cc03e0efa8f1)

FossilOrigin-Name: 5b980d72a03fa1cfd0f1bf3ed04068b9f216b75a304deb2b7bbe8ddce0e6fb96

2 years agoFix an incorrect entry in the array that maps sqlite3_value values into
drh [Tue, 4 Apr 2023 18:55:31 +0000 (18:55 +0000)] 
Fix an incorrect entry in the array that maps sqlite3_value values into
actual datatype numbers.  dbsqlfuzz f660c659bcec48577a43d3bab37f46baaa22f59e

FossilOrigin-Name: fa8537dc90cad962dec695418d48da2890a172801ecad0c7c804023a063d3a02

2 years agoRemove an assert() statement that is no longer valid due to enhancements
drh [Tue, 4 Apr 2023 18:10:23 +0000 (18:10 +0000)] 
Remove an assert() statement that is no longer valid due to enhancements
to query planner for improved use of indexes.
[forum:/forumpost/dc16ec63d3 |Forum post dc16ec63d3].

FossilOrigin-Name: 2b23dd249d0bc254308f5539936d33ee558f1100dec616caac7317dbe70db761

2 years agoExpose the new SQLITE_VTAB_USES_ALL_SCHEMAS to JS.
stephan [Tue, 4 Apr 2023 17:35:38 +0000 (17:35 +0000)] 
Expose the new SQLITE_VTAB_USES_ALL_SCHEMAS to JS.

FossilOrigin-Name: b7ef09be667dd349e195842304c03cbebb1693164e1c3587a5d7c96baa713edf

2 years agoOmit shell call to sqlite3_dbdata_init() when it is omitted.
larrybr [Tue, 4 Apr 2023 08:49:22 +0000 (08:49 +0000)] 
Omit shell call to sqlite3_dbdata_init() when it is omitted.

FossilOrigin-Name: 0421cc03e0efa8f1a83e46e91f26837366c10eef0903d099e25eb0cc99c297df

2 years agoWhen translating arguments of aggregate functions into references to
drh [Mon, 3 Apr 2023 23:49:00 +0000 (23:49 +0000)] 
When translating arguments of aggregate functions into references to
expression indexes, make sure to only translate them for the current
aggregate when there are nested aggregates.
[forum/forumpost/409ebc7368|Forum post 409ebc7368].

FossilOrigin-Name: 898bfa1afd8260eaaf2aa6db94e74d99ebf4e8a6dc02cf21d20cd981393609a5

2 years agoImproved diagnostic output from PRAGMA vdbe_addoptrace.
drh [Mon, 3 Apr 2023 20:11:06 +0000 (20:11 +0000)] 
Improved diagnostic output from PRAGMA vdbe_addoptrace.

FossilOrigin-Name: 050958c1828f7446e7ee7e458123a23b735e213b76a67c3dd8356da256cbc170

2 years agoWhen changing a COLLATE expression node into TK_AGG_COLUMN because the nodes
drh [Mon, 3 Apr 2023 17:46:14 +0000 (17:46 +0000)] 
When changing a COLLATE expression node into TK_AGG_COLUMN because the nodes
value is contained in an indexed expression, be sure to clear the
EP_Collate property from the expression node.  Fix for the assertion faults
reported by [forum:/forumpost/e45108732c|forum post e45108732c] and
[forum:/forumpost/44270909bb|forum post 44270909bb].

FossilOrigin-Name: cf6454ce26983b9c3ae924c44a802f3f760eaaae9547b40aee9e14e7b0c47cab

2 years agoAdd the SQLITE_VTAB_USES_ALL_SCHEMAS option to sqlite3_vtab_config(). Update
drh [Mon, 3 Apr 2023 15:01:37 +0000 (15:01 +0000)] 
Add the SQLITE_VTAB_USES_ALL_SCHEMAS option to sqlite3_vtab_config().  Update
the sqlite_dbpage, sqlite_dbdata, and sqlite_dbptr virtual tables to make
use of that interface.  This was formerly handled by the internal
sqlite3VtabUsesAllSchemas() routine that was called directly from sqlite_dbpage.
But since sqlite_dbdata and sqlite_dbptr are an extension, an external
interface to that functionality had to be provided.
dbsqlfuzz 1a29c245175a63393b6a78c5b8cab5199939d6a8

FossilOrigin-Name: bcd51abee0b0f82bb5dbb881025a92d55baf9df6adeaf3a305e2e0da96a81d58

2 years agoMake the sqlite_dbdata and sqlite3_dbptr virtual tables accessible to
drh [Mon, 3 Apr 2023 12:48:51 +0000 (12:48 +0000)] 
Make the sqlite_dbdata and sqlite3_dbptr virtual tables accessible to
the CLI.

FossilOrigin-Name: c0eff02854d469bcdb949c09531760d6f96b49c17375abd1c131d41f38b9b2f0

2 years agoStronger constraint checking in allocateSpace().
drh [Mon, 3 Apr 2023 12:33:12 +0000 (12:33 +0000)] 
Stronger constraint checking in allocateSpace().
dbsqlfuzz 93d4c9ff5ef7cd29f16e767af1ee71c29ec5a4c0

FossilOrigin-Name: 9e968f4fbce061190f10f31ce9d3eb4fce6706ea6b7e5011bfa1e893d37ca68d

2 years agoWith the -DSQLITE_ENABLE_JSON_NAN_INF compile-time option, non-standard
drh [Sun, 2 Apr 2023 20:56:29 +0000 (20:56 +0000)] 
With the -DSQLITE_ENABLE_JSON_NAN_INF compile-time option, non-standard
JSON numeric values "Inf", "Infinity", "-Inf", "-Infinity", "NaN", "QNaN",
and "SNaN" are all accepted.  SQLite should never generate these values,
but it will accept that with the appropriate compile-time option.

FossilOrigin-Name: 0a050e9013331595e13ca9f859180057b59291c70a6cedb6230eefb25956df9e

2 years agoMore off-by-one errors in the new JSON parsing. json-nan-inf
drh [Sun, 2 Apr 2023 20:46:24 +0000 (20:46 +0000)] 
More off-by-one errors in the new JSON parsing.

FossilOrigin-Name: dbc99662087b63c9ed5b398535a6091fc2c5e507907dd1fcb7ad0b6ab3f17144

2 years agoFix an off-by-one error in the recognition of -Infinity.
drh [Sun, 2 Apr 2023 20:27:02 +0000 (20:27 +0000)] 
Fix an off-by-one error in the recognition of -Infinity.

FossilOrigin-Name: f7ebf3e6286ddc8cdaa9446235407785d1be2be2d9992e21ef59fcd655f68432

2 years agoEarlier detection of corruption in sqlite3BtreeDelete().
drh [Sun, 2 Apr 2023 16:43:20 +0000 (16:43 +0000)] 
Earlier detection of corruption in sqlite3BtreeDelete().
dbsqlfuzz a4c48c291d6e40157a1b749a05eaa7c7faf5a625.

FossilOrigin-Name: 978dc71c388b37740da38c310674315c7d7fe814d1daa16a146b4df71385d1e1

2 years agoClear executable bit on base64.c
larrybr [Sun, 2 Apr 2023 14:53:59 +0000 (14:53 +0000)] 
Clear executable bit on base64.c

FossilOrigin-Name: ec1ddbce7db270afc25f71546fa745935ad74bc72920fccfcb37e98649612bf2

2 years agoAllow special floating-point value names in JSON: "inf", "-inf", "infinity",
drh [Sat, 1 Apr 2023 23:29:59 +0000 (23:29 +0000)] 
Allow special floating-point value names in JSON:  "inf", "-inf", "infinity",
"-infinity", "nan", "qnan", and "snan".  All are converted into valid JSON
values: 9e999, -9e999, or null.  Requires the SQLITE_ENABLE_JSON_NAN_INF
compile-time option to operate.

FossilOrigin-Name: fc8793e5acac7351749e360c6bace5d5a8b3de3aa600ae23e260557db650c461

2 years agoSwat grammar nit on README.md
larrybr [Sat, 1 Apr 2023 16:14:50 +0000 (16:14 +0000)] 
Swat grammar nit on README.md

FossilOrigin-Name: 715c00e58b774d6a29e2f60fd33a2ecb960307192ae1fdb8ed396f74fd62b444

2 years agoFix harmless compiler warnings.
drh [Sat, 1 Apr 2023 15:51:21 +0000 (15:51 +0000)] 
Fix harmless compiler warnings.

FossilOrigin-Name: a4fb2864fe01cce9694242a0750623ca47fcecd68f74c4239d3eb5fbf978770a

2 years agoImproved error messages from PRAGMA integrity_check. Identify the root of
drh [Sat, 1 Apr 2023 13:14:53 +0000 (13:14 +0000)] 
Improved error messages from PRAGMA integrity_check.  Identify the root of
the tree when a problem is found in a b-tree, making it easier to track the
problem to a specific table or index.

FossilOrigin-Name: a1cb152e69c7c6cdd99300c91a8104716089de459d9d19e33ef38432aad70908

2 years agoIn the b-tree module use %u instead of %d to print unsigned quantities such
drh [Sat, 1 Apr 2023 12:22:57 +0000 (12:22 +0000)] 
In the b-tree module use %u instead of %d to print unsigned quantities such
as page numbers and offsets.

FossilOrigin-Name: 33ac62d8eec56eb71f20ccd28a5d6e4e8051522feb2db0199abee9e18ce1f64e

2 years agoOmit the the count-of-view optimization if there is a HAVING clause.
drh [Fri, 31 Mar 2023 23:48:59 +0000 (23:48 +0000)] 
Omit the the count-of-view optimization if there is a HAVING clause.
dbsqlfuzz 6a107e3055bd22afab31cfddabc2d9d54fcbaf69

FossilOrigin-Name: babe2b5e59647ac9db4601e67c25190aac14eb76d5fcb9fa5b3692b955fefd61

2 years agoEarlier error detection for index expression usage by aggregate functions.
drh [Thu, 30 Mar 2023 19:05:48 +0000 (19:05 +0000)] 
Earlier error detection for index expression usage by aggregate functions.
dbsqlfuzz 29214ace4e25c98d2ddff8fbcf97afdda23f28b9

FossilOrigin-Name: 8e841e7f025f7205959453875f2d9db36271642045593970a2b2fc20b2f847c3

2 years agoOmit a branch that is no longer needed following [c9c4f287652933eb].
drh [Thu, 30 Mar 2023 16:08:54 +0000 (16:08 +0000)] 
Omit a branch that is no longer needed following [c9c4f287652933eb].

FossilOrigin-Name: 960a488a2db92f5437bc8171cdbed44618d9381c57fd41b2f0e357b6012c80b5

2 years agoFix an error in new test script test/aggfault.test.
dan [Thu, 30 Mar 2023 12:19:38 +0000 (12:19 +0000)] 
Fix an error in new test script test/aggfault.test.

FossilOrigin-Name: 8724fe7426da55d19dba7b30e09321ba30c73286513864cb05de32f72e50ee31

2 years agoFix a crash that could follow an OOM error while processing aggregate functions.
dan [Thu, 30 Mar 2023 11:05:36 +0000 (11:05 +0000)] 
Fix a crash that could follow an OOM error while processing aggregate functions.

FossilOrigin-Name: 804435a2731bd3c26278c47098854b9ee7727a686587f6208e793738fbfc0555

2 years agoAvoid having OP_SeekScan jump over an OP_IdxGT or OP_IdxGE that follows the OP_SeekGE...
dan [Wed, 29 Mar 2023 21:58:06 +0000 (21:58 +0000)] 
Avoid having OP_SeekScan jump over an OP_IdxGT or OP_IdxGE that follows the OP_SeekGE opcode. Fix for [b50528af4468237c].

FossilOrigin-Name: c9c4f287652933eb6262a3419efe7e7288f55d3db7e2ac032eeae025f665d306

2 years agoFix a problem with sqlite3_stmt_scanstatus() from within an SQLITE_TRACE_STMT callbac...
dan [Wed, 29 Mar 2023 18:54:01 +0000 (18:54 +0000)] 
Fix a problem with sqlite3_stmt_scanstatus() from within an SQLITE_TRACE_STMT callback made from within a trigger.

FossilOrigin-Name: 1fa78fafa1340de458546526b03cf8b3e9c823913c4225d7c747ad182df5c0fc

2 years agoAnother #ifdef to omit code that is only used by STAT4.
drh [Wed, 29 Mar 2023 15:16:29 +0000 (15:16 +0000)] 
Another #ifdef to omit code that is only used by STAT4.

FossilOrigin-Name: 445c75567de9bf9c8075dfc62c60dc4abeefab59c7803a5ef2cc5d69c08d7633

2 years agoNew #ifdefs to omit code that is unused except under STAT4.
drh [Wed, 29 Mar 2023 14:42:11 +0000 (14:42 +0000)] 
New #ifdefs to omit code that is unused except under STAT4.

FossilOrigin-Name: 09a9b30ba7828a487a33a3ebf8028dfaa147dff67d2724584123b90a88d9814b