]> git.ipfire.org Git - thirdparty/sqlite.git/log
thirdparty/sqlite.git
23 months agoImproved defenses against deliberately corrupted sqlite_stat1 tables. enhanced-stat1
drh [Mon, 1 Jan 2024 15:49:31 +0000 (15:49 +0000)] 
Improved defenses against deliberately corrupted sqlite_stat1 tables.

FossilOrigin-Name: ee34db31a0776ec05cbea9f3fec15a58b1a4d5f21c7f3455563862da48ec47cb

23 months agoFix a harmless compiler warning.
drh [Mon, 1 Jan 2024 15:35:59 +0000 (15:35 +0000)] 
Fix a harmless compiler warning.

FossilOrigin-Name: b5aa1aea38cb5399161d368f382f508c703996f8c751e02d825926c46d14481b

23 months agoOmit the uneven=N argument in sqlite_stat1 and replace it with var=N1,N2,...
drh [Mon, 1 Jan 2024 14:13:59 +0000 (14:13 +0000)] 
Omit the uneven=N argument in sqlite_stat1 and replace it with var=N1,N2,...
so that the variation in each column is reported separately.  Omit the "slow"
argument from sqlite_stat1, computing that flag internally.  PRAGMA stats is
enhanced with a new column "est" that shows the aiRowLogEst array for each
index after it has been modified by "var=..." and also the "slow" flag.

FossilOrigin-Name: 4a8fc17365ccd989cc8050179ac586ca246698c71a64d7209786fb5569ba583a

23 months agoBetter comments. Slight tuning of parameters.
drh [Sun, 31 Dec 2023 20:04:32 +0000 (20:04 +0000)] 
Better comments.  Slight tuning of parameters.

FossilOrigin-Name: 1cc32eccda8d126264c644df72e308e25c1e41cf4fb68c2f1b6d6d98cbc23ca5

23 months agoEnsure that all elements of aiRowLogEst[] have been initialized even if
drh [Sun, 31 Dec 2023 12:38:43 +0000 (12:38 +0000)] 
Ensure that all elements of aiRowLogEst[] have been initialized even if
the stat entry is truncated.

FossilOrigin-Name: c216921b115169ebfd239267b4ab5ad0fc960ffadce09044b68812f49110d607

23 months agoIn sqlite_stat1, revert the number of rows to the average, not adjusted for
drh [Sat, 30 Dec 2023 22:00:37 +0000 (22:00 +0000)] 
In sqlite_stat1, revert the number of rows to the average, not adjusted for
the maximum.  Instead add "uneven=NNN" where NNN is a multiplier to apply to
the average to get the maximum.  "uneven" is only reported if NNN is 10 or more.
Also add the "slow" argument is the maximum number of rows reported by a
full equality match is so large that a table scan seems likely to be faster.

FossilOrigin-Name: 41773fa760f10964b3f276a9a45f7e32df0082b516edc76d70609e7eb5f81b14

23 months agoOmit the "noquery" argument in sqlite_stat1. Instead, add the "uneven" argument
drh [Sat, 30 Dec 2023 15:07:31 +0000 (15:07 +0000)] 
Omit the "noquery" argument in sqlite_stat1.  Instead, add the "uneven" argument
for indexes that have an uneven distribution of values.  Modify the query
planner to avoid doing equality look-ups on uneven indexes.

FossilOrigin-Name: 0ec4b880bbf276f905d5c09fcb09cee4748c92c83baf241910223e59b723b86e

23 months agoRevise the "noquery" decision algorithm again. The index now must select
drh [Fri, 29 Dec 2023 21:07:00 +0000 (21:07 +0000)] 
Revise the "noquery" decision algorithm again.  The index now must select
more than 150 rows on average, and the number of rows select must be enough
that it seems faster to do a full scan of the associated table.

FossilOrigin-Name: f516ef80a0ba87fa3b74da0fc899a7d14ad3de61fac6b467e36e7fa9fe76dcdf

23 months agoFix an issue in the "noquery" decision in the previous check-in. Also add
drh [Fri, 29 Dec 2023 20:31:32 +0000 (20:31 +0000)] 
Fix an issue in the "noquery" decision in the previous check-in.  Also add
comments explaining the algorithm.

FossilOrigin-Name: 6aaa65adfc3b0c8e1ee7066de38d4385904c80da704b97440b0699fc78176ffa

23 months agoAdd the "noquery" argument as an option for the stat column of
drh [Fri, 29 Dec 2023 20:08:43 +0000 (20:08 +0000)] 
Add the "noquery" argument as an option for the stat column of
sqlite_stat1.  If set, then the index will not be used to optimize a query.
Enhance ANALYZE to set that argument on very low selectivity indexes.

FossilOrigin-Name: e514d3fa83662aa19abefebdda5652e6adb0f0b5a75ad7ee9dd3d2d2c87e03c5

23 months agoAttempt to improve the ANALYZE command so that it does a better job of
drh [Fri, 29 Dec 2023 19:03:01 +0000 (19:03 +0000)] 
Attempt to improve the ANALYZE command so that it does a better job of
detecting lopsided indexes and makes appropriate changes to the sqlite_stat1
table.

FossilOrigin-Name: 4b70b94616ef37bac969051eee3ea6913a28f30520cdd4fc3a19e848f2cf12b7

23 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

23 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

23 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

23 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

23 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

23 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

23 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years agoNew test case based on Chromium bug report 1511689.
drh [Sat, 16 Dec 2023 10:50:06 +0000 (10:50 +0000)] 
New test case based on Chromium bug report 1511689.

FossilOrigin-Name: 2c7ef4b4d215f99f8d6787adb64e2037ae96e5dd6cb49c8b81634249f5e1b328

2 years agoIn the count-of-view optimization, deferring freeing obsolete parts of the
drh [Fri, 15 Dec 2023 20:13:09 +0000 (20:13 +0000)] 
In the count-of-view optimization, deferring freeing obsolete parts of the
parse tree, on the off-chance that some other part of the code might be
holding a pointer to those parts.

FossilOrigin-Name: da442578856c87137eb1677d9b13b7c1cf15828cc41d4756572b278060f69bae

2 years agoAvoid expiring prepared statements in the middle of an integrity-check.
dan [Fri, 15 Dec 2023 19:26:16 +0000 (19:26 +0000)] 
Avoid expiring prepared statements in the middle of an integrity-check.

FossilOrigin-Name: 88beb48472da4667c0727c8ebabe046ea526450ff837fe789d041ed3f1ff105e

2 years agoAdd mention of --buildonly and --dryrun to the testrunner.tcl usage screen.
drh [Fri, 15 Dec 2023 16:28:02 +0000 (16:28 +0000)] 
Add mention of --buildonly and --dryrun to the testrunner.tcl usage screen.

FossilOrigin-Name: 23b92d915c12ee768857e2c3c961832f390cad9b53b8bcfc2b97664baab25bb7

2 years agoFix a new JSON test case so that it works even if SQLITE_OMIT_VIRTUALTABLE
drh [Fri, 15 Dec 2023 15:22:03 +0000 (15:22 +0000)] 
Fix a new JSON test case so that it works even if SQLITE_OMIT_VIRTUALTABLE
is defined.

FossilOrigin-Name: b995aae510888a9746b46545d176a0885d4738e1f1bc0b7ad7937ed023efd7d6

2 years agoDo not run test script fts5origintest4.test with either "memsubsys1" or "mmap" permut...
dan [Fri, 15 Dec 2023 15:17:39 +0000 (15:17 +0000)] 
Do not run test script fts5origintest4.test with either "memsubsys1" or "mmap" permutations.

FossilOrigin-Name: 05a63d9603ef42cbee6dadff72d97583a9c78e549f70e9a808534d5c1ae7c28a

2 years agoAvoid running the "no_mutex_try" tests with SQLITE_ENABLE_SETLK_TIMEOUT builds as...
dan [Fri, 15 Dec 2023 14:33:50 +0000 (14:33 +0000)] 
Avoid running the "no_mutex_try" tests with SQLITE_ENABLE_SETLK_TIMEOUT builds as part of the release test.

FossilOrigin-Name: 6b4e1344a28c213cbe8fb97f7f3f6688de93fb73ed96bf460ff74c959da1a712

2 years agoCorrect --enable-sab flag in ext/wasm/GNUmakefile to fix a silent alhttpd args-parsin...
stephan [Fri, 15 Dec 2023 13:38:47 +0000 (13:38 +0000)] 
Correct --enable-sab flag in ext/wasm/GNUmakefile to fix a silent alhttpd args-parsing error.

FossilOrigin-Name: 7b9b757d872a31395b0f6454e2309a6a4664b8bdd8749f6a15371cbe72c05b60

2 years agoUse SQLITE_STRICT_SUBTYPE=1 by default for the JNI and WASM builds unless they're...
stephan [Thu, 14 Dec 2023 22:01:55 +0000 (22:01 +0000)] 
Use SQLITE_STRICT_SUBTYPE=1 by default for the JNI and WASM builds unless they're explicitly built with SQLITE_STRICT_SUBTYPE=0.

FossilOrigin-Name: 990211357badf0ab08bd34cf6d25b58849d0fd8503e289c1839fc837a74e1909

2 years agoAdd assert()s to FTS5 to fix static analyzer warnings.
drh [Thu, 14 Dec 2023 16:34:47 +0000 (16:34 +0000)] 
Add assert()s to FTS5 to fix static analyzer warnings.

FossilOrigin-Name: 27d4a89a5ff96b7b7fc5dc9650e1269f7c7edf91de9b9aafce40be9ecc8b95e9

2 years agoFix harmless compiler warnings in JSON and FTS5.
drh [Thu, 14 Dec 2023 15:38:57 +0000 (15:38 +0000)] 
Fix harmless compiler warnings in JSON and FTS5.

FossilOrigin-Name: 90135efccfeb1046f002bfcbd8dfec9a1a3b40cbe1b5c714ae065b06368e354f

2 years agoImprove the error message returned by an fts5 'rebuild' command on an external conten...
dan [Thu, 14 Dec 2023 15:31:35 +0000 (15:31 +0000)] 
Improve the error message returned by an fts5 'rebuild' command on an external content table if there is a problem with the content table or view.

FossilOrigin-Name: 0fbf4b8a58fde1c187908934da6f59999b146f32e07ac255cc531c5c4d7007fd

2 years agoEnhance aggregate order-by so that it transmits subtype information through the
drh [Thu, 14 Dec 2023 15:11:39 +0000 (15:11 +0000)] 
Enhance aggregate order-by so that it transmits subtype information through the
sorter.  Fix for the deficiency reported by
[forum:/forumpost/87347ad2fb5a8f76|forum post 87347ad2fb5a8f76].

FossilOrigin-Name: d302a389460d0c15775a8b5f5afbac2c1d8a91bc282bc9b04c583ca04a8c09c6

2 years agoPass subtype information through the aggregate ORDER BY sorter for agg-orderby-subtype
drh [Thu, 14 Dec 2023 13:58:50 +0000 (13:58 +0000)] 
Pass subtype information through the aggregate ORDER BY sorter for
aggregate functions that use subtype information.

FossilOrigin-Name: 3536f4030eab6d650b7ed729d2f71eb6cc3b5fbe16b4e96b99008d66522aaccb

2 years agoIn CLI, fix .read inability to open 2GB+ files on WIN32.
larrybr [Wed, 13 Dec 2023 20:37:20 +0000 (20:37 +0000)] 
In CLI, fix .read inability to open 2GB+ files on WIN32.

FossilOrigin-Name: 56c80a62d2e033d64ba5d545ae9cbe3ed7c9d046c0a3fafb6cfa2f0b562d1ef0

2 years agoAvoid invoking sqlite3ExprColUsage() on an unresolve column reference.
drh [Wed, 13 Dec 2023 16:45:18 +0000 (16:45 +0000)] 
Avoid invoking sqlite3ExprColUsage() on an unresolve column reference.
dbsqlfuzz fc34aa62df4de103705d11b807074687ffafbda5.

FossilOrigin-Name: ac9314c0e335694b48c613145f5397247bb88c51806cd0dc3ed4ec306db4bbad

2 years agoBug fix in the JSONB validator.
drh [Wed, 13 Dec 2023 15:27:03 +0000 (15:27 +0000)] 
Bug fix in the JSONB validator.
dbsqlfuzz ac6fa521a08609a642198e7decf64180e750b3c4

FossilOrigin-Name: 3e940a6a08b0a0434650cd3d8dd286e09ad8ab805b0a4d515e57bba5d3608577

2 years agoImprovements to UTF8 handling, and especially the handling of invalid UTF8,
drh [Wed, 13 Dec 2023 14:31:15 +0000 (14:31 +0000)] 
Improvements to UTF8 handling, and especially the handling of invalid UTF8,
in the JSON routines.

FossilOrigin-Name: 1b229c1101d6c384a30f343c5e47b471ab084b2d8e81170eb8f642afc1c67e3b

2 years agoFix the JSON object label comparison object so that it works correctly even
drh [Tue, 12 Dec 2023 18:38:53 +0000 (18:38 +0000)] 
Fix the JSON object label comparison object so that it works correctly even
if the label ends with escaped whitespace.

FossilOrigin-Name: 4d5353cadd7b7c5f105bc197f3ec739e2d041472d6b3e939654c9f9cfc2749ae

2 years agoWorker1 Promiser API: when multiple db connections are active then use the requested...
stephan [Tue, 12 Dec 2023 17:52:27 +0000 (17:52 +0000)] 
Worker1 Promiser API: when multiple db connections are active then use the requested connection instead of always the first-opened connection. Bug reported in [forum:894c330e7f23b177|forum post 894c330e7f23b177].

FossilOrigin-Name: 194276e18e0268829061c09317e7f9f527a703eb45f1755ff1dd30bd99dc1b68

2 years agoThe json_valid(*,8) function does a much better check of the validity of
drh [Tue, 12 Dec 2023 17:31:17 +0000 (17:31 +0000)] 
The json_valid(*,8) function does a much better check of the validity of
the JSONB input.  The json_error_position() function returns an approximate
byte offset to the point of the first detected error in the JSONB.

FossilOrigin-Name: 840efb33a3934a9bdccad65ea15c70d5c335a517502c9844aaad8405d16d1604

2 years agoAdd NEVER to two unreachable branches in JSON. jsonb-valid
drh [Tue, 12 Dec 2023 17:13:10 +0000 (17:13 +0000)] 
Add NEVER to two unreachable branches in JSON.

FossilOrigin-Name: c96ebb086feb89341565cc52b970ae7799ce1327fe1ad4fc790f1b0dcaa6e229

2 years agoImprovements to JSONB validation - catch more cases where the input does
drh [Tue, 12 Dec 2023 14:33:52 +0000 (14:33 +0000)] 
Improvements to JSONB validation - catch more cases where the input does
not conform to spec.

FossilOrigin-Name: be1864eac4eb75cc30bf98f73092c8608467f4bd956240df6a0cbea9f1e09e85

2 years agoValidity checking of text nodes in JSONB.
drh [Tue, 12 Dec 2023 02:31:12 +0000 (02:31 +0000)] 
Validity checking of text nodes in JSONB.

FossilOrigin-Name: fa5160687c2f970d407e8af73c246f7cd806bb4ce35f29a79ac534a8646a6c8e

2 years agoThe json_error_position() function now reports an approximate byte offset
drh [Mon, 11 Dec 2023 21:00:55 +0000 (21:00 +0000)] 
The json_error_position() function now reports an approximate byte offset
to the problem in a JSONB if there is a problem.

FossilOrigin-Name: 80d5d94dff6a2d2557039be3d7d47c1a6003c4b98defe0bd411acfeb963ad5dd

2 years agojson_error_position() now uses jsonValidityCheck() to find the approximate
drh [Mon, 11 Dec 2023 20:44:21 +0000 (20:44 +0000)] 
json_error_position() now uses jsonValidityCheck() to find the approximate
position of an error in a JSONB blob.

FossilOrigin-Name: c3d60cf7028a333b825d5b89516945a73e0c158ac81d8bcc117d21bfd98602c8

2 years agojson_valid(*,8) allows minus-signs on hexadecimal literals.
drh [Mon, 11 Dec 2023 20:19:10 +0000 (20:19 +0000)] 
json_valid(*,8) allows minus-signs on hexadecimal literals.

FossilOrigin-Name: c0d7f4520d839a268b3fd2474d0897a9832aa608bd6238b3e287fabecf07a350

2 years agoActivate JSON_SELFCHECK within fuzzcheck.
drh [Mon, 11 Dec 2023 19:21:06 +0000 (19:21 +0000)] 
Activate JSON_SELFCHECK within fuzzcheck.

FossilOrigin-Name: 4d14e733bb521aed65e98533969d2303738232ae87dab70fdf7962e6513195f5

2 years agoRename the new test-control to SQLITE_TESTCTRL_JSON_SELFCHECK. Make it so
drh [Mon, 11 Dec 2023 19:00:44 +0000 (19:00 +0000)] 
Rename the new test-control to SQLITE_TESTCTRL_JSON_SELFCHECK.  Make it so
that the current value of the setting can be interrogated.

FossilOrigin-Name: 7aff1d9a4cb17ecd5abab21ab032f35a78741dd641ddd8cbcc85fc4a81a0707d

2 years agoAdd SQLITE_TESTCTRL_VALIDATE_JSONB, which if enabled under SQLITE_DEBUG causes
drh [Mon, 11 Dec 2023 17:03:12 +0000 (17:03 +0000)] 
Add SQLITE_TESTCTRL_VALIDATE_JSONB, which if enabled under SQLITE_DEBUG causes
cross-checking of generate JSONB.

FossilOrigin-Name: b410a4db74a650003539ffaaea18519d5159b504daac47db6a4874b730f40ac8

2 years agoWork toward enhanced functionality for json_valid() with deep checking
drh [Mon, 11 Dec 2023 14:01:38 +0000 (14:01 +0000)] 
Work toward enhanced functionality for json_valid() with deep checking
of the JSONB (second argument has bit 0x08).

FossilOrigin-Name: c370d573198b151767f04e91bf8baa4ae0076751ae468c5709742a0b0ed16770

2 years agoFix a potential use of uninitialized value in json_valid() with 2nd
drh [Mon, 11 Dec 2023 02:39:11 +0000 (02:39 +0000)] 
Fix a potential use of uninitialized value in json_valid() with 2nd
argument of 8.

FossilOrigin-Name: fa102036fe46eeb71b7df3e265be1935ae5c78e0b939b08841bcfb8abadbc77a

2 years agoFix a harmless UBSAN warning.
drh [Fri, 8 Dec 2023 16:56:50 +0000 (16:56 +0000)] 
Fix a harmless UBSAN warning.

FossilOrigin-Name: 1503cba6d17e9bade7a5c103ddd23241ff4741f9a2e3032ffe2987af243dae65

2 years agoFix a potential problem RCStr access on a JsonString object that is not
drh [Fri, 8 Dec 2023 14:54:22 +0000 (14:54 +0000)] 
Fix a potential problem RCStr access on a JsonString object that is not
really and RCStr.  Fuzzer/UBSAN find.

FossilOrigin-Name: d2f2174ce2cc89606034e158149a2d05fc3627ec4d5cdb772add7a2250f29d78

2 years agoFix a harmless compiler warning about "confusing indentation".
drh [Fri, 8 Dec 2023 12:58:41 +0000 (12:58 +0000)] 
Fix a harmless compiler warning about "confusing indentation".

FossilOrigin-Name: 34f9e9a8c4bea13f60f43062e25cd7d9422f2e7f5b371ed0ddadc9abeb3ca256

2 years agoAvoid dropping an error code in new fts5 tokendata=1 code.
dan [Fri, 8 Dec 2023 12:04:32 +0000 (12:04 +0000)] 
Avoid dropping an error code in new fts5 tokendata=1 code.

FossilOrigin-Name: a66596e33dc9aa4bab2ec3ff45546e1321d0a11bdc764f8381b315292ca92423

2 years agoEnsure an fts5vocab table never uses a special tokendata=1 merge cursor.
dan [Thu, 7 Dec 2023 21:09:33 +0000 (21:09 +0000)] 
Ensure an fts5vocab table never uses a special tokendata=1 merge cursor.

FossilOrigin-Name: 1e26510e83b40c9bd2e8bfa2a0e81f2cb915e78fed773204ef537683e48b61dc

2 years agoAvoid an assert() failure when querying an fts5vocab table that accesses a tokendata...
dan [Thu, 7 Dec 2023 20:46:40 +0000 (20:46 +0000)] 
Avoid an assert() failure when querying an fts5vocab table that accesses a tokendata=1 fts5 table with corrupt %_data records.

FossilOrigin-Name: 386ba9e20423fb2f623d6adc9d3c310fb1b135f54a1dad15ef3b593d97886926

2 years agoFix a null-pointer dereference in fts5 tokendata=1 code.
dan [Thu, 7 Dec 2023 19:08:25 +0000 (19:08 +0000)] 
Fix a null-pointer dereference in fts5 tokendata=1 code.

FossilOrigin-Name: d69fa8f0504887f968d9a190ecb889ddb40bb1b56d0d4479f9819c106aec719b

2 years agoFix a problem with handling OOM and other errors in fts5 when querying tokendata...
dan [Thu, 7 Dec 2023 18:41:49 +0000 (18:41 +0000)] 
Fix a problem with handling OOM and other errors in fts5 when querying tokendata=1 tables.

FossilOrigin-Name: bc911ab5953532956510c199be72b1d3c556f2d0ddbd7fc0ae6f5f917b337b48

2 years agoDifferent fix for the fts5 COMMIT-following-OOM problem first fixed by [fba3129d...
dan [Thu, 7 Dec 2023 14:41:58 +0000 (14:41 +0000)] 
Different fix for the fts5 COMMIT-following-OOM problem first fixed by [fba3129d]. This one does not cause problems if an fts5 table is renamed and then dropped within the same transaction.

FossilOrigin-Name: d8c6b246944934a7a6e027b3f5b986fd64a19dd5c5c5175f4ea8586da59a6764

2 years agoRework the jsonEachPathLength() routine in json_tree() so that it is
drh [Thu, 7 Dec 2023 14:09:25 +0000 (14:09 +0000)] 
Rework the jsonEachPathLength() routine in json_tree() so that it is
less susceptible to problems due to goofy object labels.

FossilOrigin-Name: 858b76a00e8ff55215f7a2e6a4cd77fc4d4f98dea7224cd90488744f5ce246a4

2 years agoAdd ALWAYS() on branches added in [ec0ae4030968c782] that are always true.
drh [Thu, 7 Dec 2023 13:14:34 +0000 (13:14 +0000)] 
Add ALWAYS() on branches added in [ec0ae4030968c782] that are always true.

FossilOrigin-Name: 451cef8609e96dd9244818adc5c6f240544694bcb4ae620e88f90e403e59d70f

2 years agoImproved detection of corrupt JSONB in the jsonReturnFromBlob() function.
drh [Thu, 7 Dec 2023 12:55:39 +0000 (12:55 +0000)] 
Improved detection of corrupt JSONB in the jsonReturnFromBlob() function.

FossilOrigin-Name: b014736c1f80ccc46fb4b24ac04310a6ce5cb5b6653665efff366cb3bc742257

2 years agoFix compiler warning about shadowed variable in fts5_index.c.
dan [Wed, 6 Dec 2023 18:34:59 +0000 (18:34 +0000)] 
Fix compiler warning about shadowed variable in fts5_index.c.

FossilOrigin-Name: ee70e4c1c9c41617850228e48d8df44f105cf2fbbe789340ceca6f27ad6ce5eb