]> git.ipfire.org Git - thirdparty/sqlite.git/log
thirdparty/sqlite.git
17 months agoReplace the assert() that was removed by [f023cb541b5dd72c] because
drh [Mon, 12 Feb 2024 19:12:30 +0000 (19:12 +0000)] 
Replace the assert() that was removed by [f023cb541b5dd72c] because
[1cd5d4623f44af25] made it true again.

FossilOrigin-Name: 189a49f165dfc348a8730ad2b2288b9b2b2089b1de99fa2d515f2a90c9e7bd4e

17 months agoHave rtree avoid keeping a blob handle open following an error.
dan [Mon, 12 Feb 2024 16:12:25 +0000 (16:12 +0000)] 
Have rtree avoid keeping a blob handle open following an error.

FossilOrigin-Name: 1cd5d4623f44af25ab4f5af580354b3ae22cf5de4109e008ca41055125bb708d

17 months agoAdd a new sqlite3FaultSim() to btree for better fault analysis.
drh [Mon, 12 Feb 2024 14:44:35 +0000 (14:44 +0000)] 
Add a new sqlite3FaultSim() to btree for better fault analysis.

FossilOrigin-Name: 2c675bd30568d3c530300beb3fcfaa17c9f063cdcb9a39ac68b9902100f641a6

17 months agoAdd a new sqlite3FaultSim() call in the btree logic, for testing. new-btree-faultsim
drh [Mon, 12 Feb 2024 13:51:08 +0000 (13:51 +0000)] 
Add a new sqlite3FaultSim() call in the btree logic, for testing.

FossilOrigin-Name: e0558f79b8184ea6741fb20b710dab854f5bdb71aa47d5a6701eeb7389540c8c

17 months agoAdd support for the ".testctrl fault_install" dot-command in the CLI when
drh [Mon, 12 Feb 2024 13:28:10 +0000 (13:28 +0000)] 
Add support for the ".testctrl fault_install" dot-command in the CLI when
launched with the --unsafe-testing option.

FossilOrigin-Name: 5ba7fee1a9b49df82387e355d2ab7de58663d3fa824e50717608b27e0f7ac874

17 months agoIn the RTREE extension, allow the xBeginTransaction() entry point to be
drh [Sun, 11 Feb 2024 22:56:12 +0000 (22:56 +0000)] 
In the RTREE extension, allow the xBeginTransaction() entry point to be
invoked multiple times without intervening calls to xEndTransaction().

FossilOrigin-Name: f023cb541b5dd72c996f0574210344179217666a2229bc8d3fe057fdbc5c2245

17 months agoIf a term of an ORDER BY or GROUP BY contains an aggregate function or column,
drh [Sun, 11 Feb 2024 20:53:14 +0000 (20:53 +0000)] 
If a term of an ORDER BY or GROUP BY contains an aggregate function or column,
then it is not an alias that needs to be resolved, so don't try to.  This fixes
a harmless assertion found by dbsqlfuzz.  This yet another problem that
orginated at check-in [6e6b3729e0549de0].

FossilOrigin-Name: d4ec2a5d2297cd9ead0a8768dcf003ea76c74d8d68d88c40f62363f484a4a4d3

17 months agoImproved AggInfo tracing in debug builds. No changes to deliverable code.
drh [Sun, 11 Feb 2024 18:53:48 +0000 (18:53 +0000)] 
Improved AggInfo tracing in debug builds.  No changes to deliverable code.

FossilOrigin-Name: bb31f9c44794e02a46ed3edbcc96eb48c5870d3f82cb404586ded9a3efa7a859

17 months agoFurther clarify sqlite3_exec() callback parameter lifetime.
larrybr [Sat, 10 Feb 2024 03:11:42 +0000 (03:11 +0000)] 
Further clarify sqlite3_exec() callback parameter lifetime.

FossilOrigin-Name: 993a1a843177b19a9cb5598f57d1e05c01e1695f164faaa9ae22810ad4533eba

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

FossilOrigin-Name: 717f67f3189a59842f5c17a25e8db0e24ec4405886fc22ab6eeb3954fba5a964

17 months agoFix an #endif (added in the wrong place by [8f4b1ceafe4a271b]) so that
drh [Wed, 7 Feb 2024 20:45:38 +0000 (20:45 +0000)] 
Fix an #endif (added in the wrong place by [8f4b1ceafe4a271b]) so that
the build works with SQLITE_OMIT_VIRTUAL_TABLE.

FossilOrigin-Name: 7070924eebce1d089fde911dc0427ab8f3764d57ace24caff2b79954b42d1b51

17 months agoBring test cases into alignment with the latest enhancements.
drh [Wed, 7 Feb 2024 19:52:03 +0000 (19:52 +0000)] 
Bring test cases into alignment with the latest enhancements.

FossilOrigin-Name: cd017c28d516399e25b5ee9e8fcd7390ca2be9128c7c41f1007f37bc01a35717

17 months agoTurns out the branch is reachable, so back out the NEVER().
drh [Wed, 7 Feb 2024 19:17:44 +0000 (19:17 +0000)] 
Turns out the branch is reachable, so back out the NEVER().

FossilOrigin-Name: 0af36a3223d2dabda887830390a603ab4781baca7e2f1698ec6c5f2cf03faf04

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

FossilOrigin-Name: 881f814c09b6896a448a2360b0b43dc99592ea3a1d72ac359770cbb0a2c7d38a

17 months agoSlight change to OOM handling in JSON to catch a corner case found by
drh [Tue, 6 Feb 2024 18:33:01 +0000 (18:33 +0000)] 
Slight change to OOM handling in JSON to catch a corner case found by
dbsqlfuzz.

FossilOrigin-Name: 6a2b3266c586d12b51e11fe63cda5881be9373207aa16671ab77f547830eb790

17 months agoCorrect docs about the first OFPS VFS's importDb() method being synchronous (it's...
stephan [Tue, 6 Feb 2024 08:59:59 +0000 (08:59 +0000)] 
Correct docs about the first OFPS VFS's importDb() method being synchronous (it's not, whereas the second VFS's importDb() is).

FossilOrigin-Name: ae7505fa5e112f39a329befb35eff6ddf46a53f5deb610906550bf67f56fc157

17 months agoMake explicit that using the importDb() methods of the OPFS VFSes has undefined resul...
stephan [Tue, 6 Feb 2024 08:25:23 +0000 (08:25 +0000)] 
Make explicit that using the importDb() methods of the OPFS VFSes has undefined results if the being-imported db is currently open. Doc changes only.

FossilOrigin-Name: f28b9924b401b359e59a73918a34b29cde719164a6b4ac5a9d23da6294b701bd

17 months agoReturn SQLITE_ABORT if the underlying shadow tables change in the middle of an rtree...
dan [Mon, 5 Feb 2024 17:54:03 +0000 (17:54 +0000)] 
Return SQLITE_ABORT if the underlying shadow tables change in the middle of an rtree query in such a way as to invalidate an rtree internal priority queue entry. This replaces the SQLITE_ABORT_ROLLBACK mechanism added in [af5c4251].

FossilOrigin-Name: 32f85a5ce8e32506ad0cf309c86589958f38d924b4b3de532bec8bdb8e385fad

17 months agoReturn SQLITE_ABORT if the underlying shadow tables change in the middle of an rtree... rtree-fix
dan [Mon, 5 Feb 2024 17:35:36 +0000 (17:35 +0000)] 
Return SQLITE_ABORT if the underlying shadow tables change in the middle of an rtree query in such a way as to invalidate an rtree internal priority queue entry.

FossilOrigin-Name: 478280ef67efed854988ab4f740a38ae1937204c0434ad8da11f1869a12a6d06

17 months agoExtend [d294a23ed6d] to apply to all wasm speedtest1 builds.
stephan [Mon, 5 Feb 2024 03:56:02 +0000 (03:56 +0000)] 
Extend [d294a23ed6d] to apply to all wasm speedtest1 builds.

FossilOrigin-Name: 26f848e5e0ac34e545d2f27cf33abc46eac13e04ed9cd71084b0f7d47136ff97

17 months agowasm: pass the promiser function to the promiser onready() callback to simplify acces...
stephan [Mon, 5 Feb 2024 03:37:54 +0000 (03:37 +0000)] 
wasm: pass the promiser function to the promiser onready() callback to simplify access to it in certain usage patterns.

FossilOrigin-Name: f8a8b9ee2eddf5f875c7c4399e750ccf1941f767560ebc2c88c083560f5aaae0

17 months agowasm: squelch a new (and, in our case, invalid) warning from emcc 3.1.52.
stephan [Mon, 5 Feb 2024 02:36:10 +0000 (02:36 +0000)] 
wasm: squelch a new (and, in our case, invalid) warning from emcc 3.1.52.

FossilOrigin-Name: d294a23ed6d1d2b567a02552b8a2e4921cd21891ee86e63f8f9945569e3262d3

17 months agoFix a minor test file locking issue on Windows.
mistachkin [Sun, 4 Feb 2024 04:18:29 +0000 (04:18 +0000)] 
Fix a minor test file locking issue on Windows.

FossilOrigin-Name: 6cd70b71df5c0d45412081590316bced302ec4403d565250b56e611882204821

17 months agoFix harmless compiler warnings seen with MSVC.
mistachkin [Sun, 4 Feb 2024 04:01:11 +0000 (04:01 +0000)] 
Fix harmless compiler warnings seen with MSVC.

FossilOrigin-Name: e52c87420b072fa68d921eda66069542d50accbfaf1110ac4cc1543a4162200d

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

FossilOrigin-Name: af5c425114f32c2f84aea20edd4fa46eb1bfdeb3747fce357540e15978a070c8

17 months agoMore extensive use of SQLITE_CORRUPT_PGNO.
drh [Fri, 2 Feb 2024 18:42:09 +0000 (18:42 +0000)] 
More extensive use of SQLITE_CORRUPT_PGNO.

FossilOrigin-Name: 3838332cffb87f77a7c6b357066a59b9dc4f65ef4b3496767ad7ad7c14a77be2

17 months agoFix typo in vdbe.c comment. No changes to code.
dan [Fri, 2 Feb 2024 11:37:03 +0000 (11:37 +0000)] 
Fix typo in vdbe.c comment. No changes to code.

FossilOrigin-Name: 62010ba488f65aec3c6bd17b05f64c5b3e885dee4221e6016c4eb1053e19284d

17 months agoEnsure the fts5 xIntegrity method correctly returns error codes unrelated to corrupti...
dan [Thu, 1 Feb 2024 15:42:22 +0000 (15:42 +0000)] 
Ensure the fts5 xIntegrity method correctly returns error codes unrelated to corruption or missing SQL elements.

FossilOrigin-Name: d18d9a05c2d6f290d7b16eafced0cde4eb8dd3f869778a49103812d35a0cee65

17 months agoEnsure the fts3 xIntegrity method correctly returns error codes unrelated to corrupti...
dan [Thu, 1 Feb 2024 15:21:55 +0000 (15:21 +0000)] 
Ensure the fts3 xIntegrity method correctly returns error codes unrelated to corruption or missing SQL elements.

FossilOrigin-Name: 1bdb8cbaf7e733e0731de2ecd7a05ddf44db5d8595dcc7aaf0927ed0aa5b33d3

17 months agoIn PRAGMA integrity_check, defer running xIntegrity on virtual tables until
drh [Thu, 1 Feb 2024 14:57:24 +0000 (14:57 +0000)] 
In PRAGMA integrity_check, defer running xIntegrity on virtual tables until
after all ordinary tables have been checked.

FossilOrigin-Name: 8f4b1ceafe4a271b23e17493a244a34c1732a3d35c5533c37394b9f3dc158435

17 months agoAdd tracing logic to the shared-cache locks in btree.c. The tracing is
drh [Thu, 1 Feb 2024 14:17:01 +0000 (14:17 +0000)] 
Add tracing logic to the shared-cache locks in btree.c.  The tracing is
off by default.  Enable by changing a single "#if 0" into "#if 1" and
recompiling.  Debugging code only - no changes to release builds.

FossilOrigin-Name: f2b943f97ad7e47848ac6df3a3a1eba134b9e63c4a631f8eaf8bda77cc02ba7b

17 months agoAdd the test_oom_breakpoint() routine on debug builds, to serve as a
drh [Thu, 1 Feb 2024 11:38:58 +0000 (11:38 +0000)] 
Add the test_oom_breakpoint() routine on debug builds, to serve as a
convenient breakpoint to intercept OOM conditions.

FossilOrigin-Name: e45df7dcd6b5766d7593ee87e59dd422a217cce0a1a8d369c03144bb21859428

17 months agoReplace an conditional assignment that was made obsolete by [d4c193f0b49f4950]
drh [Wed, 31 Jan 2024 20:11:54 +0000 (20:11 +0000)] 
Replace an conditional assignment that was made obsolete by [d4c193f0b49f4950]
with an assert().  The conditional was added by [d6fd512f50513ab7] as
a fix for tickets [c36cdb4afd504dc1], [4051a7f931d9ba24], and
[d6fd512f50513ab7] which means now [d4c193f0b49f4950] is the correct fix
for those tickets.
that check-in

FossilOrigin-Name: 44b5524d522e749ad6bf76c94d754ff16c309c32439ec46802924663f64e8b09

17 months agoAllow control characters in JSON5 string literals.
drh [Wed, 31 Jan 2024 15:29:29 +0000 (15:29 +0000)] 
Allow control characters in JSON5 string literals.
[forum:/forumpost/05182119f69c3a92|Forum thread 05182119f69c3a92].

FossilOrigin-Name: 380f09c194caff557640692d2f255f8cdc1dcfed5976711686466692f4d7a60d

17 months agoAdd NEVER() and ALWAYS() macros for the JSON5-control-character change. json5-ctrl-char
drh [Wed, 31 Jan 2024 15:20:13 +0000 (15:20 +0000)] 
Add NEVER() and ALWAYS() macros for the JSON5-control-character change.
Also fix an incorrect comparison used to determine if a buffer needed to
be resized.

FossilOrigin-Name: e3c0c0e686f3b7710f79587cf465b5aac52d8f2f2986a3de885a656f652cbfd3

17 months agoFix failure to detect unterminated string literals in json_valid() in the
drh [Wed, 31 Jan 2024 14:44:59 +0000 (14:44 +0000)] 
Fix failure to detect unterminated string literals in json_valid() in the
previous check-in.

FossilOrigin-Name: 5d725644621cf640fb743d59ccf89dac777540410e67501eb00b83638c8c857f

17 months agoAllow control characters in JSON5 string literals.
drh [Wed, 31 Jan 2024 13:46:44 +0000 (13:46 +0000)] 
Allow control characters in JSON5 string literals.
[forum:/forumpost/05182119f69c3a92|Forum thread 05182119f69c3a92].

FossilOrigin-Name: 34709c7cc910539e23a830ad8b589a97a88be25e924a59670c1017fb51447dad

17 months agoFix a memory allocation bug in the (debug-use-only) json_parse() SQL function.
drh [Wed, 31 Jan 2024 12:15:57 +0000 (12:15 +0000)] 
Fix a memory allocation bug in the (debug-use-only) json_parse() SQL function.

FossilOrigin-Name: 32ce7dacf58bbf35cf70da8b03fa25f97fcea970edbc1f8aa12739ac4c8608fb

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

FossilOrigin-Name: 72f3e1d0eca2b9ebd7c4b4cdccc6d7a0173b2fdb204cb1aa207917aedab6098a

18 months agoWhen generated text JSON from JSONB, do not continue descending into
drh [Mon, 29 Jan 2024 20:36:17 +0000 (20:36 +0000)] 
When generated text JSON from JSONB, do not continue descending into
nested structures after an error is seen.  This avoids long loops and wait
times.

FossilOrigin-Name: 97666ec052ebaceab002874d7ca5c5e6883c3d04fb7d3992235a8c4c8d08407a

18 months agoConsider an index for queries like "SELECT count(DISTINCT col) FROM ...", even if...
dan [Mon, 29 Jan 2024 19:30:16 +0000 (19:30 +0000)] 
Consider an index for queries like "SELECT count(DISTINCT col) FROM ...", even if the index records are not smaller than the table records.

FossilOrigin-Name: ad06868807a27f0c96fa5649ebd981e07909eb2c5e03781377c876fdec49abdc

18 months agoAvoid a potential buffer overread when handling corrupt json blobs.
dan [Mon, 29 Jan 2024 15:30:35 +0000 (15:30 +0000)] 
Avoid a potential buffer overread when handling corrupt json blobs.

FossilOrigin-Name: 738473dc0ac353731080d0785cc7dc9810b564906c176916bd91d6cfbb1a7b18

18 months agoWhen rendering JSONB back into text JSON, report an error if a zero-length
drh [Mon, 29 Jan 2024 12:50:32 +0000 (12:50 +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: b0eb279ea83c1c788c39fb90e178ec99fa4c782195c376a420c661fedf4545a7

18 months agoUse __ppc__ instead of __POWERPC__ to identify 32-bit PowerPC processors.
drh [Sun, 28 Jan 2024 20:42:12 +0000 (20:42 +0000)] 
Use __ppc__ instead of __POWERPC__ to identify 32-bit PowerPC processors.
[forum:/forumpost/34794846ce|Forum post 34794846ce].

FossilOrigin-Name: c974d9313b60591bcd554c3ec652a8040d382930e30778e6be8a875145b0b3da

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

FossilOrigin-Name: d4c193f0b49f4950b20c2f0e6aa037d2ed7d8c0b4687c14923b3a0d0d4a1b3fd

18 months agoApply the same fix found in [99057383acc8f920] to descending scans.
drh [Sun, 28 Jan 2024 00:31:47 +0000 (00:31 +0000)] 
Apply the same fix found in [99057383acc8f920] to descending scans.
dbsqlfuzz afd1d61fc27d14938a0d78a50970fa1e9fbfee5.

FossilOrigin-Name: e1d463c2d6e93e0ae0a60a05a79cd346bd07142de2fe631b370a9b946763b5d6

18 months agoImprovements to parser stack overflow testing.
drh [Sat, 27 Jan 2024 20:17:05 +0000 (20:17 +0000)] 
Improvements to parser stack overflow testing.
[forum:/forumpost/99e181b5bf|Forum post 99e181b5bf].

FossilOrigin-Name: 556c43a937f1d1c19117da24e6d892852241189f4e47e1c86aa1e8c36461c5de

18 months agoPerformance enhancements to the parser template.
drh [Sat, 27 Jan 2024 12:47:51 +0000 (12:47 +0000)] 
Performance enhancements to the parser template.

FossilOrigin-Name: 2db8b30acdeaeaf7ec92dc0382a25f96bca4561fb68a72713ff963e27f39c63b

18 months agoUse an alternative memory allocator for parser stack space that includes
drh [Sat, 27 Jan 2024 12:25:07 +0000 (12:25 +0000)] 
Use an alternative memory allocator for parser stack space that includes
a call to sqlite3FaultSim() to facilitate testing.

FossilOrigin-Name: 7c36d560ff4e8e1b3f8fad972ec7f07837e4fa4e6861fafde970ffccfda5a2f1

18 months agoAllocate new parser stack space from the heap if needed, eliminating the
drh [Sat, 27 Jan 2024 11:35:35 +0000 (11:35 +0000)] 
Allocate new parser stack space from the heap if needed, eliminating the
possibility of a "parser stack overflow" error as long as heap memory is
available.

FossilOrigin-Name: d87a2054774aa6ce54d9ccd78899b638f1eaf4f9a1d847bf22500018049c9f8d

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

18 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

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

FossilOrigin-Name: c8284170f66374fc528e9d6e5a03ee7321f27e80acf4360701a8b176497b7130

18 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

18 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

18 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

18 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

18 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

18 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

18 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