]> git.ipfire.org Git - thirdparty/sqlite.git/log
thirdparty/sqlite.git
3 weeks agoMerge all 3.45.3 changes into the wal2-3.45 branch. wal2-3.45
drh [Mon, 15 Apr 2024 14:21:35 +0000 (14:21 +0000)] 
Merge all 3.45.3 changes into the wal2-3.45 branch.

FossilOrigin-Name: 2ccc0185465615e4d0a270e2767a9d9eae2d9c555b73687bddca469ac4f444ee

3 weeks agoVersion 3.45.3 branch-3.45 release version-3.45.3
drh [Mon, 15 Apr 2024 13:34:05 +0000 (13:34 +0000)] 
Version 3.45.3

FossilOrigin-Name: 8653b758870e6ef0c98d46b3ace27849054af85da891eb121e9aaa537f1e8355

3 weeks agoAdjustment to EQP output in one test case.
drh [Fri, 12 Apr 2024 16:52:13 +0000 (16:52 +0000)] 
Adjustment to EQP output in one test case.

FossilOrigin-Name: 08dd2b927bf8fbda76b4ea07ca1827efa9bb0b68348683abfd19328c117dc405

3 weeks agoIncrease the version number to 3.45.3.
drh [Fri, 12 Apr 2024 15:10:03 +0000 (15:10 +0000)] 
Increase the version number to 3.45.3.

FossilOrigin-Name: 119b3b3c9c9674c218d9c3bbb14b1d2f916d63f290526a3b0e1e17fbdf9e612b

3 weeks agoMark the BTree cell overflow cache as invalid whenever the rowid goes invalid.
drh [Fri, 12 Apr 2024 15:06:54 +0000 (15:06 +0000)] 
Mark the BTree cell overflow cache as invalid whenever the rowid goes invalid.

FossilOrigin-Name: 5266bb6dc99aebcad5380a053cf85ae933f3efba5db249d71400b75b09a8a79e

3 weeks agoFix handling of the SQLITE_OMIT_WAL check in one place. Resolves [forum:87cc13302de16...
stephan [Thu, 11 Apr 2024 19:09:28 +0000 (19:09 +0000)] 
Fix handling of the SQLITE_OMIT_WAL check in one place. Resolves [forum:87cc13302de160eb|forum post 87cc13302de160eb].

FossilOrigin-Name: ce86d30d91a1832ab259129686113cb8f4ea5e8bca89c51df3b1e70721e1e27b

3 weeks agoFix the pragma4.test script so that it works with SQLITE_OMIT_VIRTUALTABLE.
dan [Wed, 10 Apr 2024 16:36:38 +0000 (16:36 +0000)] 
Fix the pragma4.test script so that it works with SQLITE_OMIT_VIRTUALTABLE.

FossilOrigin-Name: 61060c7d0d13764a870340c41d8c48126f3efdb24dadc8c41287bcf79083ceaa

3 weeks agoAvoid some performance problems in the recover extension when recovering strategicall...
dan [Tue, 9 Apr 2024 15:18:34 +0000 (15:18 +0000)] 
Avoid some performance problems in the recover extension when recovering strategically corrupted databases.

FossilOrigin-Name: d83b0ffe8b49b531f423a034d8886c4dae186d317b3ea0322c0a384e8a05b538

4 weeks agoIgnoring CHECK constraints when qualifying the xfer optimization while
drh [Tue, 9 Apr 2024 14:07:37 +0000 (14:07 +0000)] 
Ignoring CHECK constraints when qualifying the xfer optimization while
running VACUUM.

FossilOrigin-Name: bb6f9908098baa84b9c3b6f747ec8df6a5cf55c790ba1f172085f16394d684f2

4 weeks agoFix obscure issues associated with SQLITE_ALLOW_ROWID_IN_VIEW and
drh [Fri, 5 Apr 2024 14:06:21 +0000 (14:06 +0000)] 
Fix obscure issues associated with SQLITE_ALLOW_ROWID_IN_VIEW and
indexes on virtual columns in a RIGHT JOIN.

FossilOrigin-Name: 4b3a253fc750c30ba01cff2a8a3ca2e1fd19973372d0e4249ae9468593905f62

4 weeks agoFix exception propagation when the opfs-sahpool VFS fails to initialize to address...
stephan [Thu, 4 Apr 2024 12:37:05 +0000 (12:37 +0000)] 
Fix exception propagation when the opfs-sahpool VFS fails to initialize to address report in [forum:be0141c639|forum post be0141c639].

FossilOrigin-Name: db31d178d65de663fb4df69c48600686ffd9684d3081ae10e0d6885cdf5adaa5

6 weeks agoFix the xBestIndex method of the pragma virtual table so that it correctly
drh [Sun, 24 Mar 2024 21:18:03 +0000 (21:18 +0000)] 
Fix the xBestIndex method of the pragma virtual table so that it correctly
gives a higher cost to plans where the schema hidden parameter is
unconstrained.

FossilOrigin-Name: ec791413d55c8be881350efd0cd27a474e022c7115740bfe00914e61433977d3

6 weeks agoFix the SQLITE_ALLOW_ROWID_IN_VIEW bug-compatibility option so that it works
drh [Sun, 24 Mar 2024 19:08:05 +0000 (19:08 +0000)] 
Fix the SQLITE_ALLOW_ROWID_IN_VIEW bug-compatibility option so that it works
again. Add the SQLITE_CONFIG_ROWID_IN_VIEW sqlite3_config() value to
optionally disable the bug-compatibility mode at start-time.
Enable testing of SQLITE_ALLOW_ROWID_IN_VIEW.

FossilOrigin-Name: 7a3d0027f81e8def49e2a665c9202b966c37f066b1298476e4d7d72e56323f85

6 weeks agoFix a assert() that is incorrect, though harmless. Also add a test case.
drh [Thu, 21 Mar 2024 22:12:45 +0000 (22:12 +0000)] 
Fix a assert() that is incorrect, though harmless.  Also add a test case.

FossilOrigin-Name: 90537ce044c50ecca35920ecb27c7fb07d535be828ea943416c4633008d360b9

7 weeks agoFix a problem involving infinities int the Kahan-Babushka-Neumaier summation algorithm.
drh [Tue, 19 Mar 2024 10:58:59 +0000 (10:58 +0000)] 
Fix a problem involving infinities int the Kahan-Babushka-Neumaier summation algorithm.

FossilOrigin-Name: 8af5878138f30515c0d4031cb4450a1b6f96a023a8f2dd5e6591a1096b1ecaa6

8 weeks agoMerge all 3.45.2 patches into the wal2-3.45 subbranch.
drh [Tue, 12 Mar 2024 11:55:49 +0000 (11:55 +0000)] 
Merge all 3.45.2 patches into the wal2-3.45 subbranch.

FossilOrigin-Name: 64d740c59499877ddb6eadaaefb86f191efab4760551d6a6bae80399018faff2

8 weeks agoVersion 3.45.2 version-3.45.2
drh [Tue, 12 Mar 2024 11:06:23 +0000 (11:06 +0000)] 
Version 3.45.2

FossilOrigin-Name: d8cd6d49b46a395b13955387d05e9e1a2a47e54fb99f3c9b59835bbefad6af77

8 weeks agoMerge the branch-3.45 patches into the wal2 branch.
drh [Mon, 11 Mar 2024 23:23:52 +0000 (23:23 +0000)] 
Merge the branch-3.45 patches into the wal2 branch.

FossilOrigin-Name: f8cee91f5d3eab534534c278146cf0876d54e467e7f51369b8e81c532ede9f54

8 weeks agoFix the ".import" command in the CLI so that it works correctly with tables
drh [Mon, 11 Mar 2024 11:26:20 +0000 (11:26 +0000)] 
Fix the ".import" command in the CLI so that it works correctly with tables
that contain computed columns.

FossilOrigin-Name: b26f24441f84a30deb9a562ab6c6de7543fbc3b3b93c34277964c9c21d734153

8 weeks agoReenable the use of SQLITE_OMIT_VIRTUALTABLE by fixing
drh [Sat, 9 Mar 2024 13:17:12 +0000 (13:17 +0000)] 
Reenable the use of SQLITE_OMIT_VIRTUALTABLE by fixing
a misplaced #endif caused by the merge at [c080560c2d0d753c].

FossilOrigin-Name: 71120ea83783ee04c6dd9ef260f6ec528935b5ea3baf2348c6d5ec258093271b

8 weeks agoFix the rtreeJ.test module to align it with [cd017c28d516399e].
drh [Sat, 9 Mar 2024 13:10:28 +0000 (13:10 +0000)] 
Fix the rtreeJ.test module to align it with [cd017c28d516399e].

FossilOrigin-Name: 111b3d8270db4f61efd9f4c02636f50e44bd9547261d1d922de2708bc7a07151

8 weeks agoHandle an OOM case in fts5 code to query tokendata=1 tables.
drh [Sat, 9 Mar 2024 12:30:30 +0000 (12:30 +0000)] 
Handle an OOM case in fts5 code to query tokendata=1 tables.

FossilOrigin-Name: ebf59fa374000169e2ab3f353e2d7c15efd32e3ce2297e893461e6c303de5d4a

8 weeks agoThe NOT NULL strength reduction optimization should
drh [Sat, 9 Mar 2024 00:38:57 +0000 (00:38 +0000)] 
The NOT NULL strength reduction optimization should
be applied to the WHERE clause only.

FossilOrigin-Name: be266c713963d724802f5e9ad9d7d3c3d7f4daf1d95b63df6df1beb3a065bdab

8 weeks agoSilently ignore redundant ON CONFLICT clauses in an UPSERT.
drh [Fri, 8 Mar 2024 14:11:49 +0000 (14:11 +0000)] 
Silently ignore redundant ON CONFLICT clauses in an UPSERT.

FossilOrigin-Name: 46245855a0be1b4ed0efcde30f0919fb6361affc4443a4ed2fdac01ab6864df1

2 months agoFix a memory leak in new memdb1.test test cases that were added by
drh [Wed, 6 Mar 2024 21:53:55 +0000 (21:53 +0000)] 
Fix a memory leak in new memdb1.test test cases that were added by
[e638d5e408ea2e18].  No changes to SQLite itself.

FossilOrigin-Name: f0a49dc8bc22d4889677d03beccda8f71f7374ae56b5c78f7395769f9272dc77

2 months agoFix harmless compiler warning seen with MSVC.
mistachkin [Wed, 6 Mar 2024 21:22:34 +0000 (21:22 +0000)] 
Fix harmless compiler warning seen with MSVC.

FossilOrigin-Name: 5aa809bcfecc321f122a60f43bc674c7f099cf1ccb2ed976dabb29d8fde83adc

2 months agoFix harmless compiler warnings seen with MSVC.
mistachkin [Wed, 6 Mar 2024 21:08:42 +0000 (21:08 +0000)] 
Fix harmless compiler warnings seen with MSVC.

FossilOrigin-Name: c0f61524103d2421aa1e0fe39f028eed04d115bb4eb245b6c8623bd1c6fed481

2 months agoFix a minor test file locking issue on Windows.
mistachkin [Wed, 6 Mar 2024 21:06:07 +0000 (21:06 +0000)] 
Fix a minor test file locking issue on Windows.

FossilOrigin-Name: a44752806f854f06e787bb789d7dbf647219f15d3e315853bb4bc8049f47ef09

2 months agoWork around obscure floating point issue seen with older versions of MSVC.
mistachkin [Wed, 6 Mar 2024 21:00:13 +0000 (21:00 +0000)] 
Work around obscure floating point issue seen with older versions of MSVC.

FossilOrigin-Name: 6055715febf6e61e37125635b7ec29392fbaab367927411617f5e15d9a95cb82

2 months agoFix two -Werror=lto-type-mismatch warnings reported in [forum:ef62b57bd5|forum post...
mistachkin [Wed, 6 Mar 2024 20:59:38 +0000 (20:59 +0000)] 
Fix two -Werror=lto-type-mismatch warnings reported in [forum:ef62b57bd5|forum post ef62b57bd5].

FossilOrigin-Name: d4e423f3a466a39e435efba81ac33fd80164aaaa43827c2f4f965c1e77b3ef6c

2 months agoThe quote() SQL function should convert +Inf into 9.0e+999 and -Inf into -9.0e+999...
mistachkin [Wed, 6 Mar 2024 20:58:52 +0000 (20:58 +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: 07a9ef888db05a85c2baf8781e5ac51a9dd27e0ef94ca4ebd750045e9690226b

2 months agoMake sure key comprisons are done correctly if the index key contains NaN values...
mistachkin [Wed, 6 Mar 2024 20:58:08 +0000 (20:58 +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: 7ed922d99ca9801dc1926df529b2fa93be374f587885282ab6e307ea6cf2ccee

2 months agoWhen inserting a 3-byte cell into a btree, ensure that the extra padding byte is...
mistachkin [Wed, 6 Mar 2024 20:56:52 +0000 (20:56 +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: f3e841873dffaa8cd2f4f3cf260487ed402febb99b9ccad04e2a1d481e903aca

2 months agoRig sqlite3_serialize() so that it will initialize a previously uninitialized databas...
mistachkin [Wed, 6 Mar 2024 20:55:44 +0000 (20:55 +0000)] 
Rig sqlite3_serialize() so that it will initialize a previously uninitialized database prior to serializing it, so that it does not have a zero-byte size and does not return NULL (except for OOM).  [forum:/forumpost/498777780e16880a|Forum thread 498777780e16880a].

FossilOrigin-Name: 22a33f133e3e833c960f46e1b4c74043010181ff7ba9e57f2d009b65d3275d82

2 months agoWhen doing a text-affinity comparison between two values where one or both have both...
mistachkin [Wed, 6 Mar 2024 20:54:38 +0000 (20:54 +0000)] 
When doing a text-affinity comparison between two values where one or both have both a text and a numeric type, make sure the numeric type does not confuse the answer.  This is a deeper fix to the problem observed by [forum:/forumpost/3776b48e71|forum post 3776b48e71].  The problem bisects to [25f2246be404f38b] on 2014-08-24, prior to version 3.8.7.

FossilOrigin-Name: 6d385ccda8aba16a37c5e8c39f3aeba97c472321e4c8c9efac2de4518b61bdc8

2 months agoEnsure that the replace() SQL function always returns a TEXT value even when its...
mistachkin [Wed, 6 Mar 2024 20:52:38 +0000 (20:52 +0000)] 
Ensure that the replace() SQL function always returns a TEXT value even when its first argument is numeric and its second argument is an empty string.  Fix for the issue reported by [forum:/forumpost/3776b48e71|forum post 3776b48e71].

FossilOrigin-Name: a7c98c8f19a1ac049b846da584b246706f2159455f4de7b50aacc1385b9f2987

2 months agoReformulate [34439fe3aeea7cbb] slightly to resolve a false-positive OOM reported...
stephan [Tue, 5 Mar 2024 17:39:56 +0000 (17:39 +0000)] 
Reformulate [34439fe3aeea7cbb] slightly to resolve a false-positive OOM reported in [forum:2eadfe94e3|forum post 2eadfe94e3].

FossilOrigin-Name: 320ccb5d5f5c3b25b319426b62c8a86fc3209a04480f5ca7f6f40cb16f04c795

2 months agoThe value returned by the json_each.json field needs to survive longer than
drh [Tue, 5 Mar 2024 16:59:00 +0000 (16:59 +0000)] 
The value returned by the json_each.json field needs to survive longer than
the json_each virtual table itself, in the event that the value is used in
an aggregate expression.  dbsqlfuzz 5120bd0b3bb0b73eebbcb79ac37c6b0663fccad6

FossilOrigin-Name: 040946b342fd532692025806c124643842fdfda55e0c492cd058dcb7f054cc79

2 months agoFix rounding in zero-precision %f and %g printf conversions.
drh [Sat, 17 Feb 2024 03:36:05 +0000 (03:36 +0000)] 
Fix rounding in zero-precision %f and %g printf conversions.

FossilOrigin-Name: 1ebea57ff212aaac83f388cdebd13f319a7c57b0cdc7467b26d3f49cb7e39666

2 months agoFix the subtype on the value column from json_each/json_tree for cases
drh [Fri, 16 Feb 2024 21:34:08 +0000 (21:34 +0000)] 
Fix the subtype on the value column from json_each/json_tree for cases
when the value is an array or object.

FossilOrigin-Name: b278ae3980066e5d0561baa869ef6d22d10cbd0481d1bc0e67f099e93fc3a93b

2 months agoFix a bug in PRAGMA integrity_check introduced by enhancement (8a) in
drh [Tue, 13 Feb 2024 18:44:28 +0000 (18:44 +0000)] 
Fix a bug in PRAGMA integrity_check introduced by enhancement (8a) in
release 3.42.0.

FossilOrigin-Name: 60dccb23b11f7e4a743e867f393f34f673600c12f1e7199e505f2e2b81c6dacd

2 months agoHave rtree avoid keeping a blob handle open following an error.
drh [Mon, 12 Feb 2024 17:01:33 +0000 (17:01 +0000)] 
Have rtree avoid keeping a blob handle open following an error.

FossilOrigin-Name: 26978f34bd03b052d40fbc84037fb0e0ca04e571cf8055bf834e9da1dc3cec83

2 months agoCherrypick multiple fixes for trifling faults from trunk, so that all 834
drh [Sun, 11 Feb 2024 23:25:02 +0000 (23:25 +0000)] 
Cherrypick multiple fixes for trifling faults from trunk, so that all 834
dbsqlfuzz run clean with ASAN on branch-3.45.
dbsqlfuzz.

FossilOrigin-Name: c080560c2d0d753c41c265c154c8185b7b5065ba1f2457476aa39c687675d91f

2 months agoFurther clarify sqlite3_exec() callback parameter lifetime.
larrybr [Sat, 10 Feb 2024 03:12:46 +0000 (03:12 +0000)] 
Further clarify sqlite3_exec() callback parameter lifetime.

FossilOrigin-Name: 044ce823a45f024fe3dfe8a44bab8f25affb7bc54cfbe01a00719217b93ff6f8

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

FossilOrigin-Name: d14a9d81a59cb55be68cc057166050cbb9b474be865a6998a9beeed54d6b388d

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

FossilOrigin-Name: 77431aca6ec0aaeacdc9173ca19e996498650ad19934fc77681203c0c9f06632

2 months agoReturn SQLITE_ABORT if the underlying shadow tables change in the middle of an rtree...
drh [Tue, 6 Feb 2024 13:36:29 +0000 (13:36 +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 [97cffff331b].

FossilOrigin-Name: 061af0d74a436efa24b348e9a0f9fe6d6d52c02e5c03929e6f9c7f0e2ef3e2a0

3 months agoFollowing a ROLLBACK that reverts changes to an RTREE, any pending queries
drh [Sat, 3 Feb 2024 19:41:34 +0000 (19:41 +0000)] 
Following a ROLLBACK that reverts changes to an RTREE, any pending queries
against that same RTREE abort with code SQLITE_ABORT_ROLLBACK.

FossilOrigin-Name: 97cffff331b5f95abed5451f9d0cef085c3fc8911efbcd2422c1c78eac17b669

3 months agoMerge the changes from the 3.45.1 patch release into the wal2 branch.
drh [Tue, 30 Jan 2024 16:53:20 +0000 (16:53 +0000)] 
Merge the changes from the 3.45.1 patch release into the wal2 branch.

FossilOrigin-Name: 5e980265c89bb1daf8b73cf9566ddb88695511b73685777686a891ca730c435b

3 months agoVersion 3.45.1 version-3.45.1 vesion-3.45.1
drh [Tue, 30 Jan 2024 16:01:20 +0000 (16:01 +0000)] 
Version 3.45.1

FossilOrigin-Name: e876e51a0ed5c5b3126f52e532044363a014bc594cfefa87ffb5b82257cc467a

3 months agoDetect malformed nested JSONB earlier and stop rendering to avoid long
drh [Mon, 29 Jan 2024 21:29:22 +0000 (21:29 +0000)] 
Detect malformed nested JSONB earlier and stop rendering to avoid long
delays.

FossilOrigin-Name: ab40e282465c989bf249453d7c6f60072a38b691f579411cdf9aad234b20f0f7

3 months agoAvoid a potential buffer overread when handling corrupt json blobs.
drh [Mon, 29 Jan 2024 16:49:28 +0000 (16:49 +0000)] 
Avoid a potential buffer overread when handling corrupt json blobs.

FossilOrigin-Name: ac402cc551b2cbe3f8fbbc9c711a04942eab5eeb9d2f4a394e9370d2380427b5

3 months agoWhen rendering JSONB back into text JSON, report an error if a zero-length
drh [Mon, 29 Jan 2024 12:58:12 +0000 (12:58 +0000)] 
When rendering JSONB back into text JSON, report an error if a zero-length
integer or floating-point node is encountered.  Otherwise, if the node occurs
at the very end of the JSONB, the rendering logic might read one byte past
the end of the initialized part of the BLOB byte array.  OSSFuzz 66284.

FossilOrigin-Name: 3ab08ac75d97ffd9920f5c924362a4819560b40faa8a4f9100068057f5fa420a

3 months agoAutomatically disable the DISTINCT optimization during query planning if the
drh [Sun, 28 Jan 2024 17:44:47 +0000 (17:44 +0000)] 
Automatically disable the DISTINCT optimization during query planning if the
ORDER BY clause exceeds 63 terms.

FossilOrigin-Name: 6edbdcc02d18727f68f0236e15dde4ecfc77e6f452b522eb4e1e895929b1fb63

3 months agoApply the same fix found in [99057383acc8f920] to descending scans.
drh [Sun, 28 Jan 2024 00:35:24 +0000 (00:35 +0000)] 
Apply the same fix found in [99057383acc8f920] to descending scans.

FossilOrigin-Name: 593d6a1c2e9256d797f160e867278414e882a3d04d7fea269bea86965eaa7576

3 months agoSlight adjustment to test results for Windows in mmap1.test due to
drh [Tue, 23 Jan 2024 21:10:28 +0000 (21:10 +0000)] 
Slight adjustment to test results for Windows in mmap1.test due to
the previous check-in.

FossilOrigin-Name: a8043eaed899285b5cf4aab0c23c3dabb8975910c353cb579fd1f1655db390f6

3 months agoIn os_unix.c and os_win.c, do not allow xFetch() to return a pointer to a page buffer...
drh [Tue, 23 Jan 2024 16:17:00 +0000 (16:17 +0000)] 
In os_unix.c and os_win.c, do not allow xFetch() to return a pointer to a page buffer that is right at the end of the mapped region - if the database is corrupted in a specific way such a page buffer might be overread by several bytes.

FossilOrigin-Name: d131cab652ac11795322af13d0b330e7e44ab91587a1a3e73fe7b9a14b2dd531

3 months agoFix harmless "unused parameter" compiler warning in the new fts3IntegrityMethod
drh [Tue, 23 Jan 2024 15:04:07 +0000 (15:04 +0000)] 
Fix harmless "unused parameter" compiler warning in the new fts3IntegrityMethod
implementation.

FossilOrigin-Name: 9d459f6b50fb6f995e6284a0815c5e211cacac44aad0b96bf01ba68af97f51fc

3 months agoBump the version number to 3.45.1
drh [Tue, 23 Jan 2024 13:58:41 +0000 (13:58 +0000)] 
Bump the version number to 3.45.1

FossilOrigin-Name: 54d34edb89430b266221b7e6eea0afbd2c9dafbe774344469473abc8ad1e13fd

3 months agoWhen a JSON input is a blob, but it looks like valid JSON when cast to text,
drh [Tue, 23 Jan 2024 13:53:45 +0000 (13:53 +0000)] 
When a JSON input is a blob, but it looks like valid JSON when cast to text,
then accept it as valid JSON.  This replicates a long-standing bug in the
behavior of JSON routines, and thus avoids breaking legacy apps.

FossilOrigin-Name: 4c2c1b97dce46a279846380c937ac6de5c367927c6843516641eead7ea6db472

3 months agoEnsure that the xIntegrity methods of fts3 and fts5 work on read-only databases.
dan [Tue, 23 Jan 2024 10:47:04 +0000 (10:47 +0000)] 
Ensure that the xIntegrity methods of fts3 and fts5 work on read-only databases.

FossilOrigin-Name: e79b97369fa740f62f695057d4a2cf8dae48a683982ec879f04a19039c9cb418

3 months agoWhen backing out a character in a constructed string in JSON, first make sure
drh [Sat, 20 Jan 2024 12:19:16 +0000 (12:19 +0000)] 
When backing out a character in a constructed string in JSON, first make sure
the string has not been reset by on OOM.

FossilOrigin-Name: 950bf9fe7829864e0abe6d71ca0495f346feb5d7943d76c95e55a6b86ea855da

3 months agowasm build: reformulate an awk invocation to account for awks which do not support...
stephan [Tue, 16 Jan 2024 14:28:59 +0000 (14:28 +0000)] 
wasm build: reformulate an awk invocation to account for awks which do not support the -e flag. Problem reported on the forum via a docker-hosted build.

FossilOrigin-Name: 90dd51153fd0a6197e2ee49b5492ad120f0bfc324b60651f3d4f47c286887b46

3 months agoVersion 3.45.0 version-3.45.0
drh [Mon, 15 Jan 2024 17:01:13 +0000 (17:01 +0000)] 
Version 3.45.0

FossilOrigin-Name: 1066602b2b1976fe58b5150777cced894af17c803e068f5918390d6915b46e1d

3 months agoMerge latest trunk changes into this branch.
dan [Sat, 13 Jan 2024 20:21:36 +0000 (20:21 +0000)] 
Merge latest trunk changes into this branch.

FossilOrigin-Name: 68c2b8d0ebd1a180c4828cb4996c6c5fd67386c3b6304edf587c255f8d067c24

3 months agoHave the shell tool automatically enable SQLITE_CONFIG_DQS_DDL when executing a ...
dan [Fri, 12 Jan 2024 11:44:49 +0000 (11:44 +0000)] 
Have the shell tool automatically enable SQLITE_CONFIG_DQS_DDL when executing a ".dump" script against an empty db.

FossilOrigin-Name: f47a5f4e0ce078e6cc1183e6cbb3c4013af379b496efae94863a42e5c39928ed

3 months agoFix a comment in sessions. No functional changes.
drh [Thu, 11 Jan 2024 14:13:17 +0000 (14:13 +0000)] 
Fix a comment in sessions.  No functional changes.
[forum:/forumpost/8c20dc935b|Forum post 8c20dc935b].

FossilOrigin-Name: b0eb6d3628c1f70399a22d9fd3b79a796bc343adfeba50515440db609565961a

3 months agoIn fts5, flush the contents of the in-memory hash table whenever the secure-delete...
dan [Thu, 11 Jan 2024 14:03:08 +0000 (14:03 +0000)] 
In fts5, flush the contents of the in-memory hash table whenever the secure-delete option is toggled. This prevents spurious corruption reports under some circumstances.

FossilOrigin-Name: ccf552319a62bfb329820a3bc1f490bacbaa6e90694a257fc65a568a605542c3

3 months agoPut an SQLITE_ENABLE_SETLK_TIMEOUT branch inside the appropriate ifdef with
drh [Tue, 9 Jan 2024 23:15:46 +0000 (23:15 +0000)] 
Put an SQLITE_ENABLE_SETLK_TIMEOUT branch inside the appropriate ifdef with
an assert on the else since the condition is always false if SETLK_TIMEOUT
is not available.

FossilOrigin-Name: d81e7a036ac5d70b6a6ee6ab7d81e041c1f5fc04b70bcee47e203d521caf7e93

3 months agoImproved resolution of unqualified names in the REINDEX command.
drh [Tue, 9 Jan 2024 12:28:51 +0000 (12:28 +0000)] 
Improved resolution of unqualified names in the REINDEX command.
[forum:/info/74cd0ceabd|Forum thread 74cd0ceabd].

FossilOrigin-Name: 97709ce2a1f5ae05495e412ca27108048e5b8a63a1e3bca4be13933f7527da7b

3 months agoAutomatically turn off DEFENSIVE mode in the shell tool when executing scripts genera...
dan [Mon, 8 Jan 2024 19:55:40 +0000 (19:55 +0000)] 
Automatically turn off DEFENSIVE mode in the shell tool when executing scripts generated by the ".dump" command against an empty database. Add a warning to the top of generated ".dump" scripts that populate virtual tables.

FossilOrigin-Name: cd016f26bb61549a304f2148035e050f76a8f4a35cdb7131bba2f5fc5d09f49e

3 months agoFix date on new file shell9.test. shell-dump-fix
dan [Mon, 8 Jan 2024 18:53:27 +0000 (18:53 +0000)] 
Fix date on new file shell9.test.

FossilOrigin-Name: c82da712113d5dcd63b764dbc68842026989627abc840acb4a33f3a4972b832a

3 months agoAutomatically turn off DEFENSIVE mode in the shell tool when executing scripts genera...
dan [Mon, 8 Jan 2024 18:46:34 +0000 (18:46 +0000)] 
Automatically turn off DEFENSIVE mode in the shell tool when executing scripts generated by the ".dump" command against an empty database. Add a warning to the top of generated ".dump" scripts that populate virtual tables.

FossilOrigin-Name: 6e9e96b7e7afb9420110f4b93d10b945c9eadfde5e9c81e59ae9ee8167e75707

3 months agoMinor change to os_unix.c to facilitate 100% MC/DC testing.
drh [Mon, 8 Jan 2024 15:23:45 +0000 (15:23 +0000)] 
Minor change to os_unix.c to facilitate 100% MC/DC testing.

FossilOrigin-Name: 0dfa7b4da134db281c3c4eddb4569c53a450f955f0af2f410e13db801aff4ea2

3 months agoEnsure that SQLITE_PROTOCOL is not returned too early when a SQLITE_ENABLE_SETLK_TIME...
dan [Mon, 8 Jan 2024 13:38:15 +0000 (13:38 +0000)] 
Ensure that SQLITE_PROTOCOL is not returned too early when a SQLITE_ENABLE_SETLK_TIMEOUT build fails to open a transaction on a wal mode database in cases where blocking locks are not being used.

FossilOrigin-Name: a8e9af1356f5fb2ec460f932dfbe89283bb4e3cf9fa677d1acdbe77ffa11dd04

3 months agoRemove an ALWAYS() from RTREE. Dbsqlfuzz found a way to make it false.
drh [Sun, 7 Jan 2024 20:27:54 +0000 (20:27 +0000)] 
Remove an ALWAYS() from RTREE.  Dbsqlfuzz found a way to make it false.

FossilOrigin-Name: 40f0a29e6dd90fcb969d7c0e49728ba0ee8f31d9e8f502b9a21469620a8ad283

3 months agoUpdates to RTREE to facility testing.
drh [Sun, 7 Jan 2024 00:45:53 +0000 (00:45 +0000)] 
Updates to RTREE to facility testing.

FossilOrigin-Name: 7a5b42ff74882c58493dc8b710fde73d4ff251f5d42271d84be73ceaabc01698

4 months agoEnsure that SQLITE_PROTOCOL is not returned too early when a SQLITE_ENABLE_SETLK_TIME... enable-setlk-fix
dan [Sat, 6 Jan 2024 19:16:54 +0000 (19:16 +0000)] 
Ensure that SQLITE_PROTOCOL is not returned too early when a SQLITE_ENABLE_SETLK_TIMEOUT build fails to open a transaction on a wal mode database in cases where blocking locks are not being used.

FossilOrigin-Name: b934a33671d8a0190082ad7e5e68c78fe0c558d102404eafc1de26e4e7d65b92

4 months agoUpdate JSON performance testing procedures for clarity and to describe how to
drh [Sat, 6 Jan 2024 15:22:16 +0000 (15:22 +0000)] 
Update JSON performance testing procedures for clarity and to describe how to
do performance testing of JSONB.

FossilOrigin-Name: b115b4f75bc7c4e6d9bab5edf13297f27a36f30083c80d2c502b01208da5dfc0

4 months agoUpdate extension ext/misc/totext.c to avoid both ubsan warnings and dubious real...
dan [Sat, 6 Jan 2024 13:58:54 +0000 (13:58 +0000)] 
Update extension ext/misc/totext.c to avoid both ubsan warnings and dubious real->integer conversions.

FossilOrigin-Name: 541436004df6458dc2f38bdfa421099f78cab397f5f4795ca5f227531aaa6a3e

4 months agoUpdate extension ext/misc/totext.c to avoid both ubsan warnings and dubious real... totype-fix
dan [Fri, 5 Jan 2024 15:53:58 +0000 (15:53 +0000)] 
Update extension ext/misc/totext.c to avoid both ubsan warnings and dubious real->integer conversions.

FossilOrigin-Name: c626aa108a7a30cef54af8d93ac9e45749568ed38e4e06623a6bad6b4bf6e8ec

4 months agoAvoid errors with SQLITE_OMIT_VIRTUALTABLE builds in json106.test and unionall.test.
drh [Thu, 4 Jan 2024 17:13:39 +0000 (17:13 +0000)] 
Avoid errors with SQLITE_OMIT_VIRTUALTABLE builds in json106.test and unionall.test.

FossilOrigin-Name: 8940e2a1054fbc19fae3f76e743d744840c3a5aad001be8d3d56ca134226c34b

4 months agoMerge the latest trunk enhancements into the wal2 branch.
drh [Thu, 4 Jan 2024 16:16:41 +0000 (16:16 +0000)] 
Merge the latest trunk enhancements into the wal2 branch.

FossilOrigin-Name: 8fb42df89a47b716c824de8742b7e3bda1a5c0f9a85ce3f328d7aa94ab735497

4 months agoAvoid errors with SQLITE_OMIT_VIRTUALTABLE builds in json106.test and unionall.test.
dan [Thu, 4 Jan 2024 16:15:21 +0000 (16:15 +0000)] 
Avoid errors with SQLITE_OMIT_VIRTUALTABLE builds in json106.test and unionall.test.

FossilOrigin-Name: 90e8a233549a2d31e6959ce3fec927693b772ab3c0abce65e81d7350d2ca5cc6

4 months agoRestructure some code to fix what appears to be a false-positive UBSAN warning.
drh [Thu, 4 Jan 2024 13:01:02 +0000 (13:01 +0000)] 
Restructure some code to fix what appears to be a false-positive UBSAN warning.

FossilOrigin-Name: fe952c12903ea2150880c8bb57cda2efc00ce9fa801568a68c619e0745f30567

4 months agoFix a #ifdef in sqlite3_test_control() that was preventing builds with
drh [Wed, 3 Jan 2024 20:40:17 +0000 (20:40 +0000)] 
Fix a #ifdef in sqlite3_test_control() that was preventing builds with
SQLITE_OMIT_WSD.

FossilOrigin-Name: d546a9c94caf7408cc6e4530ec190d3a13fae09dc15b71b03d6369e02ee62abd

4 months agoConvert the JSON functions to use lookaside memory allocation whenever
drh [Wed, 3 Jan 2024 16:41:50 +0000 (16:41 +0000)] 
Convert the JSON functions to use lookaside memory allocation whenever
feasible, to avoid hitting the global memory allocator mutex.

FossilOrigin-Name: a79a244954f728596da3c0e28fa3b887258d1bd831f53881970f418f3fba84c7

4 months agoChange a constant from decimal to hex to avoid a compiler warning on Mac.
drh [Wed, 3 Jan 2024 15:49:04 +0000 (15:49 +0000)] 
Change a constant from decimal to hex to avoid a compiler warning on Mac.

FossilOrigin-Name: e3acb8a43ad544fd5b5341058276bd3b61b6bdb6b719790476a90e0de4320f90

4 months agoEnhance sqlite3_analyzer.exe so that it uses the ext/consio extension.
drh [Wed, 3 Jan 2024 14:13:27 +0000 (14:13 +0000)] 
Enhance sqlite3_analyzer.exe so that it uses the ext/consio extension.

FossilOrigin-Name: 769de0b98e136e4a0945b80216d0c9583c1ccd9de69cb0494875c2300e172646

4 months agoUpdate the sqldiff.exe utility program so that it uses the sqlite3_str
drh [Wed, 3 Jan 2024 12:26:02 +0000 (12:26 +0000)] 
Update the sqldiff.exe utility program so that it uses the sqlite3_str
string interface, and so that it does console output using the
ext/consio extension.

FossilOrigin-Name: 4443b7e592da97d1cb1b3b79ed0559452d8057a33aba4d184c2fffbf200e05f5

4 months agoBack out [b517a52fa36df0a0] which is no longer reachable due to early
drh [Tue, 2 Jan 2024 22:49:14 +0000 (22:49 +0000)] 
Back out [b517a52fa36df0a0] which is no longer reachable due to early
error detection enhancements in [166e82dd20efbfd3].

FossilOrigin-Name: 704943e96f2620b99260667ac9922c2f72bc3e92e2dfe1d9c2a91c7b704564d9

4 months agoAdjust the sqlite3PagerDirectReadOk() routine (part of the
drh [Tue, 2 Jan 2024 21:37:51 +0000 (21:37 +0000)] 
Adjust the sqlite3PagerDirectReadOk() routine (part of the
SQLITE_DIRECT_OVERFLOW_READ optimization) to use less code and to be
more easily testable.

FossilOrigin-Name: eed670ea2a9424f7df4eeb01c152fc38f7190a5e39aa891651b28dc91fcdc019

4 months agoFix a problem in fts5 caused by a COMMIT involving fts5 data that immediately follows...
dan [Tue, 2 Jan 2024 21:08:25 +0000 (21:08 +0000)] 
Fix a problem in fts5 caused by a COMMIT involving fts5 data that immediately follows a ROLLBACK TO that does not.

FossilOrigin-Name: 55c61f6a8d6a1bc79497b05669beac5c5397b06382bf24b6bec54845962d219b

4 months agoIncrease the default "max_page_count" to its theoretical maximum of
drh [Tue, 2 Jan 2024 20:34:27 +0000 (20:34 +0000)] 
Increase the default "max_page_count" to its theoretical maximum of
4294967294.

FossilOrigin-Name: ffb35f1784a4305b979a850485f57f56938104a3a03f4a7aececde92864c4879

4 months agoElaborate on the various build flavors used by ext/wasm/. Doc changes only.
stephan [Tue, 2 Jan 2024 09:20:53 +0000 (09:20 +0000)] 
Elaborate on the various build flavors used by ext/wasm/. Doc changes only.

FossilOrigin-Name: d489232aa492618d4c8e5817addb2323d0ca067742d7140216914239a66fb221

4 months agoUpdate and clean up the in-makefile docs for ext/wasm.
stephan [Tue, 2 Jan 2024 09:03:42 +0000 (09:03 +0000)] 
Update and clean up the in-makefile docs for ext/wasm.

FossilOrigin-Name: 7a7b295e6d7e95ee4a46cc42761895d11700ab295870c5a4380072bb4a5b7099

4 months agoBack out [99d11e6d0ae6] (enabling of STAT4 in WASM/JNI), per /chat discussion.
stephan [Mon, 1 Jan 2024 23:28:02 +0000 (23:28 +0000)] 
Back out [99d11e6d0ae6] (enabling of STAT4 in WASM/JNI), per /chat discussion.

FossilOrigin-Name: cd7929ee2e2c305475fa5a4dff2edaccf90067126ef04a1c2714cf464925453f

4 months agoNew logic to avoid using indexes that ANALYZE has identified as of little
drh [Mon, 1 Jan 2024 19:20:00 +0000 (19:20 +0000)] 
New logic to avoid using indexes that ANALYZE has identified as of little
practical use.  Also a performance optimization in ANALYZE.

FossilOrigin-Name: bcac937526d9a6ef914a74b4d6757fa91cd74edab871bcd934fde4a2f9b6debd

4 months agoRemove some unnecessary computations from ANALYZE so that ANALYZE runs with avoid-low-quality-indexes
drh [Mon, 1 Jan 2024 17:58:57 +0000 (17:58 +0000)] 
Remove some unnecessary computations from ANALYZE so that ANALYZE runs with
fewer CPU cycles.  These changes were spotted while working on the nearby
enhanced-stat1 branch.  So even if enhanced-stat1 is abandoned, that effort
put into it will not have been in vain.

FossilOrigin-Name: 5527e8c4abb904b1a438ec1c353d4a960bf82faaf3a2c742af1df7c613850441

4 months agoExtra steps taken to avoid using low-quality indexes in a query plan.
drh [Mon, 1 Jan 2024 17:48:02 +0000 (17:48 +0000)] 
Extra steps taken to avoid using low-quality indexes in a query plan.
This branch accomplishes the same end as the nearby enhanced-stat1 branch,
but with much less change and hence less risk.

FossilOrigin-Name: c030e646262fee43a59b45fdc1630d972f8bf88ac3c142b6bdaf4cbb36695a4f