]> git.ipfire.org Git - thirdparty/sqlite.git/log
thirdparty/sqlite.git
17 months agoMerge the 3.45.1 patch release into the begin-concurrent branch. begin-concurrent-3.45.1
drh [Tue, 30 Jan 2024 16:50:05 +0000 (16:50 +0000)] 
Merge the 3.45.1 patch release into the begin-concurrent branch.

FossilOrigin-Name: d1f20a47f736749efbf5020948ca651fb8d25e583f6a694861dedc3b8e5a940a

17 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

17 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

17 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

17 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

17 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

17 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

17 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

17 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

17 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

17 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

17 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

17 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

17 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

17 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

17 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

17 months agoMerge latest trunk changes into this branch.
dan [Sat, 13 Jan 2024 19:57:37 +0000 (19:57 +0000)] 
Merge latest trunk changes into this branch.

FossilOrigin-Name: 95bf4bc2e2cc1e7489d82c68deb68feefbdc34fec1baeb9bb8a92ff1063b806c

17 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

17 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

17 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

17 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

17 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

17 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

17 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

17 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

17 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

17 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

17 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

17 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

17 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

17 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

17 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

18 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

18 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

18 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

18 months agoMerge the latest trunk enhancements into the begin-concurrent branch.
drh [Thu, 4 Jan 2024 15:49:36 +0000 (15:49 +0000)] 
Merge the latest trunk enhancements into the begin-concurrent branch.

FossilOrigin-Name: c407d3bb9979933d7f5418ac2baa238b1f13c1aa769bf452c5c33088fdb1e959

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 months agoJNI: move the ByteBuffer-using APIs from public to package visibility for the time...
stephan [Mon, 1 Jan 2024 06:58:32 +0000 (06:58 +0000)] 
JNI: move the ByteBuffer-using APIs from public to package visibility for the time being because they have UB-inducing possibilities which need to be worked out. Update test code to account for a change in custom FTS5 columntext() impls.

FossilOrigin-Name: dc501275fcfab3ad9b6ebbadf7588b225a9dd07a0abac5be83d96f15bfba99e9

18 months agoWASM: various build cleanups and add initial infrastructure for a build which elides...
stephan [Mon, 1 Jan 2024 05:58:47 +0000 (05:58 +0000)] 
WASM: various build cleanups and add initial infrastructure for a build which elides the oo1 API and its dependents (worker1 and promiser). Sidebar: an attempt was made to move generation of the build rules to an external script, but the mixed-mode make/script was even less legible than the $(eval) indirection going on in the makefile.

FossilOrigin-Name: 563d313163c02b398ae85b7c2ed231019a14e006726f09a7c1f294a58bf4363f

18 months agoUse SQLITE_ENABLE_STAT4 in both the WASM and JNI builds.
stephan [Sun, 31 Dec 2023 04:01:36 +0000 (04:01 +0000)] 
Use SQLITE_ENABLE_STAT4 in both the WASM and JNI builds.

FossilOrigin-Name: 99d11e6d0ae687ff6bac5119027f7b04d5e7185214e79cf8c56289cfa809b0f9

18 months agoMinor doc touchup in the JS bits.
stephan [Fri, 29 Dec 2023 04:29:07 +0000 (04:29 +0000)] 
Minor doc touchup in the JS bits.

FossilOrigin-Name: 8d2120c35425081e2158d6a8a6b083c4adf8d694046b2d98f5fd235520920432

18 months agoEnable SQLITE_DIRECT_OVERFLOW_READ unless it is specifically disabled using
drh [Thu, 28 Dec 2023 21:02:08 +0000 (21:02 +0000)] 
Enable SQLITE_DIRECT_OVERFLOW_READ unless it is specifically disabled using
the -DSQLITE_DIRECT_OVERFLOW_READ=0 compile-time option.

FossilOrigin-Name: 630604a4e604bfb36c31602917bfa8d42c10c82966d0819932bf8f827b9158b8

18 months agoUpdate fts5origintext4.test to work with SQLITE_DIRECT_OVERFLOW_READ.
dan [Thu, 28 Dec 2023 20:54:12 +0000 (20:54 +0000)] 
Update fts5origintext4.test to work with SQLITE_DIRECT_OVERFLOW_READ.

FossilOrigin-Name: 15ed002aed12556aeb9bbe537c4ba839f0c95bac65a69d03401b37cc3fd11b92

18 months agoPerformance improvement by unwinding a loop in jsonAppendString().
drh [Thu, 28 Dec 2023 19:18:08 +0000 (19:18 +0000)] 
Performance improvement by unwinding a loop in jsonAppendString().

FossilOrigin-Name: 190ab3c08431a0ba24d76392eab251f5c1792add05e4ec780998b299208eca95

18 months agoFix harmless compiler warnings in FTS5.
drh [Thu, 28 Dec 2023 16:25:48 +0000 (16:25 +0000)] 
Fix harmless compiler warnings in FTS5.

FossilOrigin-Name: 3cd5ef44e40570c357f913a9483fa1cd72e7f2827a5ed5826bff99febae213b1

18 months agoEnhance the (undocumented, debug-only) json_parse() SQL function so that it
drh [Thu, 28 Dec 2023 16:21:22 +0000 (16:21 +0000)] 
Enhance the (undocumented, debug-only) json_parse() SQL function so that it
returns the text rendering of the JSONB parse of the input, rather than printing
the rendering on stdout.

FossilOrigin-Name: 056de8d551dcbdf1d162e2db15ed418fa9c786f900cd3972ef8a1dea3f4f3aa1

18 months agoMerge recent trunk enhancements into the begin-concurrrent branch.
drh [Thu, 28 Dec 2023 13:40:07 +0000 (13:40 +0000)] 
Merge recent trunk enhancements into the begin-concurrrent branch.

FossilOrigin-Name: b3a2adfda722b025f43a105300e1c9860e7586eee5a77f548c4581a7be49518b

18 months agoFix a problem in the shell tool (not library) causing an out-of-bounds write if an...
dan [Wed, 27 Dec 2023 16:24:53 +0000 (16:24 +0000)] 
Fix a problem in the shell tool (not library) causing an out-of-bounds write if an ".open" command failed, then the user pressed ctrl-c to interrupt a query running on the substitute in-memory database.

FossilOrigin-Name: 026618b9e321576f616a32e41329066ba629814170c6cfeef35430343f5003f3

18 months agoEnsure that the xColumnText(), xQueryPhrase() and xPhraseFirstColumn() APIs all retur...
dan [Tue, 26 Dec 2023 15:52:40 +0000 (15:52 +0000)] 
Ensure that the xColumnText(), xQueryPhrase() and xPhraseFirstColumn() APIs all return SQLITE_RANGE if they are passed a bad column or phrase number.

FossilOrigin-Name: 1a8a9b1c89519d265869251e8b6d3c5db733f0d3a7dea6c7962811a8f1157dff

18 months agoImproved handling of malformed unicode within JSON strings.
drh [Tue, 26 Dec 2023 13:20:57 +0000 (13:20 +0000)] 
Improved handling of malformed unicode within JSON strings.

FossilOrigin-Name: e252bdf5f5de26ba8e2bcc6b0ad94121ed6fc4d86c02fe4a2a058ada93747beb

18 months agoRemove an ALWAYS() added in [c50e6c2ace49d092] because it is sometimes false.
drh [Sun, 24 Dec 2023 12:02:36 +0000 (12:02 +0000)] 
Remove an ALWAYS() added in [c50e6c2ace49d092] because it is sometimes false.
dbsqlfuzz c393a4f783d42efd9552772110aff7e5d937f15e.

FossilOrigin-Name: b9daf37e57cde12c4de271a2b1995e8e91b6411f8c2e8882e536241929609b3a

18 months agoFix harmless compiler warnings associated with [5db30bcc338aac1c]
drh [Sun, 24 Dec 2023 11:43:49 +0000 (11:43 +0000)] 
Fix harmless compiler warnings associated with [5db30bcc338aac1c]

FossilOrigin-Name: e55d1c2333f35fc20615aa83a7843d08cae7945710a2156d44eee0cc37d90ade

18 months agoAvoid signed integer overflow during integrity_check of FTS5.
drh [Sun, 24 Dec 2023 11:31:20 +0000 (11:31 +0000)] 
Avoid signed integer overflow during integrity_check of FTS5.

FossilOrigin-Name: 5937df3b25799eceaadfb04d7226c9995d44c8d8edb5ac3ad02af9d7e3570726

18 months agoImprovements to the query planner to address the inefficiency described
drh [Sat, 23 Dec 2023 19:03:50 +0000 (19:03 +0000)] 
Improvements to the query planner to address the inefficiency described
by [forum/forumpost/2568d1f6e6|forum post 2568d1f6e6].

FossilOrigin-Name: 72fcc12cda910a0e3f7875eb3d117b2a5608705c97703985427a02960f1ab5c5

18 months agoAdd debugging output routines sqlite3ShowWhereLoop(X) and
drh [Sat, 23 Dec 2023 11:31:47 +0000 (11:31 +0000)] 
Add debugging output routines sqlite3ShowWhereLoop(X) and
sqlite3ShowWhereLoopList(X) that can be invoked from a debugger to show
a summary of the content of a single WhereLoop object or a list of WhereLoop
objects.  No change in release builds.

FossilOrigin-Name: 5db30bcc338aac1cf081de2deec7e60749ae012e2b6f95ccf745623adb4a31dc

18 months agoChange parameters on a debugging function to include "const".
drh [Fri, 22 Dec 2023 21:22:55 +0000 (21:22 +0000)] 
Change parameters on a debugging function to include "const".

FossilOrigin-Name: 94c3e1110c6590261bd30ba317fba4dd94023d69b81a94f4b216cce748fe7489

18 months agoAdd the -fno-sanitize-recover=undefined to the sanitizer builds used for sdevtest...
dan [Fri, 22 Dec 2023 16:03:45 +0000 (16:03 +0000)] 
Add the -fno-sanitize-recover=undefined to the sanitizer builds used for sdevtest and release testing. To ensure that any test that provokes undefined behaviour fails.

FossilOrigin-Name: 89563311adb0ab7c7a3eadb11c2e27fbca50c56fce8ca616628facbc00d72b88

18 months agoUpdate #ifdef checks in pager.c and util.c to account for [0462a2612d1fc1d0] to resol...
stephan [Fri, 22 Dec 2023 15:41:13 +0000 (15:41 +0000)] 
Update #ifdef checks in pager.c and util.c to account for [0462a2612d1fc1d0] to resolve the build problem reported in [forum:9819032aac|forum post 9819032aac].

FossilOrigin-Name: 0f22d809a1c6c80e381f6bcd931fe4ec36dca0e28d07ab4f4f7f83c813424f60

18 months agoFix a usan complaint about signed integer overflow.
dan [Fri, 22 Dec 2023 14:47:30 +0000 (14:47 +0000)] 
Fix a usan complaint about signed integer overflow.

FossilOrigin-Name: e65907e0279f4814ec957f0790777d8b94a86926cd27c52442b311b27efc0185

18 months agoAdd a new comment to debugging output routine sqlite3WhereLoopPrint() to
drh [Fri, 22 Dec 2023 12:57:49 +0000 (12:57 +0000)] 
Add a new comment to debugging output routine sqlite3WhereLoopPrint() to
remind us of what the various fields of the debug output mean.  No changes
to code.

FossilOrigin-Name: da5f34fd4052432b1ae27bb12e56b358cdc5c1282653d60ed0f0fe62f727e4ee

18 months agoAdd internal core-developer-only documentation of the JSONB format.
drh [Thu, 21 Dec 2023 18:08:05 +0000 (18:08 +0000)] 
Add internal core-developer-only documentation of the JSONB format.

FossilOrigin-Name: 4d30478863b2a60512010de9ec6e3099bfaf75d4afee20acec536713fe94334d

18 months agoFix SQLITE_ENABLE_SETLK_TIMEOUT assert() statements in os_unix.c to avoid reading...
dan [Wed, 20 Dec 2023 19:33:41 +0000 (19:33 +0000)] 
Fix SQLITE_ENABLE_SETLK_TIMEOUT assert() statements in os_unix.c to avoid reading past the end of the unixShmNode.aMutex[] array.

FossilOrigin-Name: 029a05cd2928d43d81e4549cce5388c432e2c9e75e3fa0b2fe6e91021b2fb9ac

18 months agoAvoid harmless integer overflow in pager status statistics gathering.
drh [Wed, 20 Dec 2023 11:34:17 +0000 (11:34 +0000)] 
Avoid harmless integer overflow in pager status statistics gathering.
Response to [forum:/forumpost/7f4cdf23f9|forum post 7f4cdf23f9].

FossilOrigin-Name: 206d8c650d937bc700946c40a82a62ea6bc4a80e5f3fb42d0ae2968de25f0644

18 months agoIn JSON - minor code cleanup and refactoring with a small size reduction
drh [Tue, 19 Dec 2023 21:39:58 +0000 (21:39 +0000)] 
In JSON - minor code cleanup and refactoring with a small size reduction
and performance increase.

FossilOrigin-Name: 215fabda38daecdbd38b1eca5a6aafbc61b6a36a8303f1d7164d5a1138e63134

18 months agoRemove redundant conditional from sqlite3ExprCanBeNull().
drh [Tue, 19 Dec 2023 15:51:14 +0000 (15:51 +0000)] 
Remove redundant conditional from sqlite3ExprCanBeNull().

FossilOrigin-Name: 257f96a2d22c605885fa66220c28cf7dc5941c330bccee3f132b9e7b70d89d30

18 months agoOn second thought, we don't really need sqlite_dbdata accessible to the CLI.
drh [Tue, 19 Dec 2023 15:10:25 +0000 (15:10 +0000)] 
On second thought, we don't really need sqlite_dbdata accessible to the CLI.

FossilOrigin-Name: 36fe6a61ef8fb393281a5e15119d716521219c7b971fbfd63bdea07d27a78ac9

18 months agoFix harmless compiler warning in the randomjson.c extension.
drh [Tue, 19 Dec 2023 15:06:40 +0000 (15:06 +0000)] 
Fix harmless compiler warning in the randomjson.c extension.

FossilOrigin-Name: debe7060b16669ada7304ffb9bf7616c8fa30bd286d8be871ed17fd6d64a3d4c

18 months agoMore precise computation of the size of data structures in the query planner.
drh [Tue, 19 Dec 2023 14:54:52 +0000 (14:54 +0000)] 
More precise computation of the size of data structures in the query planner.
Response to [forum:/forumpost/7d8685d49d|Forum post 7d8685d49d].

FossilOrigin-Name: 0c8d88e41167ea92341dd1129be01b596a73f46bdcd5b0dd931441a979c013d0

18 months agoAdd ALWAYS() and NEVER() on branches made unreachable by recent changes.
drh [Tue, 19 Dec 2023 14:53:39 +0000 (14:53 +0000)] 
Add ALWAYS() and NEVER() on branches made unreachable by recent changes.

FossilOrigin-Name: c50e6c2ace49d0928b05cbfd877c621e9a0f77dc4e056ccb1dbe5cf118a00d00

18 months agoIgnore COLLATE operators when determining whether the result of a subexpression
drh [Tue, 19 Dec 2023 13:45:05 +0000 (13:45 +0000)] 
Ignore COLLATE operators when determining whether the result of a subexpression
should be shallow-copied or deep-copied.

FossilOrigin-Name: 34ae36a45e814bed7c8340412c7ef3fc849b82357656d0eb5f0f805e59d846d0

18 months agoTest case for the previous check-in.
drh [Tue, 19 Dec 2023 13:00:35 +0000 (13:00 +0000)] 
Test case for the previous check-in.

FossilOrigin-Name: df5a07e1a5122e08c2fa6076ac08adb2820f997ee11dd88b84863666899dfb57

18 months agoWhen unable to resolve an identifier, change the Expr node into TK_NULL
drh [Tue, 19 Dec 2023 12:49:35 +0000 (12:49 +0000)] 
When unable to resolve an identifier, change the Expr node into TK_NULL
rather than TK_COLUMN, to prevent any downstream misuse of the non-existent
column.  dbsqlfuzz 71869261db80a95e4733afa10ff5724bf3c78592.

FossilOrigin-Name: d2e6117e4f97ab98b01deb5fcad5520f8181d00bed8d904d34963c01d73df857

18 months agoAlways make the sqlite_dbdata virtual table available in the CLI.
drh [Tue, 19 Dec 2023 12:23:11 +0000 (12:23 +0000)] 
Always make the sqlite_dbdata virtual table available in the CLI.

FossilOrigin-Name: e5fd3b32ad87586a7413570e568c9c1859a37a4f836cca074126471b125fb682

18 months agoExtra ALWAYS() macros to verify state in the sqlite3ExprCanBeNull() routine.
drh [Tue, 19 Dec 2023 11:57:29 +0000 (11:57 +0000)] 
Extra ALWAYS() macros to verify state in the sqlite3ExprCanBeNull() routine.

FossilOrigin-Name: be19b84c9f3fe127165809908add148dbe9a827a55608b0490de7e69b7f7f191

18 months agoRemove a stray comment in the JSON code.
drh [Tue, 19 Dec 2023 00:07:38 +0000 (00:07 +0000)] 
Remove a stray comment in the JSON code.

FossilOrigin-Name: 6618bdf0679405b43911ea8cd94050b12a5dc469f3dfe4759ee3ff850a55229e

18 months agoNew JSON invariant test cases.
drh [Mon, 18 Dec 2023 19:18:46 +0000 (19:18 +0000)] 
New JSON invariant test cases.

FossilOrigin-Name: a6a1367b0bf364b1a2e20e153c5f4a578624b8846f9ec0b7c9c3cba0ea2ec346

18 months agoAdd NEVER() to an unfalsifiable branch.
drh [Mon, 18 Dec 2023 18:50:47 +0000 (18:50 +0000)] 
Add NEVER() to an unfalsifiable branch.

FossilOrigin-Name: 9a0c67db366d38a0b0741f6a1ae333cf27cfe6f6b7c6eed94bdec9686f9f9f8a

18 months agoFix JSON to JSONB translation so that it deals correctly with Infinity
drh [Mon, 18 Dec 2023 18:31:27 +0000 (18:31 +0000)] 
Fix JSON to JSONB translation so that it deals correctly with Infinity
and NaN.

FossilOrigin-Name: 178cb84f36bdb45ba17511900d6d8ea8dfa14912fc5bf7094a20348174a36c95

18 months agoEnsure that the insert/delete size delta on JSONB objects in the JSON cache
drh [Mon, 18 Dec 2023 15:53:48 +0000 (15:53 +0000)] 
Ensure that the insert/delete size delta on JSONB objects in the JSON cache
are always set to zero.

FossilOrigin-Name: 4b4581668a908473dbf1322a3e98bc7cca122998c44518ea183af7f0d1ba9f95

18 months agoAdd randomjson.c to testfixture. Use it for a new set of invariant tests
drh [Mon, 18 Dec 2023 14:24:13 +0000 (14:24 +0000)] 
Add randomjson.c to testfixture.  Use it for a new set of invariant tests
against JSON functions.

FossilOrigin-Name: f1c040606bfe784804134d8f3ca130908fad5212b47e3c32792baab977470943

18 months agoEnsure that all object labels for individual objects generated by
drh [Mon, 18 Dec 2023 14:16:58 +0000 (14:16 +0000)] 
Ensure that all object labels for individual objects generated by
randomjson.c are unique.

FossilOrigin-Name: 29c46aca231b3f1e997ef306a5a651408185bf3ad09ab9fc1fe21ed18caa4d02

18 months agoBug fix in the randomjson.c extension.
drh [Mon, 18 Dec 2023 13:51:54 +0000 (13:51 +0000)] 
Bug fix in the randomjson.c extension.

FossilOrigin-Name: 1f3a33df530dbe330ea8b14a69369b807b413b25a167d1a3938f8f0faf97cc91

18 months agoEnhancements to ext/misc/randomjson.c.
drh [Mon, 18 Dec 2023 12:18:47 +0000 (12:18 +0000)] 
Enhancements to ext/misc/randomjson.c.

FossilOrigin-Name: a4e6d1f86f3a502e4170f5a90031e269e48363e95114a66b84d373e3ce0b2704

18 months agoEnhancements to the "randomjson.c" extension. Automatically load that extension
drh [Sun, 17 Dec 2023 20:41:48 +0000 (20:41 +0000)] 
Enhancements to the "randomjson.c" extension.  Automatically load that extension
into fuzzcheck.

FossilOrigin-Name: 70620405ab01d6a5d38bafa9ae175fd6e4eabaf2efb7854734278dafd7b05c99

18 months agoEnable SQLITE_STRICT_SUBTYPE for default builds of the shell, fuzzcheck,
drh [Sat, 16 Dec 2023 15:48:42 +0000 (15:48 +0000)] 
Enable SQLITE_STRICT_SUBTYPE for default builds of the shell, fuzzcheck,
and testfixture.

FossilOrigin-Name: 5a0c517ed7e46c0f8a3db752cf5b9f8010c60f35084606abe9e7c1c4f993b4a7