]> git.ipfire.org Git - thirdparty/sqlite.git/log
thirdparty/sqlite.git
2 years agoSimplifications to the new timediff() logic. timediff
drh [Tue, 30 May 2023 14:46:30 +0000 (14:46 +0000)] 
Simplifications to the new timediff() logic.

FossilOrigin-Name: d6954259bd3f8475f3804fd02a1591d037efa9df54da45776863c024ff90e596

2 years agoNew test cases for the timediff enhancements.
drh [Tue, 30 May 2023 11:51:45 +0000 (11:51 +0000)] 
New test cases for the timediff enhancements.

FossilOrigin-Name: f14633ce6ddf28a14b03e2da623d96e439966aa3fc30c26cb0be59c0e15b3e9c

2 years agoAll date/time modifiers of the form (+/-)YYYY-MM-DD without the following
drh [Tue, 30 May 2023 11:13:56 +0000 (11:13 +0000)] 
All date/time modifiers of the form (+/-)YYYY-MM-DD without the following
HH:MM:SS.SSS.

FossilOrigin-Name: fa9237a8ab803ca3f67fe753516b7bdb98be3d625e8e241ddf9b02509210e225

2 years agoProblems fixed. All tests are passing now.
drh [Tue, 30 May 2023 02:50:32 +0000 (02:50 +0000)] 
Problems fixed.  All tests are passing now.

FossilOrigin-Name: cff293b0a79107def7bfe54fd60ac4a721c5098c85229d9b46a4e2c4cbf34a6a

2 years agoImprovements to the timediff() function. Test cases added. Not all test
drh [Tue, 30 May 2023 02:16:33 +0000 (02:16 +0000)] 
Improvements to the timediff() function.  Test cases added. Not all test
cases are passing.

FossilOrigin-Name: 2cf6518140d61e2123dc20f39d7e97e7bce17e7641405df7fd63e1cdda444ae0

2 years agoNew date/time modifier: (+|-)YYYY-MM-DD HH:MM(:SS.SSS)?
drh [Mon, 29 May 2023 20:33:33 +0000 (20:33 +0000)] 
New date/time modifier:  (+|-)YYYY-MM-DD HH:MM(:SS.SSS)?

FossilOrigin-Name: 3832b8a9ef84d9b53b48dfce9c1e724897cd7b3e05711e01675419655f894eac

2 years agoPrototype implementation of a proposed "timediff(X,Y)" SQL function.
drh [Mon, 29 May 2023 18:01:42 +0000 (18:01 +0000)] 
Prototype implementation of a proposed "timediff(X,Y)" SQL function.

FossilOrigin-Name: 054a195125a273bab026ada5f07cc7c32818007027a1fd028ca59d2f179276d4

2 years agoFix an issue with sqldiff reported by
drh [Sat, 27 May 2023 20:08:23 +0000 (20:08 +0000)] 
Fix an issue with sqldiff reported by
[forum:/info/9bd2155bdfae25a7|forum post 9bd2155bdfae25a7].

FossilOrigin-Name: 736a79c1491065f4ee77ce644af0e529e555ca733c78dbd55487d55d4ddbe5bd

2 years agoAdd extra tests for fts5, large rowids and "ORDER BY rowid DESC". No changes to code.
dan [Sat, 27 May 2023 19:34:46 +0000 (19:34 +0000)] 
Add extra tests for fts5, large rowids and "ORDER BY rowid DESC". No changes to code.

FossilOrigin-Name: b5b5eaeed3ef55415e27aa04561ab446f3be881b56b7cbf9b8ba3307f0b2bf69

2 years agoAdd ability for the JS Worker1.exec() API to report the number of changes made to...
stephan [Thu, 25 May 2023 16:49:06 +0000 (16:49 +0000)] 
Add ability for the JS Worker1.exec() API to report the number of changes made to the caller, per request in [forum:d0b19483642e20dd | forum post d0b19483642e20dd].

FossilOrigin-Name: 6e79505df915612b60696e4eec5c9973175fe6ecf273eb3152b996e63ae54a07

2 years agoMinor cleanups in demo JS code, per forum feedback.
stephan [Tue, 23 May 2023 19:11:42 +0000 (19:11 +0000)] 
Minor cleanups in demo JS code, per forum feedback.

FossilOrigin-Name: 80c7c0360c08bea0733deccb8071920c60558b75df76b6afad093c82adf30ea6

2 years agoAvoid performing aggregate processing more than once for a single expression. [forum...
dan [Tue, 23 May 2023 17:35:18 +0000 (17:35 +0000)] 
Avoid performing aggregate processing more than once for a single expression. [forum:/info/36ff78b2a3|Forum post 36ff78b2a3].

FossilOrigin-Name: 367b4cc549a14222d54530538e692e9d1a365002c1b8c4ef80ddc0523bfdb3a2

2 years agoWhen converting an aggregate expression to AGG_COLUMN, be sure to remove
drh [Tue, 23 May 2023 15:16:20 +0000 (15:16 +0000)] 
When converting an aggregate expression to AGG_COLUMN, be sure to remove
the EP_Unlikely flag if it is present.
[forum:/info/fbfe330a2009d036|Forum post fbfe330a2009d036].

FossilOrigin-Name: 48e65f18b2ebbe786e84e208f2c6c68de6067ba86912fea5a120fd41d0af2184

2 years agoFix a buffer overread in the recovery extension that might occur on 32-bit platforms.
dan [Tue, 23 May 2023 14:05:02 +0000 (14:05 +0000)] 
Fix a buffer overread in the recovery extension that might occur on 32-bit platforms.

FossilOrigin-Name: ff4a9a2b59657116da99c748ada19dbc64b7d0fd4c920e1c517d8bda3466f06b

2 years agoAdd test cases for the recovery extension. No changes to code.
dan [Tue, 23 May 2023 11:47:56 +0000 (11:47 +0000)] 
Add test cases for the recovery extension. No changes to code.

FossilOrigin-Name: cec49c7d93362f527f0b4744cd1ae95d44a79671d49d69baa77fda70be29f7e8

2 years agoAvoid duplicate WIN32_LEAN_AND_MEAN #define. Fix a trivial nit likely never observed.
larrybr [Mon, 22 May 2023 20:36:55 +0000 (20:36 +0000)] 
Avoid duplicate WIN32_LEAN_AND_MEAN #define. Fix a trivial nit likely never observed.

FossilOrigin-Name: 81ffcf41d69ae73ee8c037f675e18e2b46a15bee34062914640456381262d6fc

2 years agoWhen a floating-point RTREE is presented with large integer constraints -
drh [Mon, 22 May 2023 16:35:21 +0000 (16:35 +0000)] 
When a floating-point RTREE is presented with large integer constraints -
integers that are too big to be represented exactly by a float - then take
extra steps to ensure that all possibly relevant entries in the RTREE are
returned, even in boundary cases.  Fix for the problem identified by
[forum:/forumpost/da70ee0d0d|forum post da70ee0d0d].

FossilOrigin-Name: bfd8d9100015f3e3fb011698963d670bd89b64ec8a8ab931e0c6c3076b029377

2 years agoFix a buffer overrun that could occur in fts5 when processing corrupt records.
dan [Mon, 22 May 2023 11:02:15 +0000 (11:02 +0000)] 
Fix a buffer overrun that could occur in fts5 when processing corrupt records.

FossilOrigin-Name: 4891dbd938f4bfd345eaef01f2addea9512eaa98f860844c73abb907b6a8e0e8

2 years agoExtend detection of the INSERT...RETURNING locking case to the DB.selectValue(s)...
stephan [Fri, 19 May 2023 18:23:53 +0000 (18:23 +0000)] 
Extend detection of the INSERT...RETURNING locking case to the DB.selectValue(s)/selectArray/selectObject() family of functions. Add tests for INSERT/UPDATE...RETURNING with those functions.

FossilOrigin-Name: 3181c50540df0eff6cb5db79bb477c469bb7b73b0692260ba600db200fcef4ac

2 years agoMinor doc typo fix.
stephan [Fri, 19 May 2023 17:59:21 +0000 (17:59 +0000)] 
Minor doc typo fix.

FossilOrigin-Name: 4533be08786306a4fcb4b21458444dffd0fa2764ebb2538313f3a16d9324cacc

2 years agooo1.Stmt.finalize() no longer throws, but instead returns the same as the C API....
stephan [Fri, 19 May 2023 17:50:16 +0000 (17:50 +0000)] 
oo1.Stmt.finalize() no longer throws, but instead returns the same as the C API. oo1.DB.exec() now triggers the INSERT...RETURNING locking failure as an exception via reset() instead of finalize(). Some code-adjacent internal API renaming for clarity's sake.

FossilOrigin-Name: 4ee6b3aa531b980acea4c4b58ee256e765c5105100468928def3d4c9825fa9bc

2 years agoImproved documentation for sqlite3_reset(), in response to
drh [Fri, 19 May 2023 16:42:49 +0000 (16:42 +0000)] 
Improved documentation for sqlite3_reset(), in response to
[forum:/forumpost/a72bab3dea|forum post a72bab3dea].

FossilOrigin-Name: 1dfeb3dceee8f30daf5462683f264b9de23e7068e036e70b11ee1b608ac2f7fa

2 years agosqlite3.oo1.Stmt.reset() now throws if sqlite3_reset() returns non-zero, analog to...
stephan [Fri, 19 May 2023 16:34:56 +0000 (16:34 +0000)] 
sqlite3.oo1.Stmt.reset() now throws if sqlite3_reset() returns non-zero, analog to [f23eb5c6d365].

FossilOrigin-Name: 487ae12c9a21e5862bd590bbb1030c39734657d52136cf67b98c7545e6ecbe1c

2 years agoAdd a basic INSERT RETURNING test for the oo1.DB.exec() API.
stephan [Fri, 19 May 2023 16:12:06 +0000 (16:12 +0000)] 
Add a basic INSERT RETURNING test for the oo1.DB.exec() API.

FossilOrigin-Name: d29d62cf7658aeb49f3c8a5d0b0809d945ebc9b79379a255eb88f771d2a2c430

2 years agosqlite3.oo1.Stmt.finalize() now throws if sqlite3_finalize() returns non-zero. This...
stephan [Fri, 19 May 2023 15:54:41 +0000 (15:54 +0000)] 
sqlite3.oo1.Stmt.finalize() now throws if sqlite3_finalize() returns non-zero. This is intended to address the INSERT RETURNING case covered in [forum:36f7a2e7494897df|forum post 36f7a2e7494897df].

FossilOrigin-Name: f23eb5c6d36546ee1e181a03660e0b2dc8005bba24bee8bae594b0c78bd152cd

2 years agoCorrect typo in an 'extern' decl name, reported in [forum:1d4342156439233b|forum...
stephan [Fri, 19 May 2023 12:41:14 +0000 (12:41 +0000)] 
Correct typo in an 'extern' decl name, reported in [forum:1d4342156439233b|forum post 1d4342156439233b].

FossilOrigin-Name: 6ac18827d8c5be35442dc452af703023c759916c179f165c4e54b3e430a8f7b0

2 years agoChange the RTREE engine so that equality comparisons of floating point
drh [Fri, 19 May 2023 11:48:05 +0000 (11:48 +0000)] 
Change the RTREE engine so that equality comparisons of floating point
values are duplicated in the byte-code so that the comparisons are done
using 64-bit floats and consistent results are always obtained.
[forum:/forumpost/da61c4a1b5b4af19|Forum post da61c4a1b5b4af19].

FossilOrigin-Name: 4ec0f0a31b0df93ad15545fe1db117c933e28c75ad3cbc8475b56fecdb084905

2 years agoFix incorrect b-tree root page reports from the enhanced PRAGMA integrity_check
drh [Thu, 18 May 2023 23:25:48 +0000 (23:25 +0000)] 
Fix incorrect b-tree root page reports from the enhanced PRAGMA integrity_check
output introduced in version 3.42.0.

FossilOrigin-Name: 9b538f62539bcde7d7d7ad06eccdc558ecbd3f9160db35197568f4d3b4247c76

2 years agoFast-path the btree transaction start for the common case where a
drh [Wed, 17 May 2023 19:23:24 +0000 (19:23 +0000)] 
Fast-path the btree transaction start for the common case where a
transaction is already active.

FossilOrigin-Name: 798c3ff20c606b5f9fde16dc67781f238370a7c450bc239c3a98d0f4ca370399

2 years agoSimplification, performance improvement, and size reduction in the
drh [Wed, 17 May 2023 16:13:48 +0000 (16:13 +0000)] 
Simplification, performance improvement, and size reduction in the
codeAllEqualityTerms() function of the code generator.

FossilOrigin-Name: 4fbe02651e877e442d62308d7f607e503695104cd71c5565132fcd1398c120df

2 years agoNew assert() statements to verify that Expr.iColumn is never used as an
drh [Wed, 17 May 2023 15:46:46 +0000 (15:46 +0000)] 
New assert() statements to verify that Expr.iColumn is never used as an
array index when its value is negative.

FossilOrigin-Name: 6084c5fb6d3fcedf35cd6c597a44ec7bf8b4a2576c7b277e5342d2a7905318e7

2 years agoImproved assertions on substExpr().
drh [Wed, 17 May 2023 13:21:45 +0000 (13:21 +0000)] 
Improved assertions on substExpr().

FossilOrigin-Name: 6dbd5b3cc801a75ea23842a43eb7106b62fc1d26dd5a8477a0217325539a7c1a

2 years agoAvoid an assert() failure that could occur in SQLITE_ENABLE_UPDATE_DELETE_LIMIT build...
dan [Wed, 17 May 2023 11:31:51 +0000 (11:31 +0000)] 
Avoid an assert() failure that could occur in SQLITE_ENABLE_UPDATE_DELETE_LIMIT builds when a WITH clause attached to an UPDATE or DELETE statement created a CTE of the same name as the table being modified.

FossilOrigin-Name: 8edf56d1698c3db38250db3b25864f658488414efb3a6b3e1443283b6affd26d

2 years agoFix two assert() statements that failed to take into account
drh [Wed, 17 May 2023 00:26:50 +0000 (00:26 +0000)] 
Fix two assert() statements that failed to take into account
the likely() built-in function.  This does not impact production code.

FossilOrigin-Name: 8504fe812c5b4956c8acad515d537add54cb591bc81747113f9b24526d7685b8

2 years agoIncrease the version number to 3.43.0 in order to begin the next
drh [Tue, 16 May 2023 14:20:04 +0000 (14:20 +0000)] 
Increase the version number to 3.43.0 in order to begin the next
development cycle.

FossilOrigin-Name: 7874023cd460cbe05401433b8e695a77955e2c055c360a93b92d4ce6937bd136

2 years agoResolve the JS-side corner case reported in [forum:7774b773937cbe0a | forum post...
stephan [Tue, 16 May 2023 14:18:48 +0000 (14:18 +0000)] 
Resolve the JS-side corner case reported in [forum:7774b773937cbe0a | forum post 7774b773937cbe0a] by not caching oo1.Stmt.columnCount.

FossilOrigin-Name: 37d44e8c447626738a8a7f915a9bc3f35fbb95581236dd152fc119b0c3a24c2a

2 years agoVersion 3.42.0 version-3.42.0
drh [Tue, 16 May 2023 12:36:15 +0000 (12:36 +0000)] 
Version 3.42.0

FossilOrigin-Name: 831d0fb2836b71c9bc51067c49fee4b8f18047814f2ff22d817d25195cf350b0

2 years agoUpdate the tool/mkmsvcmin.tcl script so that it prints a one-line message
drh [Tue, 16 May 2023 12:34:26 +0000 (12:34 +0000)] 
Update the tool/mkmsvcmin.tcl script so that it prints a one-line message
to explain what it has done.

FossilOrigin-Name: 4254f086419892634c80b0b915e14edea365adc6a45bcc75eecba889da274ac3

2 years agoFix a C++-style variable declaration in the generate_series() extension.
drh [Mon, 15 May 2023 19:17:31 +0000 (19:17 +0000)] 
Fix a C++-style variable declaration in the generate_series() extension.

FossilOrigin-Name: 1d3e008905461ebbd3ea0a862672f740fa72914d4d59fcf800e1ce56f1edfc9d

2 years agoLimit the number of nested NOT nodes in an fts5 expression to 256.
dan [Mon, 15 May 2023 17:24:48 +0000 (17:24 +0000)] 
Limit the number of nested NOT nodes in an fts5 expression to 256.

FossilOrigin-Name: 01219e69b430c8f5fea5ab6ce511ba8c9b4c9b32b6d2d36623dde99c3d3812c9

2 years agoIncrease the stack size available to fuzzcheck to 8MB on Windows.
drh [Mon, 15 May 2023 17:20:21 +0000 (17:20 +0000)] 
Increase the stack size available to fuzzcheck to 8MB on Windows.

FossilOrigin-Name: 2290dc6876041bcc982f162f59fdc9fd98b0983e1058c0a33fd46937ecc4bd84

2 years agoLimit the number of nested NOT nodes in an fts5 expression to 256. fts5-expr-limit
dan [Mon, 15 May 2023 17:14:16 +0000 (17:14 +0000)] 
Limit the number of nested NOT nodes in an fts5 expression to 256.

FossilOrigin-Name: 0e5c1ee40a146ef8b2b3c5f53d0a45e092bc8d8e933f3819805c995819d31bae

2 years agoAdd the --wait command-line option to fuzzcheck.
drh [Mon, 15 May 2023 10:55:04 +0000 (10:55 +0000)] 
Add the --wait command-line option to fuzzcheck.

FossilOrigin-Name: 5a479a2c7637a018d1828d9d37973bf3d36a2fc4cd5b752bca61a41cd0920d39

2 years agoMake generate_series() correct on ones complement ALUs and acceptable to UBSAN.
larrybr [Mon, 15 May 2023 03:48:48 +0000 (03:48 +0000)] 
Make generate_series() correct on ones complement ALUs and acceptable to UBSAN.

FossilOrigin-Name: 4c5cd3e6968c44749b7663beee790969b41d247b9201b771ef90cbb03d09108f

2 years agoAs evidenced by [forum:/forumpost/f3f546025a|forum post f3f546025a], the
drh [Mon, 15 May 2023 02:06:35 +0000 (02:06 +0000)] 
As evidenced by [forum:/forumpost/f3f546025a|forum post f3f546025a], the
new RIGHT JOIN related restriction on the push-down optimization implemented
by [da3fba18742b6e0b] also needs to apply to the automatic index
(a.k.a. hash-join) optimization and to the Bloom filter optimization.
Computation of the restriction is now
moved into the sqlite3ExprIsSingleTableConstraint() routine.

FossilOrigin-Name: 4902015dcf3869f08d9986e422faa231d9218a5e0fc59ba8df0f407e4eb3d605

2 years agoSimplify the interface to constructAutomaticIndex().
drh [Mon, 15 May 2023 01:02:50 +0000 (01:02 +0000)] 
Simplify the interface to constructAutomaticIndex().

FossilOrigin-Name: c5da16551619718bf649c517515261706843e11e131f0b99e1fd6927d0f7e238

2 years agoFix windows-specific problems in test scripts sessionnoop2.test and sessionrowid...
dan [Sat, 13 May 2023 20:01:27 +0000 (20:01 +0000)] 
Fix windows-specific problems in test scripts sessionnoop2.test and sessionrowid.test.

FossilOrigin-Name: e4989c111ddffe6818cbb88a72bd027b30124d1e8de0cce4109c72a214ffb5b8

2 years agoRemove unnecessary call to sqlite3_dbdata_init() from shell.c.
dan [Sat, 13 May 2023 19:38:30 +0000 (19:38 +0000)] 
Remove unnecessary call to sqlite3_dbdata_init() from shell.c.

FossilOrigin-Name: 84ca2000007d217f911a3b1586143fc9261c0697a9e9fadda6bd3dd6afdfb099

2 years agoAdd an "#ifndef SQLITE_HAVE_SQLITE3R" directive to shell.c.in, to avoid including...
dan [Sat, 13 May 2023 19:13:40 +0000 (19:13 +0000)] 
Add an "#ifndef SQLITE_HAVE_SQLITE3R" directive to shell.c.in, to avoid including the recovery code a second time if the shell is being compiled with sqlite3r.c.

FossilOrigin-Name: 6f1a60fb7b3ef463b4131dfecbc72b7c778c794a9aa13ce4617ab6dd895508b2

2 years agoMention that sqlite3_mutex_free() accepts NULL as a no-op.
larrybr [Sat, 13 May 2023 15:34:15 +0000 (15:34 +0000)] 
Mention that sqlite3_mutex_free() accepts NULL as a no-op.

FossilOrigin-Name: 603d9ad5012ca8996783996d7b8cd6a1aabf12b21604a2ccc137f4c2d99427b9

2 years agoFix compilation issue seen with MSVC.
mistachkin [Sat, 13 May 2023 05:13:29 +0000 (05:13 +0000)] 
Fix compilation issue seen with MSVC.

FossilOrigin-Name: 67001887044da71ab50c07d8345bd950a0a1f9688cf9cd6966312ea163cf6e17

2 years agoFix harmless compiler warning caused by [0772ddf56713d013].
drh [Fri, 12 May 2023 19:06:00 +0000 (19:06 +0000)] 
Fix harmless compiler warning caused by [0772ddf56713d013].

FossilOrigin-Name: f06c16a8b0e7a15ce4f7d99af3376a1bf1bfbfc0fdc048b079418ae74c619d6b

2 years agoAdd multi-threaded test for "INSERT ... RETURNING ..." and SQLITE_BUSY errors.
dan [Fri, 12 May 2023 19:02:50 +0000 (19:02 +0000)] 
Add multi-threaded test for "INSERT ... RETURNING ..." and SQLITE_BUSY errors.

FossilOrigin-Name: 559cb1c6de384fd14160db005acaf1858b8b018d3d40d7f786a56a49d3cdbd59

2 years agoMake the regexp extension more robust against OOM errors during compilation
drh [Fri, 12 May 2023 15:45:34 +0000 (15:45 +0000)] 
Make the regexp extension more robust against OOM errors during compilation
of the recognizer engine.
[forum:/forumpost/f50aecd5e8|Forum post f50aecd5e8].

FossilOrigin-Name: 0772ddf56713d013cd1bd44f9c75977ca14f852e3a8f038b0a6b9814f6519d79

2 years agoFix unlikely strange result of CLI edit().
larrybr [Fri, 12 May 2023 14:51:00 +0000 (14:51 +0000)] 
Fix unlikely strange result of CLI edit().

FossilOrigin-Name: ab3797e844c97fed344b36f30cfb788aca9e0d68c574fb833712219eb712db44

2 years agoEnsure the _O_U16TEXT is defined for Windows builds of the CLI.
drh [Fri, 12 May 2023 13:20:57 +0000 (13:20 +0000)] 
Ensure the _O_U16TEXT is defined for Windows builds of the CLI.
[forum:/forumpost/c80aa942dc6bf2|Forum post c80aa942dc6bf2].

FossilOrigin-Name: 504effa89b48c0dc6cd12b3eaf6017be3f32017c601af17759a3cc185346d868

2 years agoRemove a stray CR from end of line in a source file.
drh [Fri, 12 May 2023 12:57:44 +0000 (12:57 +0000)] 
Remove a stray CR from end of line in a source file.

FossilOrigin-Name: 48139fb904de4b7b383e7f8c29bed83ad878eb22b1dd773c366a0aee74613d23

2 years agoFix harmless typos in comments.
drh [Fri, 12 May 2023 12:45:56 +0000 (12:45 +0000)] 
Fix harmless typos in comments.

FossilOrigin-Name: 607c3efbe0293d7c11a955a9f21e24fb9f7f1bb758e13e60f4ba0cc0ac8b900c

2 years agoEnsure that all prepared statements are expired and forced to reprepare
drh [Fri, 12 May 2023 10:52:12 +0000 (10:52 +0000)] 
Ensure that all prepared statements are expired and forced to reprepare
whenever the database text encoding changes.
[forum:/forumpost/43cbfc4d23|Forum post 43cbfc4d23].

FossilOrigin-Name: 469718f106e1cfa7f8f4714a9e743108c361af81e0258061c2b76880a7c352ae

2 years agoAdd [/info/cec6a06508239c09e363?ln=5525-5531|restriction (5)] to the
drh [Thu, 11 May 2023 21:15:55 +0000 (21:15 +0000)] 
Add [/info/cec6a06508239c09e363?ln=5525-5531|restriction (5)] to the
omit-noop-join optimization.  Fix for the issue reported by
[forum/forumpost/49f2c7f690|forum post 49f2c7f690].

FossilOrigin-Name: 3e9c9bbdb59b9d500ff218db538c047c83da7ac18ebb95c3ee7629ab15e0b43a

2 years agoFix a minor typo in a comment. No code changes.
drh [Thu, 11 May 2023 18:03:11 +0000 (18:03 +0000)] 
Fix a minor typo in a comment.  No code changes.

FossilOrigin-Name: 607cfb5bc5c0fb8b789944c2326cfdebf0629e45fbf0a61dd5f667ed685a1bbe

2 years agoFix the rbu_exclusive_checkpoint=1 option so that it works with a zipvfs database...
dan [Thu, 11 May 2023 17:25:14 +0000 (17:25 +0000)] 
Fix the rbu_exclusive_checkpoint=1 option so that it works with a zipvfs database in pass-through mode.

FossilOrigin-Name: caca67d30670913914335aa3edff784e1c3d26aed70ae32efb5607ccf31ad142

2 years agoDoc typo fix. No code changes. oo1-no-cache-Stmt.columnCount
stephan [Wed, 10 May 2023 21:08:01 +0000 (21:08 +0000)] 
Doc typo fix. No code changes.

FossilOrigin-Name: e841b142f583e49350c7cdd14dc4da72434cc67c7b521ae741e03e37e785d7e0

2 years agoResolve the JS-side corner case reported in [forum:7774b773937cbe0a | forum post...
stephan [Wed, 10 May 2023 21:06:02 +0000 (21:06 +0000)] 
Resolve the JS-side corner case reported in [forum:7774b773937cbe0a | forum post 7774b773937cbe0a] by not caching oo1.Stmt.columnCount.

FossilOrigin-Name: c3d25c3a25e79e01c4ad0cf11f7dc3b0fb1932f3bcd04935a728ef62f7e07cf1

2 years agoEnhance the split-sqlite3c.tcl script so that it uses single-character
drh [Wed, 10 May 2023 16:04:04 +0000 (16:04 +0000)] 
Enhance the split-sqlite3c.tcl script so that it uses single-character
extensions on subordinate source files, even when the number of subordinates
exceeds 9.  This is not yet needed, but might be soon.

FossilOrigin-Name: 4150e416263f24efcbfe68d5b1e15ec7e79df41dff0b6dfdc59f06ee9e205049

2 years agoFix harmless compiler warnings from the CBMC compiler.
drh [Wed, 10 May 2023 13:56:32 +0000 (13:56 +0000)] 
Fix harmless compiler warnings from the CBMC compiler.

FossilOrigin-Name: 5bc17cbccdd369486fca049be9d7457e18f162c0e2f5475809ffc8f01c5fa9d2

2 years agoRename sqlite3IsTableConstraint() to sqlite3IsSingleTableConstraint() and
drh [Wed, 10 May 2023 11:05:59 +0000 (11:05 +0000)] 
Rename sqlite3IsTableConstraint() to sqlite3IsSingleTableConstraint() and
improve its header comment, in an attempt to make the code easier to reason
about.  No functional changes - should generate identical machine code.

FossilOrigin-Name: 5dae897431a0a9dbb354c4a8a48f935ea7438035d96f90b83dd81eae434c8277

2 years agoAdd a missing comma to the documentation for the OP_Jump opcode. No changes
drh [Wed, 10 May 2023 10:03:28 +0000 (10:03 +0000)] 
Add a missing comma to the documentation for the OP_Jump opcode.  No changes
to code.

FossilOrigin-Name: 7e2c2b1cee760af68cf303ce9ec1babbaf607fe54e043893c046d2d37cd0ab46

2 years agoNew restriction on the push-down optimization to prevent an ON or USING clause
drh [Wed, 10 May 2023 00:33:21 +0000 (00:33 +0000)] 
New restriction on the push-down optimization to prevent an ON or USING clause
on the left side of a RIGHT JOIN from being pushed down into a subquery that
is on the right side of that RIGHT JOIN.
[forum:/forumpost/a7d4be7fb6|Forum post a7d4be7fb6].
Also add comments to describe previously undocumented push-down optimization
restrictions.

FossilOrigin-Name: da3fba18742b6e0bd5290bee9d86a2d5cb1ff2de25d737ef93060d7c1143273f

2 years agoFix bug in fall-back logic of CLI .clone
larrybr [Wed, 10 May 2023 00:20:42 +0000 (00:20 +0000)] 
Fix bug in fall-back logic of CLI .clone

FossilOrigin-Name: 0dcd9785c11e33e6393b7c1be1ff8fe7129f280439aed12de22d4687609a8bac

2 years agoFix recover1.test so that it works with DEFAULT_AUTOVACUUM builds.
dan [Mon, 8 May 2023 16:26:22 +0000 (16:26 +0000)] 
Fix recover1.test so that it works with DEFAULT_AUTOVACUUM builds.

FossilOrigin-Name: 4ffae48e831eedf8f5e61dc6d38817c0fdccfb2f4f1189d07f9722b9e3a48b5e

2 years agoImproved error handling when ".open" fails in the CLI.
drh [Mon, 8 May 2023 13:47:38 +0000 (13:47 +0000)] 
Improved error handling when ".open" fails in the CLI.

FossilOrigin-Name: 38544b11f0e19cc6c6f8230a89d28e36c7c3587481deaac6cedbf82338ca0d47

2 years agoIn editPage(), if an attempt is made to edit an empty 64KB page, then take
drh [Mon, 8 May 2023 13:38:14 +0000 (13:38 +0000)] 
In editPage(), if an attempt is made to edit an empty 64KB page, then take
the slow path through rebuildPage(), in order to maintain strict invariants
in the editPage() code.
[forum:/forumpost/0f37727c0d|Forum post 0f37727c0d].

FossilOrigin-Name: a865e574e510c1ca192d0bd5293fb583def90f7ed086af2c89ca856ce93d115b

2 years agoEnsure that the label for a JSON object really is a string and not an array
drh [Mon, 8 May 2023 11:11:08 +0000 (11:11 +0000)] 
Ensure that the label for a JSON object really is a string and not an array
or object that just happens to end with a string.
dbsqfuzz 32f62ed8676d0a153dbe756aeae3202d3670fe50.

FossilOrigin-Name: c335737c2889722ea05b732a5efff8a2f31140c18ca038c41e05c2a26e0db5bd

2 years agoAdd tests for recovering data to a lost-and-found table from a utf-16 db. No code...
dan [Mon, 8 May 2023 10:51:35 +0000 (10:51 +0000)] 
Add tests for recovering data to a lost-and-found table from a utf-16 db. No code changes.

FossilOrigin-Name: 832f6e9f797eecb9a3dae4e7e20c70eda1e91372e9d3ce4223d57f26582cdbd2

2 years agoIt turns out that pagerExclusiveLock() can be called with the lock state
drh [Sun, 7 May 2023 03:23:32 +0000 (03:23 +0000)] 
It turns out that pagerExclusiveLock() can be called with the lock state
already set to RESERVED if the SQLITE_FCNTL_PERSIST_WAL setting is set and
a specific sequence of multiple journal mode changes occur.
Enhance pagerExclusiveLock() to deal with this.
[forum:/forumpost/8130545bc6|Forum post 8130545bc6]

FossilOrigin-Name: 2bb8d977392f635515aa4a36f6f763a2e4858f7adc1120519e2e74c04a9749b5

2 years agoFix a comment in the JSON logic. No code changes.
drh [Fri, 5 May 2023 20:22:06 +0000 (20:22 +0000)] 
Fix a comment in the JSON logic.  No code changes.

FossilOrigin-Name: 3f30ea5ec9d849c64d8c38f4fffbc06c749ecff91ab90bc29b3a3cc9ec5b9df0

2 years agoFix a buffer overrun that could occur when using the format() function to format...
dan [Fri, 5 May 2023 19:36:13 +0000 (19:36 +0000)] 
Fix a buffer overrun that could occur when using the format() function to format a very small real value with the "," modifier.

FossilOrigin-Name: 910e770ad4d8e8e45bf069af963f2e975bfcfb882578dc5fe714cd2396258934

2 years agoReduce the maximum depth of nesting in json objects to 1000.
dan [Fri, 5 May 2023 15:52:44 +0000 (15:52 +0000)] 
Reduce the maximum depth of nesting in json objects to 1000.

FossilOrigin-Name: c7697a0d45bfab20ec09f17ad65e375ddb43af6762278481c13a65c9a784978e

2 years agoDo not attempt to run json502.test with SQLITE_OMIT_VIRTUALTABLE builds.
dan [Fri, 5 May 2023 15:28:35 +0000 (15:28 +0000)] 
Do not attempt to run json502.test with SQLITE_OMIT_VIRTUALTABLE builds.

FossilOrigin-Name: 6664850647cd314c076842df5bf94e4f12d9be7fb56795b2af25f15c1267fa4d

2 years agoUpdates to compile-time option usage and especially to the compile-time option
drh [Fri, 5 May 2023 14:16:31 +0000 (14:16 +0000)] 
Updates to compile-time option usage and especially to the compile-time option
test script in tool/omittest.tcl.

FossilOrigin-Name: fece588b186c4f9f76d626313e35336fd5681e966e9bd0fa1053b147c4e3c315

2 years agoFix the pager2-3.1 test case so that it does not run if a required
drh [Fri, 5 May 2023 14:14:10 +0000 (14:14 +0000)] 
Fix the pager2-3.1 test case so that it does not run if a required
dependence (shared-cache) is omitted from the build.  Fix for
[forum:/forumpost/7a028538a7|forum post 7a028538a7].

FossilOrigin-Name: a77c8a780f884d0cb01d20912cf1aeec0bb7f3999d23117fe5bd82bc4405d483

2 years agoAllow virtual tables to prepare writes to shadow tables in defensive mode from with...
dan [Fri, 5 May 2023 11:47:31 +0000 (11:47 +0000)] 
Allow virtual tables to prepare writes to shadow tables in defensive mode from with xRelease() callbacks - even if the xRelease() is invoked from within sqlite3_finalize().

FossilOrigin-Name: a17106494a8a67bc92cfe27ee8ef9bf160517d6930d796980ae12287b98c1cfe

2 years agoImproved formatting of comments on SQLITE_CONFIG_xxx defines as those
drh [Fri, 5 May 2023 11:33:59 +0000 (11:33 +0000)] 
Improved formatting of comments on SQLITE_CONFIG_xxx defines as those
comments are used by documentation.

FossilOrigin-Name: 2cb840bc9df81f76699f742e5db03835f4c272548cca0e6d24412503db3d76b3

2 years agoAdd the "subsecond" modifier to the date/time functions.
drh [Thu, 4 May 2023 20:28:19 +0000 (20:28 +0000)] 
Add the "subsecond" modifier to the date/time functions.

FossilOrigin-Name: 6fcb5a941fba0449d017954590bde7da74e5a1f8fd9b3e1febdff9bed1f22051

2 years agoAdd some tests of subsecond modifier for date/time functions. Sync with trunk. subsec-modifier
larrybr [Thu, 4 May 2023 20:19:33 +0000 (20:19 +0000)] 
Add some tests of subsecond modifier for date/time functions. Sync with trunk.

FossilOrigin-Name: 6499ebff545e663198bd0534be205a4e9ca68c7fb20fdcfa54fae4d9b79bfe3a

2 years agoEnhance the format() function so that the "," modifier works for floating
drh [Thu, 4 May 2023 14:44:53 +0000 (14:44 +0000)] 
Enhance the format() function so that the "," modifier works for floating
point numbers in addition to integers.

FossilOrigin-Name: 83683e108bce83c105bbcce1aa62880d8f14ebf3383d87d83a1e5c85026a7817

2 years agoAdd support for the comma (,) modifier to %f formats in the format() function. comma-format
drh [Thu, 4 May 2023 13:07:49 +0000 (13:07 +0000)] 
Add support for the comma (,) modifier to %f formats in the format() function.

FossilOrigin-Name: 7080e196a1f887640ff51ddc508ec6796ce12874c2944855702753b64a8e5e50

2 years agoFix a bug in cursor hints that can cause references to tables that have not
drh [Thu, 4 May 2023 11:29:15 +0000 (11:29 +0000)] 
Fix a bug in cursor hints that can cause references to tables that have not
been opened.  Cursor hints are intended for use by COMDB2 only and should not
appear in production builds, so this should not be a factor for the vast
majority of users.

FossilOrigin-Name: d3370d59cffb7ab982d6c620c93d22aa6a9dc786e1c4af95ca8d45ff0b9b7d6f

2 years agoAdd another assert() to FTS5 to demonstrate that a pointer is never NULL.
drh [Wed, 3 May 2023 14:10:05 +0000 (14:10 +0000)] 
Add another assert() to FTS5 to demonstrate that a pointer is never NULL.

FossilOrigin-Name: b8a84a1bf53fa07ef01c57c6db6329ba439774a262b3adcbe94e7bd77525e296

2 years agoAdd an assert() to fts5_config to ensure that a potential OOM is being handled correctly.
dan [Wed, 3 May 2023 13:57:57 +0000 (13:57 +0000)] 
Add an assert() to fts5_config to ensure that a potential OOM is being handled correctly.

FossilOrigin-Name: fe9c207657400f9d9f4e822eb658157bc147ed538e2701322f6f973933f023ed

2 years agoProtect a macro argument with parentheses in FTS5.
drh [Wed, 3 May 2023 13:48:33 +0000 (13:48 +0000)] 
Protect a macro argument with parentheses in FTS5.

FossilOrigin-Name: bc07fe51fe0c6bb50ca8ae1baefcc35c8f5395b2d0de641bf0b0cedc92d754d4

2 years agoAdd a comment to the [0512f82a2cde7447] change to link it to its TH3 test case.
drh [Wed, 3 May 2023 13:33:37 +0000 (13:33 +0000)] 
Add a comment to the [0512f82a2cde7447] change to link it to its TH3 test case.

FossilOrigin-Name: 1281d4d9d799ef83e6eb51d656ede82b4503d39adf169deb936b30ebfddd88b1

2 years agoEnhancement to showwal such that it shows what the page hash should be
drh [Wed, 3 May 2023 13:03:30 +0000 (13:03 +0000)] 
Enhancement to showwal such that it shows what the page hash should be
on a hash mismatch.

FossilOrigin-Name: 960dc97083ed9a7bfa912010b9ea19114f51dd10e73d5c5bf06cc642ebd1a2e7

2 years agoConform CLI double-quoted escaping to what its doc says.
larrybr [Wed, 3 May 2023 11:27:15 +0000 (11:27 +0000)] 
Conform CLI double-quoted escaping to what its doc says.

FossilOrigin-Name: 910535ba518f35ecc64c980ad67e3af69008d1995235f52ab12db6cefdb6602b

2 years agoIn the zipfile extension, leave the catalog list in a consistent state when
drh [Wed, 3 May 2023 07:30:15 +0000 (07:30 +0000)] 
In the zipfile extension, leave the catalog list in a consistent state when
the last entry is removed from the list.
[forum:/info/f03f1e4c5a5c9959|forum post f03f1e4c5a5c9959].

FossilOrigin-Name: 1b489d008b7bda12f9bf92e246bc613ef61e9c74ace0652d6d088e5a6e0696f6

2 years agoIf the page size is wrong on the page1 content inside a WAL file, then
drh [Wed, 3 May 2023 06:48:08 +0000 (06:48 +0000)] 
If the page size is wrong on the page1 content inside a WAL file, then
running VACUUM could trigger an assert().  This check-in changes that assert()
into a branch that returns SQLITE_CORRUPT.
[forum:/info/4ef9b37d74d2d2e8|Forum post 4ef9b37d74d2d2e8]

FossilOrigin-Name: 0512f82a2cde7447cb348d9fd620f39f2f0e359141903cde20f7ba30b5d34af3

2 years agoImproved detection of excess recursion on arrays and objects in the JSON
drh [Wed, 3 May 2023 06:38:03 +0000 (06:38 +0000)] 
Improved detection of excess recursion on arrays and objects in the JSON
parser.  Fixes a problem detected by dbsqlfuzz.

FossilOrigin-Name: d40fd5924adaa8d6b1dd6b9a4087f64d496cf60096ae11c9229c59309c0d4844

2 years agoDo not overflow the Index.aSample[] array if the same index appears in
drh [Wed, 3 May 2023 05:00:10 +0000 (05:00 +0000)] 
Do not overflow the Index.aSample[] array if the same index appears in
the sqlite_stat4 table under multiple names because it is a WITHOUT ROWID
primary key index.  [forum:/info/537d8ab118df7edd|Forum post 537d8ab118df7edd]

FossilOrigin-Name: 9350a25ac0b55a6b901bc50e4db6d4e883c2617e1d2a8fdc90effabe52bb0012

2 years agoDo not even attempt to load the sqlite_stat4 table if the use of STAT4 is
drh [Wed, 3 May 2023 04:21:31 +0000 (04:21 +0000)] 
Do not even attempt to load the sqlite_stat4 table if the use of STAT4 is
disabled using sqlite3_test_control().

FossilOrigin-Name: 0bf94c77d97582be5368bcfd149f3db7b9f928b4684aaa2626d98a2bdee8f96f