]> git.ipfire.org Git - thirdparty/sqlite.git/log
thirdparty/sqlite.git
15 months agoAdd delete-before-open=1 URI flag to the 'opfs' VFS to tell it to xDelete the db... opfs-delete-before-open
stephan [Mon, 11 Mar 2024 09:32:38 +0000 (09:32 +0000)] 
Add delete-before-open=1 URI flag to the 'opfs' VFS to tell it to xDelete the db file before opening it, primarily to enable users to work around a corrupt db without having to reach into OPFS-specific APIs to remove the db file.

FossilOrigin-Name: e83f9788636f7f9bcca7d2a09620c13ab4eb83436d5b2946a827e48addf0267d

15 months agoFix the .expert command in the shell so that it does not leak memory if not
drh [Sat, 9 Mar 2024 18:41:40 +0000 (18:41 +0000)] 
Fix the .expert command in the shell so that it does not leak memory if not
followed by SQL and so that it works with reverse_unordered_selects.

FossilOrigin-Name: 7ead022edaf7a0cd6a8976a1261246084975c9a5be5c893f6c751bb5f963ac0f

15 months agoFuzzcheck is run automatically by testrunner.tcl, so there is no need to
drh [Sat, 9 Mar 2024 13:31:10 +0000 (13:31 +0000)] 
Fuzzcheck is run automatically by testrunner.tcl, so there is no need to
include fuzzcheck as a separate dependency for the releasetest target in
the MSVC makefile.

FossilOrigin-Name: 76629b2bff01df3d42eef2e93d626c291a2f129bd923498941465e5bca74e9f1

15 months agoThe NOT NULL strength reduction optimization from [de9c86c9e4cdb34f] should
drh [Fri, 8 Mar 2024 21:37:18 +0000 (21:37 +0000)] 
The NOT NULL strength reduction optimization from [de9c86c9e4cdb34f] should
be applied to the WHERE clause only.  Otherwise, the operand of the IS NULL
or IS NOT NULL operator might be a reference to a bare column of an
aggregate table, and we can't tell if it is NULL or not based only on its
NOT NULL attribute.  [forum:/forumpost/440f2a2f17|Forum post 440f2a2f17].

FossilOrigin-Name: 51704feae224eff601db5607f8651da11b3c2ed8a58ffe5b6ee8260cab50695b

15 months agoOne of the assert()s added by the previous check-in was not quite correct.
drh [Fri, 8 Mar 2024 19:03:30 +0000 (19:03 +0000)] 
One of the assert()s added by the previous check-in was not quite correct.
This commit fixes it.

FossilOrigin-Name: d401358329f5a70f9a0b9b033609a4db2af89b83c6b40242be0c76f3d6474def

15 months agoAdd new assert() statements, which if they had existed three years ago,
drh [Fri, 8 Mar 2024 15:39:59 +0000 (15:39 +0000)] 
Add new assert() statements, which if they had existed three years ago,
would have detected the code generator problem fixed by the previous check-in.

FossilOrigin-Name: 166d1e5d26ef88e995f44182144891f60bd51c1aa585b4a148f01a920b2a8eea

15 months agoSilently ignore redundant ON CONFLICT clauses in an UPSERT. Only the first
drh [Fri, 8 Mar 2024 14:01:48 +0000 (14:01 +0000)] 
Silently ignore redundant ON CONFLICT clauses in an UPSERT.  Only the first
ON CONFLICT for each index is active.  Do not issue an error, since that might
break legacy queries.  But ignore the redundant ON CONFLICT clauses to prevent
problems such as described in [forum:/forumpost/919c6579c8|forum post 919c6579c8].

FossilOrigin-Name: d0ea6b6ba64dba9d68c2b391ccf1171ea96fcdd7409dafdb2b697accb00246b8

15 months agoOmit some extra tests for the intck extension in OMIT_VIRTUAL_TABLE or OMIT_PRAGMA...
dan [Fri, 8 Mar 2024 13:49:43 +0000 (13:49 +0000)] 
Omit some extra tests for the intck extension in OMIT_VIRTUAL_TABLE or OMIT_PRAGMA builds.

FossilOrigin-Name: 29d9eb7d55755604781e507f6ca36c50d62fa8d8589ab932d7cefca94ba24f3e

15 months agoFix pragma6.test so that it works with ENABLE_OVERSIZE_CELL_CHECK builds.
dan [Fri, 8 Mar 2024 11:13:20 +0000 (11:13 +0000)] 
Fix pragma6.test so that it works with ENABLE_OVERSIZE_CELL_CHECK builds.

FossilOrigin-Name: a02551de4c2d7085569ee76f88bfef5da429e40137cc1d1349b4637f88259ad1

15 months agoDo not run tests for the intck extension in OMIT_VIRTUAL_TABLE or OMIT_PRAGMA builds.
dan [Fri, 8 Mar 2024 11:08:53 +0000 (11:08 +0000)] 
Do not run tests for the intck extension in OMIT_VIRTUAL_TABLE or OMIT_PRAGMA builds.

FossilOrigin-Name: de8130c020821a1615cceeb730423a2d6e01578caaaddeb11950363c4f8ea412

15 months agoMust use sqlite3IntFloatCompare() for accurate comparisons between very large
drh [Fri, 8 Mar 2024 03:24:09 +0000 (03:24 +0000)] 
Must use sqlite3IntFloatCompare() for accurate comparisons between very large
integer and floating point values in RTREE.  Otherwise the comparison does
not work on all platforms.  Further fix to [027e5336acc26f57].

FossilOrigin-Name: 820f106acff5f2cd01da0e95a0e6f2bcc087705bf8c08b730b1fdb08db5679c8

15 months agoIntroducing JS worker1 promiser v2, which initializes via Promise (instead of a callb...
stephan [Thu, 7 Mar 2024 19:29:53 +0000 (19:29 +0000)] 
Introducing JS worker1 promiser v2, which initializes via Promise (instead of a callback function) and can be loaded as an ESM module.

FossilOrigin-Name: 2fbaf2f51d37f70ee26d45f0c62f32c15a9e03f68b6d2e2892115e7dc028b929

15 months agoResolve duplicate loading of promiser v2 demo code (a side effect of having done... wasm-promiser1-v2
stephan [Thu, 7 Mar 2024 18:53:27 +0000 (18:53 +0000)] 
Resolve duplicate loading of promiser v2 demo code (a side effect of having done precisely what it was told to do). Consolidate demo-worker1-promiser(-esm).html/(m)js variants into central copies processed with c-pp.

FossilOrigin-Name: 9347d9b9a69277e40ea2f3ec6e1ff37ea19d24b4af80c6230b10624173f2f17c

15 months agowasm promiser.v2 is essentially working but the demo code is double-loading the modul...
stephan [Thu, 7 Mar 2024 17:56:08 +0000 (17:56 +0000)] 
wasm promiser.v2 is essentially working but the demo code is double-loading the module for as-yet-undetermined reasons.

FossilOrigin-Name: aa877ce0c3b3aa1accd6e5fcd722d1bfaa79bea28c04c6badd8a547cea4bbc63

15 months agoInitial work at getting sqlite3Worker1Promiser.v2() to return a Promise instead of...
stephan [Thu, 7 Mar 2024 16:04:43 +0000 (16:04 +0000)] 
Initial work at getting sqlite3Worker1Promiser.v2() to return a Promise instead of using an onready() callback, and also creating an ESM build for promiser1 per user request. It seems to work but requires more testing.

FossilOrigin-Name: 0e272123ace55ed63fe86632671cca48e8965a28fc3625324984028729fc203f

15 months agoFix harmless compiler warnings in test code for the intck extension.
drh [Thu, 7 Mar 2024 15:58:06 +0000 (15:58 +0000)] 
Fix harmless compiler warnings in test code for the intck extension.

FossilOrigin-Name: 7fbdc1a849af3440579459bbb8797ebc7f9cce7b34d95675b8baa82db194ea9c

15 months agoDo not allow the query planner to be tricked into thinking that an index on a
drh [Thu, 7 Mar 2024 12:34:26 +0000 (12:34 +0000)] 
Do not allow the query planner to be tricked into thinking that an index on a
constant expression might be useful for something.  Problem reported on
[forum:/forumpost/ecdfc02339|forum post ecdfc02339].  This is a follow-up
to the fixes at [44200596aa943963] and [2d2b91cc0f6fed8c].

FossilOrigin-Name: 720ce06d93a9e4cc25c34c873c82165d8801f208c22701e51538f3210de84f65

15 months agoAdd the json_pretty() SQL function.
drh [Wed, 6 Mar 2024 20:49:05 +0000 (20:49 +0000)] 
Add the json_pretty() SQL function.

FossilOrigin-Name: ceb51c1cc36dfb78db8f2be042a0d74ab9a877d14a53dadf876d09e1a0616d6a

15 months agoAdd test cases for json_pretty(). json-pretty
drh [Wed, 6 Mar 2024 20:38:52 +0000 (20:38 +0000)] 
Add test cases for json_pretty().

FossilOrigin-Name: 6448b90708eeedef03e82dcb10d2879e1bc859d422b450c5fc403ffbe0343bed

15 months agoWork around obscure floating point issue seen with older versions of MSVC.
mistachkin [Wed, 6 Mar 2024 20:24:02 +0000 (20:24 +0000)] 
Work around obscure floating point issue seen with older versions of MSVC.

FossilOrigin-Name: 42d39f9140cc315df04b048f3811311fa50b51e1831d6cdf982fbce029778e43

15 months agoAdd a couple of json_pretty() examples to /fiddle.
stephan [Wed, 6 Mar 2024 14:42:06 +0000 (14:42 +0000)] 
Add a couple of json_pretty() examples to /fiddle.

FossilOrigin-Name: d5e1687b1d49cec5daa8793ea138fdf3bd29436c1e67071707ec0594bd1c66c6

15 months agoAdd the json_pretty(J) function for pretty-printing of JSON. An optional
drh [Wed, 6 Mar 2024 14:30:42 +0000 (14:30 +0000)] 
Add the json_pretty(J) function for pretty-printing of JSON.  An optional
2nd argument is text used for indentation, with a default value being four
spaces.

FossilOrigin-Name: 39552bd36c06fe9ee346cb71e0659baceccde031b67c0974f2dd14eb11ebc055

15 months agoCorrection to the previous check-in.
drh [Wed, 6 Mar 2024 12:28:55 +0000 (12:28 +0000)] 
Correction to the previous check-in.

FossilOrigin-Name: 483fa2969e1e10cd8e8d2f9e3027871c65b1360b6c23897efe3ce63a3a55ae13

16 months agoFix handling of "id=?" corner cases in rtree when the value on the RHS is a real...
dan [Wed, 6 Mar 2024 11:35:36 +0000 (11:35 +0000)] 
Fix handling of "id=?" corner cases in rtree when the value on the RHS is a real value.

FossilOrigin-Name: 027e5336acc26f57f21df4980928731026c30cf88688fa0b66f13ffa0b5da3a0

16 months agoRemove code that added a P4 parameter to the OP_Variable opcode. This is no longer...
dan [Tue, 5 Mar 2024 18:41:03 +0000 (18:41 +0000)] 
Remove code that added a P4 parameter to the OP_Variable opcode. This is no longer required.

FossilOrigin-Name: dd5977c9a8a418be3fbd646d74933996381099a9263a02eb4a990f0084463dc1

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

FossilOrigin-Name: 8290646792bc5411112b0c01dc5ac0837743056a7679725ee2edefef2e10d146

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

FossilOrigin-Name: 952ed71b9b61e79fe807ac3134bdfa7c94a415e02f13f94440a34d6d548d171e

16 months ago/fiddle: reorder/replace example entries to make them more coherent when tried in...
stephan [Tue, 5 Mar 2024 12:48:26 +0000 (12:48 +0000)] 
/fiddle: reorder/replace example entries to make them more coherent when tried in order and clear the example selection list when the input area is cleared, both based on forum feedback.

FossilOrigin-Name: b4ce270b3f19499385d0923f0f28f702c8f664476def3994fdba5d418e3c5edb

16 months ago/fiddle 'Mandlebrot' typo fix reported in the forum.
stephan [Tue, 5 Mar 2024 08:48:40 +0000 (08:48 +0000)] 
/fiddle 'Mandlebrot' typo fix reported in the forum.

FossilOrigin-Name: ceefe6ba380c18279c2ae88443649e00e5e8110b529d447131ea9726de61f5d0

16 months agoUpdate fiddle.make to account for Makefile changes in [178b7d46f9].
stephan [Tue, 5 Mar 2024 07:55:20 +0000 (07:55 +0000)] 
Update fiddle.make to account for Makefile changes in [178b7d46f9].

FossilOrigin-Name: 7a5d810549f2686ae923fd0ca03ad8f536c9080b6879128ee8f00e653bb7f3f1

16 months ago/fiddle: before resetting a db, roll back any transactions (resolves problem reported...
stephan [Tue, 5 Mar 2024 06:31:37 +0000 (06:31 +0000)] 
/fiddle: before resetting a db, roll back any transactions (resolves problem reported in [forum:0b41a25d65|forum post 0b41a25d65]) and remove an obsolete/broken reference to a long-gone API which could cause initialization to fail prematurely.

FossilOrigin-Name: ee164ca73cf4151b1a1bf351729afa9b0ec95bd5004a5d5bfce3ed46268bfbf3

16 months agoFix a compiler warning in date.c. Update makefiles to include all necessary
drh [Mon, 4 Mar 2024 18:22:18 +0000 (18:22 +0000)] 
Fix a compiler warning in date.c.  Update makefiles to include all necessary
dependencies for building shell.c.

FossilOrigin-Name: 178b7d46f9c8e1694ed6f506d2785a9f5c49e2b428e04c8096d557cc1b5c9680

16 months agoChange test results in corruptC.test to account for the added detail in the
drh [Mon, 4 Mar 2024 16:44:37 +0000 (16:44 +0000)] 
Change test results in corruptC.test to account for the added detail in the
output of "PRAGMA integrity_check" from [b736519d3d2e93c7].

FossilOrigin-Name: 0d19eeaafb296aad212ee4f55a0f6df8c7c5185b14d7f7f49c020fe4cbe370c1

16 months agoFix harmless compiler warnings in the increment integrity_check extension.
drh [Mon, 4 Mar 2024 16:18:40 +0000 (16:18 +0000)] 
Fix harmless compiler warnings in the increment integrity_check extension.

FossilOrigin-Name: 596668e6625208ff5d2ffbb4e0530530ebb3a400efa0df54bad1d91953e32694

16 months agoAdjust date/time functions so that they do a better job of keeping track
drh [Mon, 4 Mar 2024 13:58:09 +0000 (13:58 +0000)] 
Adjust date/time functions so that they do a better job of keeping track
of whether the current time is UTC or localtime, and no-op the 'utc' and
'localtime' modifiers accordingly. See
[forum:/info/e7a939e074|forum post e7a939e074].
Also add the datedebug() function, available
only under -DSQLITE_DEBUG, for improved visibility of the DateTime object
during debugging and testing.

FossilOrigin-Name: dc569683748354a6db83438904422e802d3ea780775c48da85b474fff03ca8a1

16 months agoFix assert() statements in date/time computations: The month and day numbers
drh [Mon, 4 Mar 2024 11:12:15 +0000 (11:12 +0000)] 
Fix assert() statements in date/time computations: The month and day numbers
can be zero if an error has been seen.

FossilOrigin-Name: fc773f6c76ec114be8b6e25b13885acb5adcc9d052dca0d8d0ff94e2a0743d64

16 months agoDocument why the wasm build does not use Emscripten's -sSTRICT=1 flag and account...
stephan [Mon, 4 Mar 2024 09:56:47 +0000 (09:56 +0000)] 
Document why the wasm build does not use Emscripten's -sSTRICT=1 flag and account for a behaviour change in emsdk 3.1.55 regarding the HEAPxyz symbols.

FossilOrigin-Name: f6e887203365b30cea6e9c145366345e48256a347388577edf2bada65e0655b7

16 months agoWhen warning about multiple invocations of JS's sqlite3ApiBootstrap(), use the warnin...
stephan [Mon, 4 Mar 2024 09:23:52 +0000 (09:23 +0000)] 
When warning about multiple invocations of JS's sqlite3ApiBootstrap(), use the warning logger installed by the first invocation, rather than console.warn.

FossilOrigin-Name: d162af2d9941cd8c53e3928efb42aaaf4e59454f7d39aebf980a30b1427ea75b

16 months agoAfter wasm bootstrapping has read the optional global-scope config objects, delete...
stephan [Mon, 4 Mar 2024 06:54:41 +0000 (06:54 +0000)] 
After wasm bootstrapping has read the optional global-scope config objects, delete those objects because any further changes would not have any useful effect. Expand the docs regarding the sqlite3ApiBootstrap() config object and explain the necessary evil of a separate global-scope object for that configuration.

FossilOrigin-Name: e6b14f73136aae4c1a92d6d6ab8c5d1510db5244d0b0f168eed5b4b257c99064

16 months agoBack out the previous change. Replace it with new date modifiers "ceiling"
drh [Sun, 3 Mar 2024 20:15:36 +0000 (20:15 +0000)] 
Back out the previous change.  Replace it with new date modifiers "ceiling"
and "floor".

FossilOrigin-Name: f0831cced2c919e409214d936c81473ae321a98c5bd78b5b729c1269bf71bc45

16 months agoNew date/time modifiers "mnth" and "yr" work like "month" and "year" but
drh [Sat, 2 Mar 2024 21:02:41 +0000 (21:02 +0000)] 
New date/time modifiers "mnth" and "yr" work like "month" and "year" but
resolve day-of-month overflow by truncating rather than rolling over into
the next month. [forum:/forumpost/232d1abb5d|Forum thread 232d1abb5d]

FossilOrigin-Name: 5d392c16bb5658bc92f60d250ab82c45cc109e32d58a073498c9a487b8625e96

16 months agoChange the magic time-interval names that do truncate-to-same-month to be month-truncate
drh [Sat, 2 Mar 2024 20:50:56 +0000 (20:50 +0000)] 
Change the magic time-interval names that do truncate-to-same-month to be
"mnth" and "yr" - "month" and "year" without the vowels.

FossilOrigin-Name: 296b46c529d79385d7f4db2c789254a992c01ff66fe8ba6d3a3ce4aaac0203fb

16 months agoProof-of-concept for new time-interval operator "pg-month" and "pg-year" that
drh [Sat, 2 Mar 2024 13:38:46 +0000 (13:38 +0000)] 
Proof-of-concept for new time-interval operator "pg-month" and "pg-year" that
use the truncate-to-month algorithm for month overflow instead of the
wrap-to-next-month algorithm that is used by SQLite by default.

FossilOrigin-Name: b606c0965788f56547435c9318b60e32990877e14a9640d887f33f39d1bdc7c3

16 months agoFix two -Werror=lto-type-mismatch warnings reported in [forum:ef62b57bd5|forum post...
stephan [Thu, 29 Feb 2024 10:55:02 +0000 (10:55 +0000)] 
Fix two -Werror=lto-type-mismatch warnings reported in [forum:ef62b57bd5|forum post ef62b57bd5].

FossilOrigin-Name: 803481f25020f3c25941f1e7d1a8071937820dea951e8798198b0b0fa3fb48ce

16 months agoFix two -Werror=lto-type-mismatch warnings reported in [forum:ef62b57bd5|forum post... lto-type-mismatch
stephan [Thu, 29 Feb 2024 03:45:18 +0000 (03:45 +0000)] 
Fix two -Werror=lto-type-mismatch warnings reported in [forum:ef62b57bd5|forum post ef62b57bd5].

FossilOrigin-Name: 29f94610dc8319709b8d3726a60e2a7a33ffbf4998c681f772da26c9701cc0b0

16 months agoAdd in a VdbeCoverage() macro needed by STAT4 that should have been part of
drh [Wed, 28 Feb 2024 15:32:32 +0000 (15:32 +0000)] 
Add in a VdbeCoverage() macro needed by STAT4 that should have been part of
check-in [63ef234e88857a65].

FossilOrigin-Name: d51c699ae413215d534f954c129691ef5d95d540dc5d4304cbba576c976d931c

16 months agoAlways convert 32-bit integer literals into EP_IntValue notation, even if
drh [Wed, 28 Feb 2024 01:12:21 +0000 (01:12 +0000)] 
Always convert 32-bit integer literals into EP_IntValue notation, even if
they contain "_" separators.

FossilOrigin-Name: 2dfc427f676255cbe189a26bfec2405d41d31ccc4512c55b31e6e633261d7a23

16 months agoFix an eputf() macro without its argument in the CLI.
drh [Tue, 27 Feb 2024 20:19:32 +0000 (20:19 +0000)] 
Fix an eputf() macro without its argument in the CLI.

FossilOrigin-Name: c2f5e257d2cfb91341f5261ed3924dc4ec2a6f854f3692fb416043f5c654a963

16 months agoAdd an assert() to help scan-build recognize that a variable is initialized.
drh [Tue, 27 Feb 2024 19:57:31 +0000 (19:57 +0000)] 
Add an assert() to help scan-build recognize that a variable is initialized.

FossilOrigin-Name: 10d26f1ee8e7624cbb957332b4397d2f1fcdaf916acec93077f2ddd33e01f1d8

16 months agoAdjust a VdbeCoverage() macro in PRAGMA integrity_check to account for the
drh [Tue, 27 Feb 2024 16:36:40 +0000 (16:36 +0000)] 
Adjust a VdbeCoverage() macro in PRAGMA integrity_check to account for the
fact that arguments to the OP_Eq opcode used are never NULL.

FossilOrigin-Name: 759ccea3f6e21493c0153f884b601988efd59e409b113b28f8cf23f59a74e418

16 months agoRemove unreachable branches from the PRAGMA integrity_check enhancement of
drh [Tue, 27 Feb 2024 15:33:54 +0000 (15:33 +0000)] 
Remove unreachable branches from the PRAGMA integrity_check enhancement of
[b736519d3d2e93c7].

FossilOrigin-Name: 6d02fb233fb86f9907cc374d06a7ed71a638091d6e75abc199001c42eab51e5c

16 months agoEnsure memory cells are properly freed before they are overwritten by OP_IntegrityCk.
dan [Tue, 27 Feb 2024 14:31:31 +0000 (14:31 +0000)] 
Ensure memory cells are properly freed before they are overwritten by OP_IntegrityCk.

FossilOrigin-Name: e50acaf934f44f8833bc588e0ae1abd59df907b9a42d4cafd5518427a8c7b627

16 months agoHave "PRAGMA quick_check" compare the number of entries in tables and indexes.
dan [Tue, 27 Feb 2024 11:03:10 +0000 (11:03 +0000)] 
Have "PRAGMA quick_check" compare the number of entries in tables and indexes.

FossilOrigin-Name: b736519d3d2e93c76fa36253143f2664b9dd12e26acba555f0bf9c4d44705499

16 months agoExtend sqlite3.c makefile rule to support EXTRA_SRC=list-of-c-files to append to...
stephan [Tue, 27 Feb 2024 11:02:31 +0000 (11:02 +0000)] 
Extend sqlite3.c makefile rule to support EXTRA_SRC=list-of-c-files to append to the generated sqlite3.c, as discussed in/around [forum:ccda88cf6f1754c5|forum post ccda88cf6f1754c5].

FossilOrigin-Name: 61676f1e18a405e4f3b6007488f2e68f3f55b312c107359ae5e52929f0c104c8

16 months agoAllow "_" characters to appear between any two digits in an integer, real or hexadeci...
dan [Tue, 27 Feb 2024 10:52:41 +0000 (10:52 +0000)] 
Allow "_" characters to appear between any two digits in an integer, real or hexadecimal SQL literal.

FossilOrigin-Name: 0e6700f43f133510c8049b2c5a2610cb3be29da7ed4d39b1fa65dc22c4cf529b

16 months agoBring the extra-src branch up to date with the trunk. extra-src
stephan [Tue, 27 Feb 2024 00:58:51 +0000 (00:58 +0000)] 
Bring the extra-src branch up to date with the trunk.

FossilOrigin-Name: 12ff5c5c4162951a29b638a5bc6cffa50e057c5a5e8f5e9c627af5f4ab1e4cdb

16 months agoThe quote() SQL function should convert +Inf into 9.0e+999 and -Inf into
drh [Mon, 26 Feb 2024 22:28:21 +0000 (22:28 +0000)] 
The quote() SQL function should convert +Inf into 9.0e+999 and -Inf into
-9.0e+999.  See [forum:/forumpost/6675b25108|forum post 6675b25108].

FossilOrigin-Name: 85dd79a6edecfc8c6307c6d215998f76dab086aa14528ddc64eb9955501becfd

16 months agoWhen inserting a 3-byte cell into a btree, ensure that the extra padding byte
drh [Mon, 26 Feb 2024 15:27:33 +0000 (15:27 +0000)] 
When inserting a 3-byte cell into a btree, ensure that the extra padding byte
is 0x00.  This is not necessary for security, as far as I can tell, but it
seems like a reasonable precaution.

FossilOrigin-Name: 5766f1279dab91e030d4dcf5133659e5cedf914a1628ccf00d67d8e50a9957fd

16 months agoAdd the intck extension. For performing incremental integrity-check on a database.
dan [Mon, 26 Feb 2024 12:16:02 +0000 (12:16 +0000)] 
Add the intck extension. For performing incremental integrity-check on a database.

FossilOrigin-Name: 141d8bb059f8987d05d18327b97c4d36e98258f657b41a3d4d8877fe8b4e72e3

16 months agoFix header comments on test scripts. incr-integrity-check
drh [Mon, 26 Feb 2024 11:51:21 +0000 (11:51 +0000)] 
Fix header comments on test scripts.

FossilOrigin-Name: 9fe9670c977ce7ad2c19657783a63998769dbb7741a587889c72ecc04d895793

16 months agoRemove a local variable from sqlite3IntFloatCompare() that was being optimized
drh [Mon, 26 Feb 2024 11:43:44 +0000 (11:43 +0000)] 
Remove a local variable from sqlite3IntFloatCompare() that was being optimized
out anyhow, in order to get back to 100% MC/DC.

FossilOrigin-Name: 52b13d6acbb738b9281f7dd44edd6c3c9585d22d98b1951b7059534fbd16fac0

16 months agoMerge latest trunk changes into this branch.
dan [Mon, 26 Feb 2024 10:56:54 +0000 (10:56 +0000)] 
Merge latest trunk changes into this branch.

FossilOrigin-Name: b6371ff9f5c3d4e87a5b1127a82970202f74c790b828dda20df88dd727bcc9b4

16 months agoMake sure key comprisons are done correctly if the index key contains NaN
drh [Sun, 25 Feb 2024 21:30:33 +0000 (21:30 +0000)] 
Make sure key comprisons are done correctly if the index key contains NaN
values that have not been shifted into NULLs.  That can only happen due to
database corruption, but we need to deal with it nevertheless.

FossilOrigin-Name: 7e4c743f9e6ef33500795543e6db9a77c533025bf00c2ee97abd433a3871b5a1

16 months agoAdd two GIFs that contain the feather logo.
drh [Sat, 24 Feb 2024 19:58:15 +0000 (19:58 +0000)] 
Add two GIFs that contain the feather logo.

FossilOrigin-Name: 5f21e6a8ee709d8c5ec12c45e8dc702a7d0bb041f31b5715e28cd904dfd566b0

16 months agoAdd further tests for the intck module.
dan [Sat, 24 Feb 2024 16:26:15 +0000 (16:26 +0000)] 
Add further tests for the intck module.

FossilOrigin-Name: c253e276b29de28a18270d01b60d95157ce3fc4b37e246d991f9119d26e718d7

16 months agoAdd tests for the new code on this branch.
dan [Fri, 23 Feb 2024 20:51:06 +0000 (20:51 +0000)] 
Add tests for the new code on this branch.

FossilOrigin-Name: 351d46b2373f08bc8033d0902d9f67cd6c8bcc16c0d9f787e4fb279c0a76da87

16 months agoAdd the ".intck ?STEPS_PER_UNLOCK?" command to the shell tool.
dan [Fri, 23 Feb 2024 18:21:51 +0000 (18:21 +0000)] 
Add the ".intck ?STEPS_PER_UNLOCK?" command to the shell tool.

FossilOrigin-Name: cfd051836b72f7d4e38cc9614f6ae5c003de4ce377359fd391adf06fe1ddf6b9

16 months agoTypo fixes [forum:c19bbf245d|reported in the forum]. No code changes.
stephan [Fri, 23 Feb 2024 18:02:31 +0000 (18:02 +0000)] 
Typo fixes [forum:c19bbf245d|reported in the forum]. No code changes.

FossilOrigin-Name: 67d8bae0f695c0839e724c1aadea0a22f736fdd9664d40a29b4d82c91fb89ab3

16 months agoFix detection of surplus index entries when all indexed fields are NULL.
dan [Fri, 23 Feb 2024 17:10:39 +0000 (17:10 +0000)] 
Fix detection of surplus index entries when all indexed fields are NULL.

FossilOrigin-Name: 5f310fb7be450c96f01c21e6fd1377d4a274784377d0bd811922ab63e612bd11

16 months agoFix problems with resuming integrity-check operations on indexes with mixed ASC and...
dan [Fri, 23 Feb 2024 15:13:53 +0000 (15:13 +0000)] 
Fix problems with resuming integrity-check operations on indexes with mixed ASC and DESC columns, and on indexes that contain NULL values.

FossilOrigin-Name: 0f68b35a000ef9f4691c59797c66ed6c3435fc5c503e9d24f891afec6aceeada

16 months agoFix harmless compiler warning seen with MSVC.
mistachkin [Thu, 22 Feb 2024 18:15:08 +0000 (18:15 +0000)] 
Fix harmless compiler warning seen with MSVC.

FossilOrigin-Name: e5db08993127dfc18cc2b621a13cbfef52974f0f504f4d8208093bfad1ffdcc5

16 months agoFix debugging code so that it compiles on MSVC.
drh [Thu, 22 Feb 2024 00:50:54 +0000 (00:50 +0000)] 
Fix debugging code so that it compiles on MSVC.

FossilOrigin-Name: ce5df19dc4aff3fde03ef62261a5e095a16a8f4e46e2924becea4fed56ce49e3

16 months agoFix various issues in sqlite3intck.c.
dan [Wed, 21 Feb 2024 20:58:48 +0000 (20:58 +0000)] 
Fix various issues in sqlite3intck.c.

FossilOrigin-Name: 8a7bfa74525a495f45b1ea212b1718633b637295090d514dd777f9263477d514

16 months agoFix typo in comment. [https://fossil-scm.org/forum/forumpost/cc20266bf2|Fossil forum...
drh [Wed, 21 Feb 2024 20:21:46 +0000 (20:21 +0000)] 
Fix typo in comment. [https://fossil-scm.org/forum/forumpost/cc20266bf2|Fossil forum post cc20266bf2].

FossilOrigin-Name: 7e3c46eed1290964a3e25662686c6ba1149bf8687d05719b684772e65d660c09

16 months agoSimplify the way the restart key is saved internally by the intck extension.
dan [Wed, 21 Feb 2024 19:31:00 +0000 (19:31 +0000)] 
Simplify the way the restart key is saved internally by the intck extension.

FossilOrigin-Name: 0e39962baae8a82a3021077676b792ac30c79426bcd8c075b5e92bee55e8c3a5

16 months agoAdd documentation to ext/intck/sqlite3intck.h.
dan [Wed, 21 Feb 2024 19:17:45 +0000 (19:17 +0000)] 
Add documentation to ext/intck/sqlite3intck.h.

FossilOrigin-Name: 4cc19bd74f05fe92658cc392a1d1afa173d93181a77303af6bc5684436ae832e

16 months agoEnsure intck tests are run by testrunner.tcl.
dan [Wed, 21 Feb 2024 16:15:50 +0000 (16:15 +0000)] 
Ensure intck tests are run by testrunner.tcl.

FossilOrigin-Name: 11d6816c060b6edb9cd61f29297ab95e75e2b46f29c0a796820d94fc13586f6d

16 months agoMerge trunk changes into this branch.
dan [Wed, 21 Feb 2024 16:12:23 +0000 (16:12 +0000)] 
Merge trunk changes into this branch.

FossilOrigin-Name: 63e8846ac1dc1cf1f7071c4634ccbfec3c13560db6afec376cd91515b62430d3

16 months agoHave the intck extension better handle corruption at the b-tree layer.
dan [Tue, 20 Feb 2024 20:18:02 +0000 (20:18 +0000)] 
Have the intck extension better handle corruption at the b-tree layer.

FossilOrigin-Name: ecd775d108f77d39a1303316c1e0f0b0ae3ffc5218222e1ebfe2ef6783829b85

16 months agoUse fewer cycles to generate the "next key" value used by sqlite3_intck_suspend(...
dan [Tue, 20 Feb 2024 18:17:06 +0000 (18:17 +0000)] 
Use fewer cycles to generate the "next key" value used by sqlite3_intck_suspend() function in the intck extension.

FossilOrigin-Name: 95f01426f948cf435d0b400dc7ae06fa699eee32cff498fe77e74a1257a4e09b

16 months agoConsider using "=" and IS operators with even low-quality indexes in cases where...
dan [Tue, 20 Feb 2024 16:04:27 +0000 (16:04 +0000)] 
Consider using "=" and IS operators with even low-quality indexes in cases where they are selected explicitly using an INDEXED BY clause.

FossilOrigin-Name: 43cbbea82132db2d0ddb4f34cc2b6910b3a1243ae6d4e837b1b27bfe91b84834

16 months agoFixes to comments associated with the recent PRAGMA optimize enhancements.
drh [Tue, 20 Feb 2024 15:38:36 +0000 (15:38 +0000)] 
Fixes to comments associated with the recent PRAGMA optimize enhancements.
No changes to code.

FossilOrigin-Name: 27a2113d78b35e324e9aedda7403c96c56ad0bed8c6b139fc5a179e8800b9109

16 months agoRemove an unreachable branch from printf(). Change it into an assert().
drh [Tue, 20 Feb 2024 13:11:27 +0000 (13:11 +0000)] 
Remove an unreachable branch from printf().  Change it into an assert().

FossilOrigin-Name: 4c9886b692706723f4b68f58dfef07ab19b192fd19b953917f23b55655af3e02

16 months agoRemove an unused variable from the merge in the previous check-in.
drh [Tue, 20 Feb 2024 13:10:46 +0000 (13:10 +0000)] 
Remove an unused variable from the merge in the previous check-in.

FossilOrigin-Name: 5c26bf379e18e28d800525bd03e2d5597e2f37674979302f351b99abfc064749

16 months agoEnhancements to PRAGMA optimize and ANALYZE. Add the 0x10000 flag to
drh [Tue, 20 Feb 2024 12:48:00 +0000 (12:48 +0000)] 
Enhancements to PRAGMA optimize and ANALYZE.  Add the 0x10000 flag to
PRAGMA optimize.  ANALYZE now records zero-size partial indexes in the
sqlite_stat1 table.  PRAGMA optimize looks for both growth and shrinkage
in table sizes, and uses tighter bounds (10x rather than 25x) to trigger
a re-analyze.  PRAGMA optimize automatically uses are reasonable
analysis_limit to prevent excessive runtimes.

FossilOrigin-Name: 63ef234e88857a653fa3541e80d59802ceccb806ac8296e8bae79a385b7086f7

16 months agoAnother simplification of the PRAGMA optimize logic for improved coverage. better-pragma-optimize
drh [Tue, 20 Feb 2024 12:14:07 +0000 (12:14 +0000)] 
Another simplification of the PRAGMA optimize logic for improved coverage.

FossilOrigin-Name: 6c5a0c85454e3c658e51fab611c169c034447174022eebc52fd8619b528a4765

16 months agoMinor fixes.
drh [Mon, 19 Feb 2024 23:58:26 +0000 (23:58 +0000)] 
Minor fixes.

FossilOrigin-Name: ed5afebc410e3d430e2428d35f027bffb218e5f11036a42f97b080153e89016e

16 months agoFix a minor hiccup in the computation of the number of btrees to be scanned.
drh [Mon, 19 Feb 2024 20:47:59 +0000 (20:47 +0000)] 
Fix a minor hiccup in the computation of the number of btrees to be scanned.

FossilOrigin-Name: 91302d9b2720d6b5184e1c24db55d351544adfde4b3d2ddcdc1561f79f11985a

16 months agoUse more efficient SQL to verify that indexes contain entries that match their tables.
dan [Mon, 19 Feb 2024 20:15:44 +0000 (20:15 +0000)] 
Use more efficient SQL to verify that indexes contain entries that match their tables.

FossilOrigin-Name: c01e008c28895e50b14531b2a1f3f1110aab3b54df41ebdbd416fbac7b1bba94

16 months agoIf there is no mention of a table in sqlite_stat1, use OP_Rewind to see if
drh [Mon, 19 Feb 2024 20:12:30 +0000 (20:12 +0000)] 
If there is no mention of a table in sqlite_stat1, use OP_Rewind to see if
the table is empty prior to invoking ANALYZE.

FossilOrigin-Name: 0cc93b19de597866292e0696f89fbd0e22a6cbb374678f5cc096fb889210fe3c

16 months agoIn PRAGMA optimize, scale back the analysis_limit when many different tables
drh [Mon, 19 Feb 2024 19:56:40 +0000 (19:56 +0000)] 
In PRAGMA optimize, scale back the analysis_limit when many different tables
and indexes must be scanned.

FossilOrigin-Name: 636615358aebfef80a657d09f15f608df9e64882b2aaa5574ce31a4f1c71fd70

16 months agoMerge trunk fixes into the better-optimize branch.
drh [Mon, 19 Feb 2024 18:55:32 +0000 (18:55 +0000)] 
Merge trunk fixes into the better-optimize branch.

FossilOrigin-Name: 2cf78a5b5fce7f2d49ce185d27f50722c91a1d6c91bbcecebd4bb5244a76769f

16 months agoAdd implementation of sqlite3_intck_suspend().
dan [Mon, 19 Feb 2024 18:03:53 +0000 (18:03 +0000)] 
Add implementation of sqlite3_intck_suspend().

FossilOrigin-Name: c36ada868da74e030ff5002de1f3b31b639b0c43714b91c2e5ca0eda16bb6bc2

16 months agoIf a table has one or more rows and it has a partial index has zero rows, optimize-after-shrink
drh [Mon, 19 Feb 2024 16:22:58 +0000 (16:22 +0000)] 
If a table has one or more rows and it has a partial index has zero rows,
still make an entry in the sqlite_stat1 table for the partial index, so that
we know that "PRAGMA optimize" does not need to redo the whole table.

FossilOrigin-Name: e147b18991dd462fff367442acb0504fdf193a31843ed34ec8c1ced30747bf8a

16 months agoSimplifications to PRAGMA optimize to make it easier to use. It always
drh [Mon, 19 Feb 2024 13:50:09 +0000 (13:50 +0000)] 
Simplifications to PRAGMA optimize to make it easier to use.  It always
tries to ANALYZE unanalyzed indexes.  The 0x10000 flag just makes it check
for size changes in all tables.

FossilOrigin-Name: 44ed7f4cd07a88a2fdd303a2c78e6babe01d7344b399bd2b80ed68d75a77aaa2

16 months agoChange the 0x20000 bit (use analysis limit) to 0x10, meaning that this feature
drh [Mon, 19 Feb 2024 13:06:27 +0000 (13:06 +0000)] 
Change the 0x20000 bit (use analysis limit) to 0x10, meaning that this feature
is on by default.  The default analysis limit is changed to 2000 which is
almost always sufficient for accurate analysis results.

FossilOrigin-Name: 4abd47b5917099a2f74e53e12c987da0722304a5e9a93b6d43015c1f45c48444

16 months agoExtend the strerror_r() result type discrepancy check in os_unix.c to include the...
stephan [Mon, 19 Feb 2024 12:20:46 +0000 (12:20 +0000)] 
Extend the strerror_r() result type discrepancy check in os_unix.c to include the Android NDK, as reported in [forum post 3f13857fa4062301|forum:3f13857fa4062301]. The NDK's strerror_r() signature is version-dependent, whereas this change assumes int return (POSIX semantic) across all versions.

FossilOrigin-Name: f18b2524da6bbbcf372b292df52fbe6efa49fd6e1f1f13ef2447279d559f7a08

16 months agoHold a transaction during PRAGMA optimize, for performance.
drh [Sun, 18 Feb 2024 01:12:22 +0000 (01:12 +0000)] 
Hold a transaction during PRAGMA optimize, for performance.

FossilOrigin-Name: d13b79eae6df7f9d1f3b8062ddc75a12ff038196b3d752d2672a9925fa45ca56

16 months agoAdd start of extension for incremental integrity-checks to ext/intck/.
dan [Sat, 17 Feb 2024 20:55:01 +0000 (20:55 +0000)] 
Add start of extension for incremental integrity-checks to ext/intck/.

FossilOrigin-Name: 444e3c9210026da7eae1ed98850722e002433aa2cc77dbc6b6f80327a6b7a390

16 months agoAdd new MASK bits to PRAGMA optimize: 0x70000.
drh [Sat, 17 Feb 2024 16:39:52 +0000 (16:39 +0000)] 
Add new MASK bits to PRAGMA optimize:  0x70000.

FossilOrigin-Name: dd4497062569eec9ddfdaa7d6394c83ff40a7a59c6697a161bc4ff6d8af3bb29