]> git.ipfire.org Git - thirdparty/sqlite.git/log
thirdparty/sqlite.git
2 years agoFix a race condition during hot-journal rollback that could theoretically cause spuri... pending-lock-race
dan [Tue, 31 Jan 2023 20:21:06 +0000 (20:21 +0000)] 
Fix a race condition during hot-journal rollback that could theoretically cause spurious corruption errors.

FossilOrigin-Name: 20ea53ddf590a9dd19501fabd2bfdb9c10b5eb265cd2995bdb335769c936c763

2 years agoAdditional tweaks to the enhancement at [609fbb94b8f01d67] to further reduce
drh [Mon, 30 Jan 2023 20:44:54 +0000 (20:44 +0000)] 
Additional tweaks to the enhancement at [609fbb94b8f01d67] to further reduce
the cost estimate for constructing an automatic index on an ephemeral table,
in order to resolve the performance problem described by
[forum:/forumpost/1d571c0296|forum post 1d571c0296].

FossilOrigin-Name: bf1aae7a8c7f2c74681aa29baa35259d10ce6a1737d2607def6bf27fed592131

2 years agoTwo JS file renames which got inadvertently undone while setting up [9062b31174618c0e...
stephan [Sun, 29 Jan 2023 06:01:32 +0000 (06:01 +0000)] 
Two JS file renames which got inadvertently undone while setting up [9062b31174618c0e]. Cosmetic cleanups in ext/wasm/dist.make.

FossilOrigin-Name: 0c2fde767f77d6204e95737edd573f42d72e956a3c20ea7e4daeff906657bbe5

2 years agoCorrect the handling of the worker1 and promiser JS files in the face of the bundler...
stephan [Sun, 29 Jan 2023 05:09:39 +0000 (05:09 +0000)] 
Correct the handling of the worker1 and promiser JS files in the face of the bundler-friendly changes. Those files require separate, bundler-friendly copies.

FossilOrigin-Name: 9062b31174618c0e67e86441e14eac420c734a0cc321f7eebc7d89ff8a449c10

2 years agoDo not assume that sub-queries that contain window functions are uncorrelated.
dan [Sat, 28 Jan 2023 21:06:15 +0000 (21:06 +0000)] 
Do not assume that sub-queries that contain window functions are uncorrelated.

FossilOrigin-Name: f27804484df57de76be9dbd1a9e5869916617684ee407101c978df7da30b34ac

2 years agoShow more details about the SrcItem.fg field in tree-trace output.
drh [Sat, 28 Jan 2023 21:01:33 +0000 (21:01 +0000)] 
Show more details about the SrcItem.fg field in tree-trace output.

FossilOrigin-Name: 3d05dddd0bc826a73a8cecd6b116168082fb46b6e4868d03438c0a5a546d2f97

2 years agoFix a problem causing "PRAGMA quick_check" to return spurious corruption errors for...
dan [Sat, 28 Jan 2023 17:37:37 +0000 (17:37 +0000)] 
Fix a problem causing "PRAGMA quick_check" to return spurious corruption errors for a WITHOUT ROWID for which all columns are either virtual or part of the primary key, and for which the order of the columns in the primary key definition is different from the order in the table.

FossilOrigin-Name: a7530f897127f35a212db6557edbcbbb286cc0e094754c1c1b74ce8dbf724470

2 years agoUpdate sqllimits1.test to account for the fact that if an odd value is specified...
dan [Sat, 28 Jan 2023 16:37:30 +0000 (16:37 +0000)] 
Update sqllimits1.test to account for the fact that if an odd value is specified as the length in bytes of a utf-16 string, it is truncated to the largest smaller even number.

FossilOrigin-Name: 74508470c4caff04638e750cd84073f3137b8a9f72c6fe390a279da7b1c13398

2 years agoMakefile doc touchups - no code/build changes.
stephan [Sat, 28 Jan 2023 09:51:41 +0000 (09:51 +0000)] 
Makefile doc touchups - no code/build changes.

FossilOrigin-Name: 3458a481b9ee391122dba531358d664d5219ce4a58cbce93d07df57cc64dc2c7

2 years agoOverhaul ext/wasm/GNUmakefile to consolidate what amounts to much copy/paste/slightly...
stephan [Sat, 28 Jan 2023 09:11:08 +0000 (09:11 +0000)] 
Overhaul ext/wasm/GNUmakefile to consolidate what amounts to much copy/paste/slightly-edit duplication into a single function, called once per distinctive build mode (vanilla, ESM, bundler-friendly).

FossilOrigin-Name: 168e5a93013d8650c180e19788e5f301b5d5ae8501d0ce728004fd750ca9e682

2 years agoEnhance oo1.DB.exec() to simplify returning whole result sets.
stephan [Sat, 28 Jan 2023 05:09:26 +0000 (05:09 +0000)] 
Enhance oo1.DB.exec() to simplify returning whole result sets.

FossilOrigin-Name: 7b168ee2af09f04b41a6ef4c14ccaddc0c9b0bfe9dc1e6a86d8f5317606bd78d

2 years agoAdd JS bundler-friendly JS build. Minor test code cleanups.
stephan [Sat, 28 Jan 2023 04:20:46 +0000 (04:20 +0000)] 
Add JS bundler-friendly JS build. Minor test code cleanups.

FossilOrigin-Name: 24d3a53dea5e596230558e233cbbd9d0288b4c394cd5ea7b650fd99bff4cde2e

2 years agoFix compiler warning in base85.c.
drh [Fri, 27 Jan 2023 23:10:10 +0000 (23:10 +0000)] 
Fix compiler warning in base85.c.

FossilOrigin-Name: bd9613fd63193bd6b33798d83f0ef21987ba468b53d13a25a31cb9e9e5f20562

2 years agoUpdate ext/wasm/README-dist.txt for the bundler-friendly build. js-bundler-friendly
stephan [Fri, 27 Jan 2023 20:25:39 +0000 (20:25 +0000)] 
Update ext/wasm/README-dist.txt for the bundler-friendly build.

FossilOrigin-Name: 6a5c4f6b19aa0704efe7f789102f757a1ed05d6542f37c7aa37a4439783944a3

2 years agoAdd an assert() to help static analyzers.
drh [Fri, 27 Jan 2023 20:15:48 +0000 (20:15 +0000)] 
Add an assert() to help static analyzers.

FossilOrigin-Name: e446c8b4aa2ffe075f9c289c771d62a414661c3ffe6abae5649c50af8e32fab6

2 years agoDo not try to run rbu tests with builds that do not support rbu.
dan [Fri, 27 Jan 2023 19:59:46 +0000 (19:59 +0000)] 
Do not try to run rbu tests with builds that do not support rbu.

FossilOrigin-Name: c74ad902e3bbfc28d6b30a37f3791176d64cdd8fd5950f1d1749541e244a0494

2 years agoAdd a feature idea note to DB.exec(), derived from a forum discussion.
stephan [Fri, 27 Jan 2023 19:56:40 +0000 (19:56 +0000)] 
Add a feature idea note to DB.exec(), derived from a forum discussion.

FossilOrigin-Name: 792f43209c4b6e85386b6b3906814b7f2ad310d50ba563b3fd1cb37e55adf8db

2 years agoCherrypick [3773934e91c20ca243] into trunk.
stephan [Fri, 27 Jan 2023 17:19:30 +0000 (17:19 +0000)] 
Cherrypick [3773934e91c20ca243] into trunk.

FossilOrigin-Name: 50cf4300a6a92302010fa4a7662db82bf55180a4930771f0d3c07e558bc87e7d

2 years agoExtract emcc version in JS build and use it to conditionally set build flags. Initial...
stephan [Fri, 27 Jan 2023 17:14:55 +0000 (17:14 +0000)] 
Extract emcc version in JS build and use it to conditionally set build flags. Initially a workaround for [https://github.com/emscripten-core/emscripten/issues/18610|Emscripten ticket #18610] but may have other uses.

FossilOrigin-Name: 3773934e91c20ca2433cc414aaba75de9a4a4318fd1126fb781dba510ddefd94

2 years agoWork around a JS null pointer deref which could be triggered from the dev console...
stephan [Fri, 27 Jan 2023 07:53:49 +0000 (07:53 +0000)] 
Work around a JS null pointer deref which could be triggered from the dev console, but not (it seems) from client-side code.

FossilOrigin-Name: eabb551b8b3d33fc3a327ecf7225436a3a3f616901e22c868fd76a5e3adc7b3f

2 years agoCherrypick [fa784101775b7|emscripten ticket #18609 workaround] into trunk.
stephan [Fri, 27 Jan 2023 05:17:10 +0000 (05:17 +0000)] 
Cherrypick [fa784101775b7|emscripten ticket #18609 workaround] into trunk.

FossilOrigin-Name: 9a26fae545b9c97129893b83ff97e62b1c477eccd1379af1dce4a3cc4fa9f932

2 years agoWork around upstream emscripten 3.1.31 bug [https://github.com/emscripten-core/emscri...
stephan [Fri, 27 Jan 2023 05:14:34 +0000 (05:14 +0000)] 
Work around upstream emscripten 3.1.31 bug [https://github.com/emscripten-core/emscripten/issues/18609].

FossilOrigin-Name: fa784101775b795077a23c211b5b16f51ad5a13967c284511f310dfcbfa9f77a

2 years agoMore work on creating a separate sqlite3.js build which is hopefully friendly to...
stephan [Fri, 27 Jan 2023 03:18:16 +0000 (03:18 +0000)] 
More work on creating a separate sqlite3.js build which is hopefully friendly to JS bundlers.

FossilOrigin-Name: b7b896fb448a7f46eb88eadadb1359255aec637a384cabcdd526276a02f4f0b4

2 years agoResolve a nested if-block bug in ext/wasm/c-pp.c which caused output after a nested...
stephan [Fri, 27 Jan 2023 02:21:16 +0000 (02:21 +0000)] 
Resolve a nested if-block bug in ext/wasm/c-pp.c which caused output after a nested block to be unduly elided. Remove a kludge, added in the previous check-in, which worked around that bug.

FossilOrigin-Name: 7a026a4b24d57c1b0970923b972dd42c3f1bb5b282f908079075468b2e1bf601

2 years agoBeginnings of a bundler-friendly build of sqlite3.mjs. Not yet ready for downstream...
stephan [Fri, 27 Jan 2023 01:33:12 +0000 (01:33 +0000)] 
Beginnings of a bundler-friendly build of sqlite3.mjs. Not yet ready for downstream testing.

FossilOrigin-Name: 4271bf5f41df091696f1dcfc4ffe7a60d24066fc75c896941e0b56de95fe5f89

2 years agoEnd-of-line whitespace cleanups and doc typo fixes. No code changes.
stephan [Thu, 26 Jan 2023 20:08:59 +0000 (20:08 +0000)] 
End-of-line whitespace cleanups and doc typo fixes. No code changes.

FossilOrigin-Name: bdfd72a083fadd724030c4c89adae71426e1ddd402c6bc5abf40801ecf3253cf

2 years agoHave some RBU tests run as part of veryquick.test/testrunner.tcl.
dan [Thu, 26 Jan 2023 18:16:51 +0000 (18:16 +0000)] 
Have some RBU tests run as part of veryquick.test/testrunner.tcl.

FossilOrigin-Name: f51406e3bf92f2b46f13d08fb7c7fe7683feba68b5a8fa18f6f6b8845662deac

2 years agoImproved fix to allow sqlite3_vtab_in_first() to reliably return SQLITE_ERROR.
drh [Thu, 26 Jan 2023 02:18:53 +0000 (02:18 +0000)] 
Improved fix to allow sqlite3_vtab_in_first() to reliably return SQLITE_ERROR.

FossilOrigin-Name: b25eec1c13f6a8c7ba993e5a55e26798f3b67a8b9571998459671cb570cbdfb4

2 years agoFix a harmless compiler warning in FTS3.
drh [Wed, 25 Jan 2023 21:28:30 +0000 (21:28 +0000)] 
Fix a harmless compiler warning in FTS3.

FossilOrigin-Name: 68d02d3c2ab1b4afff2d3a71516ceee404fad0d2b717369ad732832c4f9b19a8

2 years agoDefer calling the destructor for the user data on a module until after the
drh [Wed, 25 Jan 2023 19:05:04 +0000 (19:05 +0000)] 
Defer calling the destructor for the user data on a module until after the
module has disconnected.
[forum:/forumpost/b68391eb71fdff73|Forum post b68391eb71fdff73].

FossilOrigin-Name: 1ab122289fe6ac4cb3b0c47d17ac22627fcdfed80c941a57e6e6cc4d9dbd9273

2 years agoEnhance the sqlite3_vtab_in_first() and sqlite3_vtab_in_next() interfaces so
drh [Wed, 25 Jan 2023 16:56:24 +0000 (16:56 +0000)] 
Enhance the sqlite3_vtab_in_first() and sqlite3_vtab_in_next() interfaces so
that they reliably return SQLITE_ERROR (and not SQLITE_MISUSE) if they are
invoked on a parameter that did not have multi-value IN processing enabled
via a prior call to sqlite3_vtab_in().  See
[forum:/forumpost/a823d4a3d5f73def|forum thread a823d4a3d5f73def].

FossilOrigin-Name: 144326dc171025dc8b5a77bebd8de3c19d5244ab807f5aa41f95313a25b880bc

2 years agoFix a problem with fts3 auxiliary functions and one or more NEAR expressions ORed...
dan [Wed, 25 Jan 2023 15:45:45 +0000 (15:45 +0000)] 
Fix a problem with fts3 auxiliary functions and one or more NEAR expressions ORed together.

FossilOrigin-Name: de4690a10ad4631e7452ccbb05b177a821d9dda387a854d216a6c54c7a189ead

2 years agoFix another problem with fts3/4 auxiliary functions and NEAR expressions that consist...
dan [Wed, 25 Jan 2023 13:42:55 +0000 (13:42 +0000)] 
Fix another problem with fts3/4 auxiliary functions and NEAR expressions that consist entirely of deferred tokens.

FossilOrigin-Name: a8c91c132f6157b7e3649f57a799984b1d7f8a18fd434515c875617d4195db29

2 years agoAdd scalar SQL function unhex().
dan [Tue, 24 Jan 2023 20:17:43 +0000 (20:17 +0000)] 
Add scalar SQL function unhex().

FossilOrigin-Name: 890e9629a7480138c9c1d3acc2d1e7b3c05e0d156e5c5fba428bc1aeb790fbfb

2 years agoUpdate unhex() to allow a second argument, specifying a set of characters that are... unhex-function
dan [Tue, 24 Jan 2023 17:19:47 +0000 (17:19 +0000)] 
Update unhex() to allow a second argument, specifying a set of characters that are permitted to appear between pairs of hexadecimal digits.

FossilOrigin-Name: 66c8562690b19f17972589611810e1dccad3a48777acb05208289c1f77076f71

2 years agoFix a problem with using fts3 auxiliary functions with expressions like "E AND ....
dan [Tue, 24 Jan 2023 11:24:28 +0000 (11:24 +0000)] 
Fix a problem with using fts3 auxiliary functions with expressions like "E AND ...", where E is a NEAR expression that consists entirely of deferred tokens.

FossilOrigin-Name: 39bfae4c4698a13e07c4a0725f2790955e03b601fe64e17a000c691def1bdcb8

2 years agoSuppress a harmless compiler warning.
drh [Mon, 23 Jan 2023 21:41:41 +0000 (21:41 +0000)] 
Suppress a harmless compiler warning.
[forum:forumpost/e3f72e9291189925|Forum post e3f72e9291189925].  The code
was legal and correct. The revised code is actually less clear in its intent.
But at least now there will (hopefully) be no warning.

FossilOrigin-Name: 48bb7c88787bf5de1d70cf3cc81ada38c6c02e476dbdff12c8676c6d5ee19aed

2 years agoDue to a coding error, check-in [8efd61e8518594e3] did not actually use
drh [Mon, 23 Jan 2023 20:45:47 +0000 (20:45 +0000)] 
Due to a coding error, check-in [8efd61e8518594e3] did not actually use
just read transactions if the operation is read-only and the
SQLITE_MAX_ATTACHED macro is set to 31 or more.  This was due to a misuse
of the writeMask field of Parse, pointed out by
[forum:/forumpost/aa173c18d5|forum post aa173c18d5].

FossilOrigin-Name: 8760566893b64325874c7ec0aff8014026ce525e7fff1489027d2ce698495e76

2 years agoAdd the missing CARRAY_BLOB macro to the carray.h extension header.
drh [Mon, 23 Jan 2023 16:16:00 +0000 (16:16 +0000)] 
Add the missing CARRAY_BLOB macro to the carray.h extension header.

FossilOrigin-Name: 10bf639cd169147d4608918543f9a9b15417c10a231590b961c91500a1856f6e

2 years agoAdd experimental user function unhex().
dan [Mon, 23 Jan 2023 14:11:34 +0000 (14:11 +0000)] 
Add experimental user function unhex().

FossilOrigin-Name: dbe424b5db33ce2c7562dfb44daf2969cf3074234cc891eb9b8d0d907faf6a78

2 years agoGive CLI .version a place in .help output.
larrybr [Sun, 22 Jan 2023 21:54:17 +0000 (21:54 +0000)] 
Give CLI .version a place in .help output.

FossilOrigin-Name: 5f2dfdcc345453ee0a05311f6826d90b7c1d7b95fdaf77a0a8383923a8fc7213

2 years agoMinor API doc cleanups and JS code simplification.
stephan [Sat, 21 Jan 2023 16:53:01 +0000 (16:53 +0000)] 
Minor API doc cleanups and JS code simplification.

FossilOrigin-Name: f608a3a45609693c1c0237f12c394275ec9a6225fa986e62345f21af763293a0

2 years agoFix a memory leak in the TCL test harness associated with carray.
drh [Sat, 21 Jan 2023 00:59:20 +0000 (00:59 +0000)] 
Fix a memory leak in the TCL test harness associated with carray.

FossilOrigin-Name: 5a316f9fd94b73fc54ef94a1dab2f13bdd16c4fb13d2620b7c907d104d5b4d7a

2 years agoFix harmless compiler warnings.
drh [Sat, 21 Jan 2023 00:19:29 +0000 (00:19 +0000)] 
Fix harmless compiler warnings.

FossilOrigin-Name: ded60f5b3431283d70eb8c41761c0fa9727021e6309d0df0ae3fb0a5274c1299

2 years agoExtend the carray extension to allow the use of BLOB values to be bound
drh [Fri, 20 Jan 2023 21:00:03 +0000 (21:00 +0000)] 
Extend the carray extension to allow the use of BLOB values to be bound
as an array of "struct iovec" objects.

FossilOrigin-Name: e117a03ca6560e958884f277db827c51ae337a970c17143a0a5f9b150f52f87a

2 years agoTwo branches associated with memdb are now always taken (I believe). Tag
drh [Fri, 20 Jan 2023 19:19:24 +0000 (19:19 +0000)] 
Two branches associated with memdb are now always taken (I believe).  Tag
them with ALWAYS() to verify this.

FossilOrigin-Name: 20b9b5aa4fa6136059cf1123f00d86cb7bd8fb0f0f86f971e9714f22725e60b5

2 years agoEnsure that the database encoding cannot be changed while there are statements runnin...
dan [Fri, 20 Jan 2023 17:50:24 +0000 (17:50 +0000)] 
Ensure that the database encoding cannot be changed while there are statements running. And that the connection is left in a valid state after an obscure OOM within sqlite3_deserialize().

FossilOrigin-Name: a02da71f3a80dd8e817e89cdaa775c95e38c90d2471f8fec516bed086539e2c0

2 years agoAdd tests for changing the database encoding via RESET_DATABASE/VACUUM. And test...
dan [Fri, 20 Jan 2023 15:13:30 +0000 (15:13 +0000)] 
Add tests for changing the database encoding via RESET_DATABASE/VACUUM. And test that it is not possible to trick another connection with this.

FossilOrigin-Name: b869054acb8f171cbc16808eb87be85e6e38d5c5670522ff4e49aef92250d5b2

2 years agoThe json_group_array(), json_group_object(), and fts5_source_id() functions
drh [Fri, 20 Jan 2023 13:34:14 +0000 (13:34 +0000)] 
The json_group_array(), json_group_object(), and fts5_source_id() functions
should all be deterministic and innocuous.

FossilOrigin-Name: edcb83fa0d3c832d044b267d608fed31a2ac841b81c7c9406b2136ac43d61a1a

2 years agoFix numbering issue in and remove duplicate test from windowB.test.
dan [Thu, 19 Jan 2023 18:16:09 +0000 (18:16 +0000)] 
Fix numbering issue in and remove duplicate test from windowB.test.

FossilOrigin-Name: fa10e561f5dcdb23af862c2e486e877d379f12eae077ae5fd3da6028f1c20b49

2 years agoEmit sqlite3-api.(m)js during the JS build process, which are the JS APIs without...
stephan [Wed, 18 Jan 2023 17:39:04 +0000 (17:39 +0000)] 
Emit sqlite3-api.(m)js during the JS build process, which are the JS APIs without the Emscripten/wasm-loading parts. They are hypothetically useful for arbitrary build environments/toolchains but have notable caveats related to the wasm imports, as elaborated on in the makefile.

FossilOrigin-Name: 966b55c513a14c6ab3ec128cfe6d157ecd9bec32e3fce2f559f130249cec50ab

2 years agoFix another issue with very large compressed LSM databases.
dan [Tue, 17 Jan 2023 19:34:01 +0000 (19:34 +0000)] 
Fix another issue with very large compressed LSM databases.

FossilOrigin-Name: d71154265a294a1ece89d257f55f6855db7c30aec55ea0dc4eeb61bce1e8fad3

2 years agoChange an now unreachable testcase() into an assert().
drh [Tue, 17 Jan 2023 19:00:22 +0000 (19:00 +0000)] 
Change an now unreachable testcase() into an assert().

FossilOrigin-Name: 517b2c4c4ee9afc50e5457a6877e5af34358a6267d8dad669d25410c124866ac

2 years agoFix harmless compiler warnings in the CLI.
drh [Tue, 17 Jan 2023 18:40:54 +0000 (18:40 +0000)] 
Fix harmless compiler warnings in the CLI.

FossilOrigin-Name: 7cf282d307a23697b38f5fd4b46f13f63a9e6f7cc74ccd66297d88c00aa8f454

2 years agoUpdate virtual tables json_each and json_tree so that adding "ORDER BY rowid" to...
dan [Tue, 17 Jan 2023 15:46:27 +0000 (15:46 +0000)] 
Update virtual tables json_each and json_tree so that adding "ORDER BY rowid" to a query does not require an external sort.

FossilOrigin-Name: ce18f0ed684824e67ed6c09acab8e735fef2c52b2ed32270dee1a2a67802c59b

2 years agoAdd test cases to confirm that the schema parsing quirk in which an
drh [Tue, 17 Jan 2023 13:33:51 +0000 (13:33 +0000)] 
Add test cases to confirm that the schema parsing quirk in which an
ON CONFLICT clause is accepted and ignored on table CHECK constraints but
raises an error on column CHECK constraints.  We want to continue supporting
this harmless quirk to avoid breaking legacy applications and databases that
accidentally use it.

FossilOrigin-Name: 92b6a9cd0fb027fe675b3913aa07c75445bba0cfac9530d08d7e48f7869c04cc

2 years agoCause .clone to not trip over sequence table as reported at [forum:/forumpost/71ff9e6...
larrybr [Mon, 16 Jan 2023 21:49:37 +0000 (21:49 +0000)] 
Cause .clone to not trip over sequence table as reported at [forum:/forumpost/71ff9e6c4c|forum post 71ff9e6c4c].

FossilOrigin-Name: b44d04f7b051d807a81152a6e4f15a765f7b9ed1f01b48b40dc5420c11e0c251

2 years agoIn the CLI, create our own private version of strncpy() to work around
drh [Mon, 16 Jan 2023 18:13:00 +0000 (18:13 +0000)] 
In the CLI, create our own private version of strncpy() to work around
false-positive compiler warnings from Alpine Linux.

FossilOrigin-Name: 83f21285fe86430a66ce6841606e3ad7c27da52ac75a034c6a00c7a9fdb9791d

2 years agoOmit the long-disused FTS1 and FTS2 implements from the active source tree.
drh [Sat, 14 Jan 2023 19:53:42 +0000 (19:53 +0000)] 
Omit the long-disused FTS1 and FTS2 implements from the active source tree.
The code will persist forever in the source repository, but there is no point
in carrying it around in the latest tarballs where it is never used.

FossilOrigin-Name: 2bb50d5aedef0fd216d94058f477a58d88aa3a68bbadc94fa67998b7c391a8ff

2 years agoAdd OOM check, per tip at [forum:/forumpost/933479b2d5|forum post 933479b2d5]
larrybr [Sat, 14 Jan 2023 19:27:40 +0000 (19:27 +0000)] 
Add OOM check, per tip at [forum:/forumpost/933479b2d5|forum post 933479b2d5]

FossilOrigin-Name: eda84dcffee6016fb3f8588d96c7ffb6275edd626b11f6fe12e81be90226c7d8

2 years agoDoc-only fix, per [forum:/forumpost/0cfaf6876b|forum post 0cfaf6876b]
larrybr [Sat, 14 Jan 2023 19:09:26 +0000 (19:09 +0000)] 
Doc-only fix, per [forum:/forumpost/0cfaf6876b|forum post 0cfaf6876b]

FossilOrigin-Name: eac135fd6a5dd220a0f7c1b61f987bbd801faabdb76846c4417fef0dd03fcb87

2 years agoFix another lsm compression-mode bug.
dan [Fri, 13 Jan 2023 20:49:42 +0000 (20:49 +0000)] 
Fix another lsm compression-mode bug.

FossilOrigin-Name: f9fafc941370f805f6656ac13543333b36ee52f1ad44c891252b99a74bd2ddf4

2 years agoIn expression nodes of type REGISTER with sub-type COLUMN, ensure that the
drh [Fri, 13 Jan 2023 19:29:46 +0000 (19:29 +0000)] 
In expression nodes of type REGISTER with sub-type COLUMN, ensure that the
iColumn field is set correctly, as otherwise the "IS NULL" operator might
be incorrectly optimized.  Fix for the problem described by
[forum:/forumpost/d010a26798915b53|forum post d010a26798915b53].

FossilOrigin-Name: 0819a1869a39d54a405259ea323365506a182962a02affdef16a03446005da64

2 years agoAdd missing "const" on variables in recent RBU fixes.
drh [Fri, 13 Jan 2023 18:20:40 +0000 (18:20 +0000)] 
Add missing "const" on variables in recent RBU fixes.

FossilOrigin-Name: 9b8dcd79050f9bfa745271f51377b38cfed4d8ce41a36b773a30799d69f7b943

2 years agoEnhance query planning so that it check for sqlite3_interrupt() calls and
drh [Fri, 13 Jan 2023 15:54:25 +0000 (15:54 +0000)] 
Enhance query planning so that it check for sqlite3_interrupt() calls and
periodically invokes the progress handler callback (if any) during long
query analyses.

FossilOrigin-Name: bd8fa10e59f58886e10c84ea9934fa1b5f491aac2eff302757a76d2d36d59b69

2 years agoUpdate documentation for sqlite3_progress_handler(). progress-during-prepare
drh [Fri, 13 Jan 2023 15:31:24 +0000 (15:31 +0000)] 
Update documentation for sqlite3_progress_handler().

FossilOrigin-Name: 41b4c407b7f6968f4493fb9a0b220c55a6f6a353a8e6cb054efd3eb01bdd11dc

2 years agoRemove an incorrect legacy assert().
drh [Fri, 13 Jan 2023 11:31:49 +0000 (11:31 +0000)] 
Remove an incorrect legacy assert().

FossilOrigin-Name: 3006b3b32fb1efedde3ade418c19c35b6e9a4af1e6a7cb5d5c72a080ec1f6f3c

2 years agoReduce the frequency of calls to sqlite3ProgressCheck().
drh [Thu, 12 Jan 2023 20:36:43 +0000 (20:36 +0000)] 
Reduce the frequency of calls to sqlite3ProgressCheck().

FossilOrigin-Name: 795aca4a269ea4ede547844037c218ac714c40e8bee003e4d9b786befc9cf97a

2 years agoFix sqlite3_prepare() so that it only invokes the progress handler on every
drh [Thu, 12 Jan 2023 19:51:49 +0000 (19:51 +0000)] 
Fix sqlite3_prepare() so that it only invokes the progress handler on every
N-th call to sqlite3ProgressCheck(), where N is the progress handler step
count.  Also fix faulty asserts exposed by the ability to interrupt in the
middle of sqlite3_prepare().

FossilOrigin-Name: 05461651599bb490ac6cfd893645dabab9cccedc6adcce15aee2487b2ea6027a

2 years agoDo not attempt to run new test file rbupass.test if the "demo" VFS is not available.
dan [Thu, 12 Jan 2023 19:28:34 +0000 (19:28 +0000)] 
Do not attempt to run new test file rbupass.test if the "demo" VFS is not available.

FossilOrigin-Name: c5d958eb942a8d6ea1e6e1d2d57637f9359d518965a28f298c7fbacdb9080f59

2 years agoAvoid crashing when using an RBU VFS with a version 1 parent VFS.
dan [Thu, 12 Jan 2023 19:11:41 +0000 (19:11 +0000)] 
Avoid crashing when using an RBU VFS with a version 1 parent VFS.

FossilOrigin-Name: d149772d18c47bf986decb7e08d148b1d417bbcc8522fd6240ead836ec34074b

2 years agoWhen deleting any old OAL file before starting an RBU update or vacuum, use the same...
dan [Thu, 12 Jan 2023 17:13:44 +0000 (17:13 +0000)] 
When deleting any old OAL file before starting an RBU update or vacuum, use the same VFS as will be used for the target database, even if this is not the system default.

FossilOrigin-Name: 5a86c6cb1f16a15bdbc42544b8ed1912d9e87f04c514b8481a77442fbbd8accf

2 years agoAttempt to provide a mechanism to do early termination of long-running
drh [Thu, 12 Jan 2023 13:25:48 +0000 (13:25 +0000)] 
Attempt to provide a mechanism to do early termination of long-running
statement preparation by invoking the progress handler at strategic points
during sqlite3_parpare().  This experiment shows that sqlite3_prepare() might
leave the resulting prepared statement uninitialized following an interrupt.

FossilOrigin-Name: 79636f2d80aee70832913a78933da2a7e30cc037810b93903ebbc1925ea93fef

2 years agoFix duplicate semicolon in btreeInt.h.
drh [Wed, 11 Jan 2023 20:52:15 +0000 (20:52 +0000)] 
Fix duplicate semicolon in btreeInt.h.
[forum:/forumpost/8db1711ca2|Forum post 8db1711ca2]

FossilOrigin-Name: 7526c46632578a2b602622b9debc406b52af4a42cc880970c4307d13853d59d3

2 years agoFix a false-positive in the out-of-range jump detection logic that was
drh [Wed, 11 Jan 2023 17:59:18 +0000 (17:59 +0000)] 
Fix a false-positive in the out-of-range jump detection logic that was
added as part of RIGHT JOIN.

FossilOrigin-Name: ab5bcb91cda45576ae9f3f272ec92eb3be3c26436a440ebb89f51f49c42e0fd2

2 years agoIf OP_Rewind has P2 of zero, that is an assertion that the table is never code-generator-20230111
drh [Wed, 11 Jan 2023 17:50:24 +0000 (17:50 +0000)] 
If OP_Rewind has P2 of zero, that is an assertion that the table is never
empty.  This fixes a false-positive in the out-of-subroutine jump detection
logic added in version 3.39.0, and which was causing the assertion on the
previous check-in.

FossilOrigin-Name: 33fd9997ebb88f0d78522c036e75aef08015d31d28b1cbee08ae7c4cd5ecc6aa

2 years agoAdd an assert() to the byte-code engine that goes off if the OP_Halt opcode
drh [Wed, 11 Jan 2023 16:44:57 +0000 (16:44 +0000)] 
Add an assert() to the byte-code engine that goes off if the OP_Halt opcode
is invoked with SQLITE_INTERNAL.  This causes the RIGHT JOIN error
"Opcode jumps to ... which is outside the subroutine ..." to fail immediately,
causing it to come more readily to tester's attention.  There is at least
one testcase in test/fuzzdata8.db that asserts due to this change.

FossilOrigin-Name: b8f994414285264f4f7c472dfad646a061fc3580b754eac0f20080c24ecc256d

2 years agoFix problems with compressed LSM databases larger than 2GiB.
dan [Wed, 11 Jan 2023 16:25:55 +0000 (16:25 +0000)] 
Fix problems with compressed LSM databases larger than 2GiB.

FossilOrigin-Name: f884224578e549c7a15cd710e351c675631bd8939bd1d353b4337dcf4144c868

2 years agoImproved progress-handler and interrupt detection during PRAGMA integrity_check.
drh [Wed, 11 Jan 2023 16:17:31 +0000 (16:17 +0000)] 
Improved progress-handler and interrupt detection during PRAGMA integrity_check.

FossilOrigin-Name: 6db42780a9e530bcc94490cc6080536309666dc13523272d1799d6661137e908

2 years agoFix another 64-bit offset problem in lsm. lsm-compress-fixes
dan [Wed, 11 Jan 2023 16:02:20 +0000 (16:02 +0000)] 
Fix another 64-bit offset problem in lsm.

FossilOrigin-Name: 1f3d0bdc20aa74a595f7bb7b2c152259a9d3a8ffbe7cc229c57ad2142df5376d

2 years agoAdd a new sqlite3_is_interrupted() interface that can be used by long-running
drh [Wed, 11 Jan 2023 00:27:06 +0000 (00:27 +0000)] 
Add a new sqlite3_is_interrupted() interface that can be used by long-running
app-defined functions and similar to see if they need to exit early due to
an sqlite3_interrupt() call.

FossilOrigin-Name: d030f341369b7f32789cbcf3d0ad9a2ac5cad99a56dac7dfe68b7f06dc339b17

2 years agoWhen computing the datatypes for columns in a view, use the same datatype name
drh [Tue, 10 Jan 2023 19:57:26 +0000 (19:57 +0000)] 
When computing the datatypes for columns in a view, use the same datatype name
as the underlying table if such is available and is consistent with
the computed affinity of the column.
[forum:/forumpost/7fb1fe9dcf310ef5|Forum thread 7fb1fe9dcf310ef5].

FossilOrigin-Name: 497a98363fd1ed079544620ec5d0883f987ed03013131542741c93d7568e8568

2 years agoFix handling of unix paths that contain ".." components such that "/" is considered...
dan [Tue, 10 Jan 2023 15:07:18 +0000 (15:07 +0000)] 
Fix handling of unix paths that contain ".." components such that "/" is considered its own parent directory.

FossilOrigin-Name: b829dd1b976454619ca04c69aec5ebb5a2286772f4267b82ab2ea5fdb81ccd41

2 years agoImprovements to the SQLITE_DIRECTONLY documentation.
drh [Tue, 10 Jan 2023 14:33:26 +0000 (14:33 +0000)] 
Improvements to the SQLITE_DIRECTONLY documentation.

FossilOrigin-Name: b277ba40a8b0acea15bd73036d1c86fb5187f047ec8500ebc88c738ea3dbd118

2 years agoFix handling of unix paths that contain ".." components such that "/" is considered... unix-path-fix
dan [Tue, 10 Jan 2023 14:31:56 +0000 (14:31 +0000)] 
Fix handling of unix paths that contain ".." components such that "/" is considered its own parent directory.

FossilOrigin-Name: 3c6cadb396de3981bd950eddd532daa8134bd4bf22c578620e323835c96a8500

2 years agoFix some problems with large, compressed, lsm databases.
dan [Mon, 9 Jan 2023 21:10:42 +0000 (21:10 +0000)] 
Fix some problems with large, compressed, lsm databases.

FossilOrigin-Name: 956e985ff9bf8f21a048e49f7190bcc52ec4a7d35ecd685b0a293a01c9777a96

2 years agoClarify help for .quit.
larrybr [Mon, 9 Jan 2023 18:42:28 +0000 (18:42 +0000)] 
Clarify help for .quit.

FossilOrigin-Name: 8004a2b7439748f1034df897af7b6c58b48a46923c6fdddbe7d78c89b8d7b438

2 years agoFix JSON functions so that they work correctly under PRAGMA trusted_schema.
drh [Mon, 9 Jan 2023 12:01:30 +0000 (12:01 +0000)] 
Fix JSON functions so that they work correctly under PRAGMA trusted_schema.
[forum:/forumpost/c88a671ad083d153|Forum thread c88a671ad083d153].

FossilOrigin-Name: 51a5d83c425d2e31508b73074d0076156817afb19003f847d16bf4a69ae5077b

2 years agoDoc-only update, sqlite3_preupdate_hook() return
larrybr [Sat, 7 Jan 2023 22:28:00 +0000 (22:28 +0000)] 
Doc-only update, sqlite3_preupdate_hook() return

FossilOrigin-Name: 2da51d7e1b9f16ef03efbb096ce2a84e8c23b883380f48b2d374bdc521865aeb

2 years agoAccount for read-only connections on databases with non-default block or page sizes.
dan [Sat, 7 Jan 2023 13:40:32 +0000 (13:40 +0000)] 
Account for read-only connections on databases with non-default block or page sizes.

FossilOrigin-Name: 3a2075b089ecdb4b55243235dfabf466ea7999c2118aa8f58300925fb75c884e

2 years agoChanges a testcase() into an assert() due to the
drh [Thu, 5 Jan 2023 14:41:18 +0000 (14:41 +0000)] 
Changes a testcase() into an assert() due to the
[e58bba93717cd6ff] change.

FossilOrigin-Name: a6251d72894f9c2e21fc6e91b1d2452a204952f5e1a94fd93835a47c7dfb9be3

2 years agoFix a problem with applying integer affinity to a MEM_IntReal value. Forum post ...
dan [Thu, 5 Jan 2023 13:35:23 +0000 (13:35 +0000)] 
Fix a problem with applying integer affinity to a MEM_IntReal value. Forum post [forum:/forumpost/d270125fae|forum post d270125fae].

FossilOrigin-Name: e58bba93717cd6ff950c6f9e077b4327b59b1956dd5f6668be3de9509584b8fe

2 years agoIn the zipvfile extension (which is not part of the SQLite amalgamation, but
drh [Thu, 5 Jan 2023 01:26:58 +0000 (01:26 +0000)] 
In the zipvfile extension (which is not part of the SQLite amalgamation, but
which is included in the CLI by default) ensure that fopen() is not invoked
using a NULL filename.  Fix for the issue reported by
[forum:/forumpost/d1c96a9032e564f8|forum post d1c96a9032e564f8].

FossilOrigin-Name: d32757ddf5d311b6f62545c861fd606244e03f02cb2e317c1131ee6b80c2299c

2 years agoAdjustements to the tool/warnings.sh script to account for compiler
drh [Wed, 4 Jan 2023 18:32:14 +0000 (18:32 +0000)] 
Adjustements to the tool/warnings.sh script to account for compiler
differences.

FossilOrigin-Name: 863c03bee117e81bcea8c3ae78bf125afc7750aa5bcb89e42ee66d9c8b6ddc29

2 years agoEnsure that LIMIT clauses may be passed through to virtual table implementations...
dan [Wed, 4 Jan 2023 17:46:29 +0000 (17:46 +0000)] 
Ensure that LIMIT clauses may be passed through to virtual table implementations even if the WHERE clause uses operators that may only be optimized by virtual, not built-in, tables (!=, functions, MATCH etc.).

FossilOrigin-Name: f38caab23bcef1df02618376de22d208a3333d023628cde310345505933329f1

2 years agoEmploy deliberate_fall_through macro to quiet some compilers.
larrybr [Wed, 4 Jan 2023 16:54:55 +0000 (16:54 +0000)] 
Employ deliberate_fall_through macro to quiet some compilers.

FossilOrigin-Name: 869635fb81e0868dee80ce77653a2c1d2af41b3ffbf0a3f7b788ac99dc808887

2 years agoEnhance PRAGMA integrity_check so that it verifies that the string values
drh [Wed, 4 Jan 2023 15:18:52 +0000 (15:18 +0000)] 
Enhance PRAGMA integrity_check so that it verifies that the string values
stored in indexes are byte-for-byte identical to the values in the table, and
not just equivalent according to the collating sequence.
dbsqlfuzz 686e2e205e0c0594d3fb524bea0c25e621d1a870.

FossilOrigin-Name: 9302e4bfdce5905576b8f0af7d6b3a864e1dcd58ed89bb303010a1c4f826e915

2 years agoRemove the unused "sqlite3StackAllocZero()" macro.
drh [Wed, 4 Jan 2023 11:58:36 +0000 (11:58 +0000)] 
Remove the unused "sqlite3StackAllocZero()" macro.

FossilOrigin-Name: f0ca57207e9f3ab401264498f65c249b479d9e0da7158e001b002584ac67dd0a

2 years agoElaborate on the open-in-read-only fallback behavior of the SQLITE_OPEN_READWRITE...
stephan [Wed, 4 Jan 2023 11:57:27 +0000 (11:57 +0000)] 
Elaborate on the open-in-read-only fallback behavior of the SQLITE_OPEN_READWRITE flag, per user request. Unrelated trailing EOL whitespace cleanups.

FossilOrigin-Name: 1003144fc192e1531e1bc968d7e1d0ccc7ad31e501180f90e1479565a4abfb96

2 years agoRemove the JS-side SQLITE_WASM_DEALLOC sanity check which triggers the problem mentio...
stephan [Wed, 4 Jan 2023 03:14:06 +0000 (03:14 +0000)] 
Remove the JS-side SQLITE_WASM_DEALLOC sanity check which triggers the problem mentioned in [688c5c13d156] and [ae0196d86ee8], for reasons covered in the code comments, per discussion in [forum:e5b20e1feb|forum post e5b20e1feb].

FossilOrigin-Name: 65ff3200c6009a1649fc108d7ce36f5c014185ba46bbf98471ec86eaeb572656