]> git.ipfire.org Git - thirdparty/sqlite.git/log
thirdparty/sqlite.git
17 months agoOptimizations to ParseFinalize() to make up for the extra cleanup associated growable-parser-stack
drh [Sat, 27 Jan 2024 02:21:25 +0000 (02:21 +0000)] 
Optimizations to ParseFinalize() to make up for the extra cleanup associated
with the allocated parser stack.  This branch now runs faster than trunk
and is less than 300 bytes larger.

FossilOrigin-Name: f7290db63cc2568090c14dffc4ea4eadfacb5b94b50a1852ef6eefd9e2e32533

17 months agoOmit the "parser stack overflow" error message, since it no longer occurs.
drh [Sat, 27 Jan 2024 01:35:07 +0000 (01:35 +0000)] 
Omit the "parser stack overflow" error message, since it no longer occurs.
Replace it with an ordinary "out of memory".

FossilOrigin-Name: 33f17ec24880937892d47a5a321c43785ca18e03dde28a9a0d50ae86edb29679

17 months agoBug fixes in the function that expands the parser stack.
drh [Fri, 26 Jan 2024 20:57:19 +0000 (20:57 +0000)] 
Bug fixes in the function that expands the parser stack.

FossilOrigin-Name: e91179fe849760771c3508b1e7d75325183e5c3b029752d0a97dbdbd57188b97

17 months agoExperimental changes that prevent parser stack overflows by growing the
drh [Fri, 26 Jan 2024 20:34:48 +0000 (20:34 +0000)] 
Experimental changes that prevent parser stack overflows by growing the
parser stack with heap memory when it reaches its limit.

FossilOrigin-Name: 3fd062905fc20507b7cfc97fa976ac5b57c5b68926bf9136bd5ea4265d2d6528

17 months agoAdd NEVER() to a branch that is no longer reachable.
drh [Wed, 24 Jan 2024 21:08:57 +0000 (21:08 +0000)] 
Add NEVER() to a branch that is no longer reachable.

FossilOrigin-Name: 9411337a7b3237366768fc708396da53d67a7a17b6cdc5c6f8932c5ab32217a9

17 months agoUpdate ext/wasm/SQLTester for recent internal-API reorgs.
stephan [Wed, 24 Jan 2024 19:54:49 +0000 (19:54 +0000)] 
Update ext/wasm/SQLTester for recent internal-API reorgs.

FossilOrigin-Name: 996cfdf9b5f70408faeaa68ba2ea9494e419be8f2c59d89ab702419056e3569c

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

FossilOrigin-Name: 5cf9ea9b1fff4625a50a2343d0fd3812da6612d6b24c07e10edb6c1ff03ca2df

17 months agoIn os_unix.c and os_win.c, do not allow xFetch() to return a pointer to a page buffer...
dan [Tue, 23 Jan 2024 16:09:22 +0000 (16:09 +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: 2684feac3bc9c5463604900d72710be861527614f4957224c74a16a3b3c702f5

17 months agoImproved error message when a double-quoted identifier name cannot be
drh [Tue, 23 Jan 2024 14:45:22 +0000 (14:45 +0000)] 
Improved error message when a double-quoted identifier name cannot be
resolved - ask the user if they intended to use a string literal.

FossilOrigin-Name: efc5c3c5e6ae1f9f0be61ea4ce7b3e34f3dc318791c78e0f4bebebeaccf6951e

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:51:55 +0000 (13:51 +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.
[forum:/forumpost/012136abd5292b8d|Forum thread 012136abd5292b8d].

FossilOrigin-Name: e5dc81d5c7ee97866feb688dfa9b6fc225dabff2b020b9b96b49a8fea5640aec

17 months agoFix typo in the tag-20240123-a in a comment. blob-as-json
drh [Tue, 23 Jan 2024 13:28:21 +0000 (13:28 +0000)] 
Fix typo in the tag-20240123-a in a comment.

FossilOrigin-Name: 1f09541eb4203ccce476f6040ff134353850f22f07fb84f96a1d2c27b304a91b

17 months agoIf a BLOB looks like JSON when cast to text, then treat it as if it really
drh [Tue, 23 Jan 2024 13:21:40 +0000 (13:21 +0000)] 
If a BLOB looks like JSON when cast to text, then treat it as if it really
were JSON.  This replicates a long-standing bug in the JSON processing
routines, and thereby avoids breaking legacy.

FossilOrigin-Name: d79a37690ce7ebb91df203170d73511da44546328043c2b3fe1786b2f0087093

17 months agoChange the shell's --help flag to exit with code 0 instead of 1, per /forum and ...
stephan [Tue, 23 Jan 2024 12:51:17 +0000 (12:51 +0000)] 
Change the shell's --help flag to exit with code 0 instead of 1, per /forum and /chat discussions.

FossilOrigin-Name: df563a18578c5cf1aaecf5818c93967aaa70475598d3c099779622ac8911f926

17 months agoSimplification of the error reporting logic. improved-dqs-error-msg
drh [Mon, 22 Jan 2024 20:49:47 +0000 (20:49 +0000)] 
Simplification of the error reporting logic.

FossilOrigin-Name: 59eb9d29e796886db17a578b64e75fd2797aebf969cbeeda70ecf2fda378c98f

17 months agoImproved error message when a double-quoted string is used and it seems likely
drh [Mon, 22 Jan 2024 15:26:33 +0000 (15:26 +0000)] 
Improved error message when a double-quoted string is used and it seems likely
that the user wanted a single-quoted string literal.

FossilOrigin-Name: 0a834bd81122b6e9c34c8253f9e45d53dab3274be28df60968366fa42237617b

17 months agoThe -DSQLITE_JSON_BLOB_INPUT_BUG_COMPATIBLE compile-time option causes blob
drh [Mon, 22 Jan 2024 14:16:10 +0000 (14:16 +0000)] 
The -DSQLITE_JSON_BLOB_INPUT_BUG_COMPATIBLE compile-time option causes blob
inputs to JSON functions that are not JSONB to be processed as if they
where text, immulating historical bugging behavior which some applications
have come to rely upon.  See
[forum:/forumpost/012136abd5292b8d|forum thread 012136abd5292b8d] for
discussion.

FossilOrigin-Name: 65572223583d43e1d61ec029641f9d3ff340e68ecfba8342c8d1b0a91a680f2a

17 months agoFix test script literal.test so that it works with SQLITE_OMIT_ALTER_TABLE builds.
dan [Mon, 22 Jan 2024 14:01:07 +0000 (14:01 +0000)] 
Fix test script literal.test so that it works with SQLITE_OMIT_ALTER_TABLE builds.

FossilOrigin-Name: 4dc00f577632c7b13135505007804d42a12f81a9ebd58d4c380727256b054b7e

17 months agoFix userauth so that it works together with SQLITE_OMIT_SHARED_CACHE.
drh [Mon, 22 Jan 2024 12:56:58 +0000 (12:56 +0000)] 
Fix userauth so that it works together with SQLITE_OMIT_SHARED_CACHE.
([forum:/forumpost/0bfc5888a384d430|Forum post 0bfc5888a384d430]).
However, also change to code to issue a deprecation warning whenever
SQLITE_USER_AUTHENTICATION is used.

FossilOrigin-Name: 249048b0cbc37058c229a785182e07b46029584aff9c385269b0b93503153476

17 months agoAdd a notice to the user-authentication documentation to say that the
drh [Mon, 22 Jan 2024 12:30:17 +0000 (12:30 +0000)] 
Add a notice to the user-authentication documentation to say that the
extension is deprecated and may disappear in the future.

FossilOrigin-Name: fe6fc7b91ad1771a2d2d4e3d9d60831b3056d528a700932bf11a336c7e3414a2

17 months agoMake CLI .dump immune to pragma reverse_unordered_selects, as reported in [forum...
larrybr [Mon, 22 Jan 2024 01:11:24 +0000 (01:11 +0000)] 
Make CLI .dump immune to pragma reverse_unordered_selects, as reported in [forum:/forumpost/c42be01880e961eb|Forum thread "Missing ORDER BY in .dump?"]

FossilOrigin-Name: 488caed24453fcef6fddcf40353e3b44cf37fb9d21e0ed743d39d60cbff020a7

17 months agoFix a harmless typo in a comment.
drh [Sun, 21 Jan 2024 21:20:33 +0000 (21:20 +0000)] 
Fix a harmless typo in a comment.

FossilOrigin-Name: 382a8f94bffef3e5f715116e363a30e21e2c53cd42d4959dfbe90c4624143e6d

17 months agoEnsure that values generated by DEFAULT clauses that specify real numbers that can...
dan [Sat, 20 Jan 2024 18:41:13 +0000 (18:41 +0000)] 
Ensure that values generated by DEFAULT clauses that specify real numbers that can be expressed as 64-bit integers (e.g. -1234.0) are not silently converted to integers.

FossilOrigin-Name: 298d6977285c71be917896bc875a8a26d985dcf0a74069b7c4d290e8ff0ac618

17 months agoSimplifications to the strftime() logic.
drh [Sat, 20 Jan 2024 18:26:28 +0000 (18:26 +0000)] 
Simplifications to the strftime() logic.

FossilOrigin-Name: aaa5a044d8a4942278eb4269fa8c7252f9f1dc161408e618e7c97c55a12283ff

17 months agoFix a memory leak in new memdb1.test test cases that were added by
drh [Sat, 20 Jan 2024 18:21:50 +0000 (18:21 +0000)] 
Fix a memory leak in new memdb1.test test cases that were added by
[e638d5e408ea2e18].  No changes to SQLite itself.

FossilOrigin-Name: bb2b7a658e0186d8b09199170db17744536602d8282b83c71ed969494d2ca465

17 months agoMake sure that %V and %G are testing for every since day in between 1970-01-01
drh [Sat, 20 Jan 2024 16:38:00 +0000 (16:38 +0000)] 
Make sure that %V and %G are testing for every since day in between 1970-01-01
and 2023-01-19.

FossilOrigin-Name: 39c475f5fb86526622a715860385f0a3a4b2c18d8ef209779c423527e0639385

17 months agoRig sqlite3_serialize() so that it will initialize a previously uninitialized
drh [Sat, 20 Jan 2024 16:29:19 +0000 (16:29 +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: e638d5e408ea2e189b6771d16bbc2e42c606e88e05fbea78079b6e39e41f344c

17 months agoWhen doing a text-affinity comparison between two values where one or both
drh [Sat, 20 Jan 2024 15:13:13 +0000 (15:13 +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 pose 3776b48e71].  The problem bisects
to [25f2246be404f38b] on 2014-08-24, prior to version 3.8.7.

FossilOrigin-Name: 709841f88c77276f09701bf38e25503c64b3a0afbe2fbf878136db12f31cbe21

17 months agoEnsure that the replace() SQL function always returns a TEXT value even
drh [Sat, 20 Jan 2024 13:18:22 +0000 (13:18 +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: 01868ebcd25fadb2034da234c0636e82d07c5abc902ef66493cadfc988e74d7b

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

FossilOrigin-Name: 666690eb433fe38fa527ccbbb8e2c00041a33939da4f6b8bfb737d664f28f0d8

17 months agoFix the version number in the TEA configure script. This should have
drh [Sat, 20 Jan 2024 12:00:20 +0000 (12:00 +0000)] 
Fix the version number in the TEA configure script.  This should have
been changed by [1481baf3d55effcc] three check-ins ago.
It is unclear how testing missed this.

FossilOrigin-Name: eaf2cf73fca3355edd05fef5b0d0262a6555633908794068805d12b1948beedc

17 months agoImplement a new algorithm for computing ISO week values in strftime() based
drh [Sat, 20 Jan 2024 00:31:44 +0000 (00:31 +0000)] 
Implement a new algorithm for computing ISO week values in strftime() based
on the idea (from [forum/forumpost/3681cb1bcd|Nuno Cruces]) of shifting the
date being tested to the Thursday of the same week.

FossilOrigin-Name: b06ab46a9ee98719159ed3e05cdfbf26281353d781206f56ed7cb12859210fed

17 months agoAllow large hexadecimal literals to be used as DEFAULT values.
dan [Fri, 19 Jan 2024 16:51:34 +0000 (16:51 +0000)] 
Allow large hexadecimal literals to be used as DEFAULT values.

FossilOrigin-Name: 8cccc1f27d7470d3cdd3c9c6d74f6a5ac49ec6eaa7002bcf96f4842fb8c79e1a

17 months agoIncrease the version number to 3.46.0 to begin the next development cycle.
drh [Thu, 18 Jan 2024 16:52:11 +0000 (16:52 +0000)] 
Increase the version number to 3.46.0 to begin the next development cycle.

FossilOrigin-Name: 1481baf3d55effcc117f2097e2d49a6f60f5f74b21190c3be943fd785b8a4c5b

17 months agoAdd support in the strftime() SQL function for conversion letters %G, %g,
drh [Thu, 18 Jan 2024 16:50:25 +0000 (16:50 +0000)] 
Add support in the strftime() SQL function for conversion letters %G, %g,
%U, and %V.

FossilOrigin-Name: e1155d6aa4b960ecfd14fa3467f28672af3327699c547f5b9e75da3ac1348ff7

17 months agoFix harmless "unused parameter" compiler warning in the new fts3IntegrityMethod
drh [Tue, 16 Jan 2024 16:14:52 +0000 (16:14 +0000)] 
Fix harmless "unused parameter" compiler warning in the new fts3IntegrityMethod
implementation.

FossilOrigin-Name: bb1fe53a97672fc868e3f3897162ea0d714dc1da95187f9c7e35255049f2b0e7

17 months agoEnsure that the xIntegrity methods of fts3 and fts5 work on read-only databases.
dan [Tue, 16 Jan 2024 16:05:21 +0000 (16:05 +0000)] 
Ensure that the xIntegrity methods of fts3 and fts5 work on read-only databases.

FossilOrigin-Name: b855886c4ccce0745af6957943e77be18949722f09821688725d546d3d79b4fb

17 months agoClutter the code with "fall-through" comments in order to suppress nuisance
drh [Tue, 16 Jan 2024 15:04:19 +0000 (15:04 +0000)] 
Clutter the code with "fall-through" comments in order to suppress nuisance
compiler warnings.  No logic changes.

FossilOrigin-Name: 05d2cf5e90d2a6b8e7fbcdb9e12e7c1281db7cfbe212997bd63c8aa66797edda

17 months agoRemove the LLONG_MAX preprocessor macro from the series.c extension as it
drh [Tue, 16 Jan 2024 14:54:54 +0000 (14:54 +0000)] 
Remove the LLONG_MAX preprocessor macro from the series.c extension as it
is apparently only C99 and later.
[forum:/forumpost/4af649419b|Forum post 4af649419b].

FossilOrigin-Name: f106bc0d21b7a815f0d23a97b6fd63c54d3f5353e965dfa550fa715e698ec6e3

17 months agoVarious build- and code-reorg cleanups for ext/wasm. No functional changes.
stephan [Tue, 16 Jan 2024 14:24:35 +0000 (14:24 +0000)] 
Various build- and code-reorg cleanups for ext/wasm. No functional changes.

FossilOrigin-Name: 835bd4a11e56ede378235379604ac01350ee92433f952a23c761f7be492fd475

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 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 agowasm build: reformulate an awk invocation to account for awks which do not support... wasm-post-3.45
stephan [Thu, 11 Jan 2024 16:10:22 +0000 (16:10 +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: 5836657929d7d6d3f0d5865c9f6de4e4c00edd53d15a246802b375fa15d0f255

17 months agoInternal JS doc cleanups.
stephan [Thu, 11 Jan 2024 14:21:15 +0000 (14:21 +0000)] 
Internal JS doc cleanups.

FossilOrigin-Name: c8284170f66374fc528e9d6e5a03ee7321f27e80acf4360701a8b176497b7130

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 agoRemove some dead JS code. Minor doc cleanups.
stephan [Thu, 11 Jan 2024 12:56:03 +0000 (12:56 +0000)] 
Remove some dead JS code. Minor doc cleanups.

FossilOrigin-Name: bf23cf204976516651b1c4c39ced21cd858dea4ba88052d96fc4f5f11525f170

17 months agoSplit the JS vfs/vtab helper code into discreet units as a step towards a build which...
stephan [Thu, 11 Jan 2024 12:31:58 +0000 (12:31 +0000)] 
Split the JS vfs/vtab helper code into discreet units as a step towards a build which optionally elides those pieces. This is an internal restructuring change and does not affect the API.

FossilOrigin-Name: ede945fd2360097d9961b8a4b8fb48fea57399cb9163534ed1c3c6b86588b0a5

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 agoMake explicit which JS APIs are for internal use only by moving the JS-bound internal...
stephan [Mon, 8 Jan 2024 07:52:47 +0000 (07:52 +0000)] 
Make explicit which JS APIs are for internal use only by moving the JS-bound internal-use-only functions out of client-visible reach and renaming the WASM-exported ones from sqlite3_wasm... to sqlite3__wasm... (with two underscores). These have always been documented as internal-use-only, so this is not a breaking change except for clients which have ignored the docs.

FossilOrigin-Name: 0eddc20f37988df6bce5f407b69e4a315e5cca4af104586e6fe942f0d656cccd

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

17 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 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 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