]> git.ipfire.org Git - thirdparty/sqlite.git/log
thirdparty/sqlite.git
19 months agoFurther tests for the new code on this branch.
dan [Tue, 5 Dec 2023 18:36:23 +0000 (18:36 +0000)] 
Further tests for the new code on this branch.

FossilOrigin-Name: 59d008b6c23ab900377bc696ee19381feb7614bac80546eae361e401c3620c4e

19 months agoAdd further tests for xInstToken().
dan [Mon, 4 Dec 2023 19:48:08 +0000 (19:48 +0000)] 
Add further tests for xInstToken().

FossilOrigin-Name: 8582707f16133f003a6687f68cbea03d4eb6c2a0e2e07746b7cace0c44e84fa4

19 months agoFixes for xInstToken() with tokendata=0 tables. And with prefix queries.
dan [Mon, 4 Dec 2023 18:45:14 +0000 (18:45 +0000)] 
Fixes for xInstToken() with tokendata=0 tables. And with prefix queries.

FossilOrigin-Name: 78fbb71598b1ca756acc078253880a1d0f7983a5a26b9efc683e6488122505a1

19 months agoFix memory leak in new code on this branch.
dan [Mon, 4 Dec 2023 17:58:56 +0000 (17:58 +0000)] 
Fix memory leak in new code on this branch.

FossilOrigin-Name: ebc160b9a05568df66f86e30804399ee29d34b44a60c57e062f98cb92826353f

19 months agoFix a problem with the xInstCount() API and "ORDER BY rank" queries.
dan [Mon, 4 Dec 2023 17:45:33 +0000 (17:45 +0000)] 
Fix a problem with the xInstCount() API and "ORDER BY rank" queries.

FossilOrigin-Name: 317a50563d9e8586fda136e513727241b414e7267d50a06571c8ebd0eae710bc

19 months agoFix bug in xInstToken() causing the wrong token to be returned.
dan [Mon, 4 Dec 2023 17:05:37 +0000 (17:05 +0000)] 
Fix bug in xInstToken() causing the wrong token to be returned.

FossilOrigin-Name: da78d07e77cbc783fbc725758911c230fd6a1c1885d9576125de955dcc2bd37f

19 months agoAdd tests for using tokendata=1 and contentless_delete=1 together.
dan [Mon, 4 Dec 2023 15:08:21 +0000 (15:08 +0000)] 
Add tests for using tokendata=1 and contentless_delete=1 together.

FossilOrigin-Name: a2506b8c9718054912270055638204753c4156bbc115e55194e6df9d7e76cb10

19 months agoFix various compiler warnings and other problems with the new code on this branch.
dan [Sat, 2 Dec 2023 20:35:04 +0000 (20:35 +0000)] 
Fix various compiler warnings and other problems with the new code on this branch.

FossilOrigin-Name: 3a623cfa173b4035c759cb84985d11d8727053beb383648503987d6ab15c0ef0

19 months agoWhen tokendata=1 queries require multiple segment-cursors, allow those cursors to...
dan [Sat, 2 Dec 2023 18:14:07 +0000 (18:14 +0000)] 
When tokendata=1 queries require multiple segment-cursors, allow those cursors to share a single array of in-memory tombstone pages.

FossilOrigin-Name: e0175d07e4094db5ea4b0378a5ff480dafb6ba9da86a113fa767c4c89c3c866f

19 months agoEnsure that tokendata=1 queries avoid loading large doclists for queries like "common...
dan [Sat, 2 Dec 2023 17:32:16 +0000 (17:32 +0000)] 
Ensure that tokendata=1 queries avoid loading large doclists for queries like "common AND uncommon", just as tokendata=0 queries do.

FossilOrigin-Name: 7bda09ab404a110d57449e149a3281fca8dc4cacf7bd9832ea2a1356ad20fe8e

19 months agoRemove old code for tokendata=1 queries.
dan [Fri, 1 Dec 2023 20:37:11 +0000 (20:37 +0000)] 
Remove old code for tokendata=1 queries.

FossilOrigin-Name: b0a489e8e1bf0290c2117ab32d78b1cc7d67bcb226b55ec044c8367ebde3815b

19 months agoMerge latest trunk with this branch.
dan [Fri, 1 Dec 2023 20:10:20 +0000 (20:10 +0000)] 
Merge latest trunk with this branch.

FossilOrigin-Name: 8258967411d3ff212424b25fec79ded0d8ae83e773cd35a0bbf300c94923f25b

19 months agoDifferent approach to querying a tokendata=1 table. Saves cpu and memory.
dan [Fri, 1 Dec 2023 20:09:59 +0000 (20:09 +0000)] 
Different approach to querying a tokendata=1 table. Saves cpu and memory.

FossilOrigin-Name: c523f40895866e6fc979a26483dbea8206126b4bbdf4b73b77263c09e13c855e

20 months agoAdd a basic batch-mode SQL runner for the SAH Pool VFS, for use in comparing it again...
stephan [Thu, 30 Nov 2023 20:34:24 +0000 (20:34 +0000)] 
Add a basic batch-mode SQL runner for the SAH Pool VFS, for use in comparing it against WebSQL. Bring the WebSQL batch runner up to date, noting that it cannot run without addition of an "origin trial" activation key from Google because that's now the only way to enable WebSQL in Chrome (that part is not checked in because that key is private). Minor code-adjacent cleanups.

FossilOrigin-Name: 883990e7938c1f63906300a6113f0fadce143913b7c384e8aeb5f886f0be7c62

20 months agoNew JSON test cases showing insert or set with missing substructure.
drh [Thu, 30 Nov 2023 16:16:10 +0000 (16:16 +0000)] 
New JSON test cases showing insert or set with missing substructure.

FossilOrigin-Name: 6802b6459d0d16c961ff41d240a6c88287f197d8f609090f79308707490a49c2

20 months agoUpdate some OPFS-related help text in WASM tests. Minor cleanups in speedtest1-worker.js.
stephan [Thu, 30 Nov 2023 10:00:25 +0000 (10:00 +0000)] 
Update some OPFS-related help text in WASM tests. Minor cleanups in speedtest1-worker.js.

FossilOrigin-Name: 263f6d3a7784ef7d032dbf7a3265aca8dd70bf50797f28f6b2e8ddb6a301f83a

20 months agoFix signed integer overflow in fts5.
dan [Wed, 29 Nov 2023 16:22:39 +0000 (16:22 +0000)] 
Fix signed integer overflow in fts5.

FossilOrigin-Name: 60e46c7ec68fd8caaed960ca06d98fb06855b2d0bb860dd2fb7b5e89a5e9c7b4

20 months agoIn the recovery extension, if a payload size is unreasonably large, it is
drh [Wed, 29 Nov 2023 13:47:46 +0000 (13:47 +0000)] 
In the recovery extension, if a payload size is unreasonably large, it is
probably corrupt, so truncate it.

FossilOrigin-Name: 988c3179e978a3a6d42541e9c7a2ab98150383671810926503376ed808f150ff

20 months agoThe assertion change at check-in [7946c79567b0ccd3] is insufficient to fix
drh [Wed, 29 Nov 2023 02:45:09 +0000 (02:45 +0000)] 
The assertion change at check-in [7946c79567b0ccd3] is insufficient to fix
the problem of a Table object being deleted out from under the OP_VCheck
opcode.  We need to reference count the Table, which is accomplished here.

FossilOrigin-Name: cad269d5e274443c39203a56603b991accc0399135d436996fc039d1d28ec9db

20 months agoMerge latest trunk updates into this branch.
dan [Tue, 28 Nov 2023 19:43:08 +0000 (19:43 +0000)] 
Merge latest trunk updates into this branch.

FossilOrigin-Name: 554fc13f2ca5f2ebd9ad0206034c25b556ff40db3106051c5e539f2e142e88ea

20 months agoIn SQLITE_ENABLE_SETLK_TIMEOUT builds, use blocking locks in place of sleep() calls...
dan [Tue, 28 Nov 2023 17:12:42 +0000 (17:12 +0000)] 
In SQLITE_ENABLE_SETLK_TIMEOUT builds, use blocking locks in place of sleep() calls when opening a read-transaction.

FossilOrigin-Name: 4c055b7a6e4533e1e571773456226ca7038ce372df3eedbbbcd9a81e8652a6cf

20 months agoHandle an SQLITE_BUSY_TIMEOUT error if one occurs while attempting a shared lock... blocking-dms-lock
dan [Tue, 28 Nov 2023 15:29:04 +0000 (15:29 +0000)] 
Handle an SQLITE_BUSY_TIMEOUT error if one occurs while attempting a shared lock on a read-lock slot.

FossilOrigin-Name: 5fbf3906d272df3eb981f67455eb35f649ad2774cba9fc3f077b28d9bef3f0cb

20 months agoHave SQLITE_ENABLE_SETLK_TIMEOUT builds block when locking a read-lock slot.
dan [Mon, 27 Nov 2023 20:37:03 +0000 (20:37 +0000)] 
Have SQLITE_ENABLE_SETLK_TIMEOUT builds block when locking a read-lock slot.

FossilOrigin-Name: f797baf47cf7859cfd8ce248f4f3087af4551a7040af990333426e5a7c269504

20 months agoIn SQLITE_ENABLE_SETLK_TIMEOUT builds, use blocking locks in place of sleep() when...
dan [Mon, 27 Nov 2023 19:22:50 +0000 (19:22 +0000)] 
In SQLITE_ENABLE_SETLK_TIMEOUT builds, use blocking locks in place of sleep() when opening a read-transaction.

FossilOrigin-Name: a51ef39998e25e86bd0600e71d15011b12e05f4319608018293bdaecb09e8c97

20 months agoAdd the --buildonly and --dryrun options to testrunner.tcl.
dan [Fri, 24 Nov 2023 20:14:18 +0000 (20:14 +0000)] 
Add the --buildonly and --dryrun options to testrunner.tcl.

FossilOrigin-Name: a0c87ae9d3db914d18e2c8811db0d0ae3ad7b15c63de84fa975efce28bace27e

20 months agoAllow a pattern to filter test scripts to be appended to testrunner.tcl "mdevtest...
dan [Fri, 24 Nov 2023 18:33:40 +0000 (18:33 +0000)] 
Allow a pattern to filter test scripts to be appended to testrunner.tcl "mdevtest", "sdevtest" and "release" commands. e.g. "tclsh test/testrunner.tcl sdevtest fts5%".

FossilOrigin-Name: f8ea0b58b37f4052ded448e595d6d2992988a33b8ecfe58d68f20532f8cb5a37

20 months agoGet all CLI print calls which went to stdout in 3.44.0 to continue going to stdout.
larrybr [Fri, 24 Nov 2023 15:58:14 +0000 (15:58 +0000)] 
Get all CLI print calls which went to stdout in 3.44.0 to continue going to stdout.

FossilOrigin-Name: e9951ede184ce07cf725152723d795f299922460715ab76225cd3071bf0f18ee

20 months agoOmit the precompiled binary from the source tree.
drh [Fri, 24 Nov 2023 14:01:56 +0000 (14:01 +0000)] 
Omit the precompiled binary from the source tree.

FossilOrigin-Name: 4ff103d294b79cf7734e87e94e9d88c0e9f0b087cbb352e6da2f0a3a6b268f46

20 months agoCLI .output/.once to not redirect ".timer on" results.
larrybr [Fri, 24 Nov 2023 13:26:42 +0000 (13:26 +0000)] 
CLI .output/.once to not redirect ".timer on" results.

FossilOrigin-Name: ce766ed51f772a960d0b7a52c113b55c7ae90ef35050496d8e2a77547eab1a4d

20 months agoFix an fts5 problem that could occur when mixing regular and secure delete operations...
dan [Thu, 23 Nov 2023 11:18:06 +0000 (11:18 +0000)] 
Fix an fts5 problem that could occur when mixing regular and secure delete operations on a single table.

FossilOrigin-Name: 8eb3f40021994f0d25ef9d246873796c84886e5951bb8ab991e1e2df31998484

20 months agoFix output redirect bug reported in [forum:/forumposts/cbf4933cfeee74bb|the forum].
larrybr [Thu, 23 Nov 2023 07:08:49 +0000 (07:08 +0000)] 
Fix output redirect bug reported in [forum:/forumposts/cbf4933cfeee74bb|the forum].

FossilOrigin-Name: ce542fee6f0150bbd13505dcd26b21a9d1d23eb2dc8e78e63f9da6b4298ec028

20 months agoMinor doc fix in src/betreeInt.h, prompted by an email report. No code changes.
stephan [Wed, 22 Nov 2023 22:59:28 +0000 (22:59 +0000)] 
Minor doc fix in src/betreeInt.h, prompted by an email report. No code changes.

FossilOrigin-Name: 30d49aaed20454fe006e2f89db58f0c0b2433c99b2676a0b9583f56b7adb7fdb

20 months agoFor CLI build with unused function warnings on, #ifdef out a console I/O function...
larrybr [Wed, 22 Nov 2023 21:24:50 +0000 (21:24 +0000)] 
For CLI build with unused function warnings on, #ifdef out a console I/O function, fPutbUtf8().

FossilOrigin-Name: da36f90d94b3b55de71aa7965421ea850ac677e9e63d60744633c4dc59448de4

20 months agoAdd documentation for new fts5 auxiliary function APIs.
dan [Wed, 22 Nov 2023 21:15:05 +0000 (21:15 +0000)] 
Add documentation for new fts5 auxiliary function APIs.

FossilOrigin-Name: 9be8969edd49e3da96fb8ac2279aff6fe2e215d6ac55162b4734aca1b6316580

20 months agoDefer building xInstToken() hash-table until it is to be used.
dan [Wed, 22 Nov 2023 20:02:55 +0000 (20:02 +0000)] 
Defer building xInstToken() hash-table until it is to be used.

FossilOrigin-Name: 9b005085ff4a53cda0a1dff0c836630d6d3b95b9c40658ffd2a886f3e1b37faa

20 months agoFix tokendata=1 and xInstToken() APIs for detail=none and detail=column tables.
dan [Wed, 22 Nov 2023 19:02:54 +0000 (19:02 +0000)] 
Fix tokendata=1 and xInstToken() APIs for detail=none and detail=column tables.

FossilOrigin-Name: 37b271c19d772bd06524db816ded03377b426efed7a7783c8a96f6fb156ecd86

20 months agoCorrect the URL for loading sqlite3-worker1-bundler-friendly.mjs from sqlite3-worker1...
stephan [Wed, 22 Nov 2023 17:11:39 +0000 (17:11 +0000)] 
Correct the URL for loading sqlite3-worker1-bundler-friendly.mjs from sqlite3-worker1-promiser-bundler-friendly.js, so that the promiser can be used in bundler-using environments. Problem reported via email.

FossilOrigin-Name: 753a75218913c3b9c7ec5438387107369c34d1775d68b04d19ae18197e558605

20 months agoMerge console I/O changes for Windows CLI.
larrybr [Tue, 21 Nov 2023 18:26:06 +0000 (18:26 +0000)] 
Merge console I/O changes for Windows CLI.

FossilOrigin-Name: 935a8a8ee76d0014df42c1480e044fd1c2dfc26e78abb587d99d861d2ae5eb27

20 months agoSync w/trunk as pre-merge-to-trunk sanity check.
larrybr [Tue, 21 Nov 2023 15:55:31 +0000 (15:55 +0000)] 
Sync w/trunk as pre-merge-to-trunk sanity check.

FossilOrigin-Name: 448d6a1182d29940d5d34be2ce67df5601b688cd902dbbe97e95073f982a49ce

20 months agoFix the trace3-4.4 test to be more rebust against timing quirks.
drh [Tue, 21 Nov 2023 12:02:04 +0000 (12:02 +0000)] 
Fix the trace3-4.4 test to be more rebust against timing quirks.

FossilOrigin-Name: 8936daa08243729d8538bb7288bbefb43f3bd842a0d4b2e8019092f5701c2926

20 months agoBack out an incorrect change to the sqlite3ExprCompareSkip() function that
drh [Mon, 20 Nov 2023 15:54:00 +0000 (15:54 +0000)] 
Back out an incorrect change to the sqlite3ExprCompareSkip() function that
was added way back on 2019-08-22 for [44578865fa7baf97|check-in 44578865fa7ba]
and which was only today discovered to be incorrect by
[forum:/forumpost/45ec3d9788|forum post 45ec3d9788].

FossilOrigin-Name: f5b3eb0fc8936ba274a7654ff6dfa7d4654bd8dbca7f3a5ec1134b0b5260d59d

20 months agoConvert an assert in OP_VCheck into a branch that aborts the opcode, as this
drh [Mon, 20 Nov 2023 13:06:59 +0000 (13:06 +0000)] 
Convert an assert in OP_VCheck into a branch that aborts the opcode, as this
can happen on some very obscure conditions, as discovered by dbsqlfuzz.
Test case in TH3.

FossilOrigin-Name: 7946c79567b0ccd3a00d12390e99896d7dc11407d0b52bc39338a16a493f56f6

20 months agoFix an assert() in fts5 that could be true following an OOM or IO error in contentles...
dan [Mon, 20 Nov 2023 11:40:18 +0000 (11:40 +0000)] 
Fix an assert() in fts5 that could be true following an OOM or IO error in contentless-delete mode.

FossilOrigin-Name: 3fe89238c31ca163d021ef1fecde594328815aaba7053fef9e9c789562a62f45

20 months agoCherrypick shell1.test fix.
larrybr [Mon, 20 Nov 2023 00:21:24 +0000 (00:21 +0000)] 
Cherrypick shell1.test fix.

FossilOrigin-Name: 91c888eddbcb1b461f7d562c2f0eee57f1a2be7f9959b9d69e80fc7c1da20e9e

20 months agoCherrypick shell1.test fix.
larrybr [Mon, 20 Nov 2023 00:20:56 +0000 (00:20 +0000)] 
Cherrypick shell1.test fix.

FossilOrigin-Name: 39e30c5f9cc6dcac003255734e3ce1ac5b05349ea1a25e1c108b5f6d1d97612b

20 months agoCorrect conditional compilation issue seen with MSVC in the Win32 mutex subsystem.
mistachkin [Sat, 18 Nov 2023 18:36:26 +0000 (18:36 +0000)] 
Correct conditional compilation issue seen with MSVC in the Win32 mutex subsystem.

FossilOrigin-Name: 6f8f4bfe607f1405d313bb88a33490621002f63e8c02c980f4c083630ad3a6d2

20 months agoWhen ENABLE_SETLK is defined, avoid ever blocking on the lock mutex in os_unix.c...
dan [Sat, 18 Nov 2023 17:20:04 +0000 (17:20 +0000)] 
When ENABLE_SETLK is defined, avoid ever blocking on the lock mutex in os_unix.c when requesting an exclusive lock.

FossilOrigin-Name: eb36d475e91bfdbf4a18b6fd9751fbcecf15d960dcd1c00d2d18b5bf1d7503fe

20 months agoAdjust an assert() in fts5WritePoslistData() so that it only applies if there
drh [Sat, 18 Nov 2023 12:06:21 +0000 (12:06 +0000)] 
Adjust an assert() in fts5WritePoslistData() so that it only applies if there
have been no prior errors.
dbsqlfuzz 25dca9b2568f67dc78a0e32ff280133fe71994bd.

FossilOrigin-Name: 257cdbab90c6db8ccc9a8fd5df556b69c3a35a329d39cd4642c792d7359a54a5

20 months agoAnother assertion fault fix, similar to [a9443dbfbe25e588]. dbsqlfuzz
drh [Sat, 18 Nov 2023 11:23:01 +0000 (11:23 +0000)] 
Another assertion fault fix, similar to [a9443dbfbe25e588].  dbsqlfuzz
2d9af4e94aca188e0092900eec711401c5d51687.

FossilOrigin-Name: 3afaeac56dff58db596360bf6f8dca97cb31405f73be8e189e8c0e6a1e5b239d

20 months agoWhen SQLITE_ENABLE_SETLK_TIMEOUT is defined, use a separate mutex in os_unix.c for...
dan [Fri, 17 Nov 2023 19:01:38 +0000 (19:01 +0000)] 
When SQLITE_ENABLE_SETLK_TIMEOUT is defined, use a separate mutex in os_unix.c for each shm locking slot.

FossilOrigin-Name: 64691df980cdf73ddc00aabe15baa6c018e1d76b0e87f55ab33a9348fd5680bd

20 months agoAdd the new "run-fuzzcheck" target on the autoconf unix makefile. Requires
drh [Fri, 17 Nov 2023 17:55:03 +0000 (17:55 +0000)] 
Add the new "run-fuzzcheck" target on the autoconf unix makefile.  Requires
that FUZZDB be set to the name of the fuzz-data database file.

FossilOrigin-Name: 8fa3915dbfdd9a5b0fcf4d695590b3de7e7d19d2917924186ca889cd60bf0eb9

20 months agoAdd an assert() to prove the sqlite3_prepare() always either returns
drh [Fri, 17 Nov 2023 17:25:30 +0000 (17:25 +0000)] 
Add an assert() to prove the sqlite3_prepare() always either returns
SQLITE_OK or else leaves *ppStmt set to NULL.  See
[forum:/forumpost/70bb8576c6c084c2|forum post 70bb8576c6c084c2].

FossilOrigin-Name: feadd4024228e578811447c4b2d2b60780ff3d3681f80ca903585aa7b289d758

20 months agoWhen SQLITE_ENABLE_SETLK_TIMEOUT is defined, use a separate mutex in os_unix.c for... unix-setlk-timeout-mutexes
dan [Fri, 17 Nov 2023 17:10:37 +0000 (17:10 +0000)] 
When SQLITE_ENABLE_SETLK_TIMEOUT is defined, use a separate mutex in os_unix.c for each shm locking slot.

FossilOrigin-Name: 4098df9652d90f2d22d5591d915d672c5413471f7916223510ba6fd932bfdd36

20 months agoFix harmless compiler warnings in debugging code.
drh [Fri, 17 Nov 2023 12:22:42 +0000 (12:22 +0000)] 
Fix harmless compiler warnings in debugging code.

FossilOrigin-Name: ce6a75622ea5bca517bc6613e738aa670c9e1dd863596220eded5c2379c616c7

20 months agoFix an incorrect assert() associated with ALTER TABLE where an unknown
drh [Fri, 17 Nov 2023 11:58:26 +0000 (11:58 +0000)] 
Fix an incorrect assert() associated with ALTER TABLE where an unknown
aggregate function contains an ORDER BY clause.
dbsqlfuzz e0900262dadd5c78c2226ad6a435c7f0255be2cd.

FossilOrigin-Name: a9443dbfbe25e588b4adddde664ddf482f19f71c704fbf356d49cf3a6135e7fb

20 months agoWhen querying a tokendata=1 fts5 table, do not use a prefix cursor for the case where...
dan [Thu, 16 Nov 2023 21:11:56 +0000 (21:11 +0000)] 
When querying a tokendata=1 fts5 table, do not use a prefix cursor for the case where the term has only one variant.

FossilOrigin-Name: d711c96ba855686d6881a50498418de3492144f005684b5ae55bca24413dce47

20 months agoSimplify and make more rational how console I/O package features are selected. (Motiv...
larrybr [Thu, 16 Nov 2023 18:31:05 +0000 (18:31 +0000)] 
Simplify and make more rational how console I/O package features are selected. (Motivated by Fiddle and other command-line utilities to soon use the package.) No substantive code-execution changes.

FossilOrigin-Name: 1cde05877b7e47cb2ab9de26edd5245eb5ff1d91e69b94f3b24944fd4f6ccd3e

20 months agoChanges so that if SQLITE_ENABLE_SETLK_TIMEOUT is defined as 2 instead of 1, all...
dan [Wed, 15 Nov 2023 19:19:04 +0000 (19:19 +0000)] 
Changes so that if SQLITE_ENABLE_SETLK_TIMEOUT is defined as 2 instead of 1, all blocking locks are taken for a single millisecond and the default busy-handler invoked as normal.

FossilOrigin-Name: 79e24ec3dd40373bbb93792829b18d9ef40daf19d4606174e36c8e19e61a7529

20 months agoImprovements to the description of sqlite3_errmsg() and sqlite3_errstr().
drh [Wed, 15 Nov 2023 14:09:37 +0000 (14:09 +0000)] 
Improvements to the description of sqlite3_errmsg() and sqlite3_errstr().

FossilOrigin-Name: fe5cc4169c5348324e863d3e339de94ed01749a3b9c86aa9adc5e3244bd9d033

20 months agoAdd implementation of xInstToken() API.
dan [Wed, 15 Nov 2023 11:45:19 +0000 (11:45 +0000)] 
Add implementation of xInstToken() API.

FossilOrigin-Name: a34b26fe7f60b74e7ae5cf64900920a3d352a20da2496401bcbc27041689cd07

20 months agoFix an exception misuse in test-opfs-vfs.js.
stephan [Wed, 15 Nov 2023 11:31:49 +0000 (11:31 +0000)] 
Fix an exception misuse in test-opfs-vfs.js.

FossilOrigin-Name: 9264955e6e47aa8fc3a6f8bed192a6c12f43de49f7fba2e0cc080e47abedde14

20 months agoJNI: add more wrapper1 Sqlite.Blob tests.
stephan [Wed, 15 Nov 2023 08:59:53 +0000 (08:59 +0000)] 
JNI: add more wrapper1 Sqlite.Blob tests.

FossilOrigin-Name: d63f6e1ffda9a88a37acc7862cb7ee8b9cd669b0fdba64c1ec9dd221cf807714

20 months agoJNI: clear out the sqlite3_context native pointer after calling UDF callbacks which...
stephan [Wed, 15 Nov 2023 08:29:42 +0000 (08:29 +0000)] 
JNI: clear out the sqlite3_context native pointer after calling UDF callbacks which do not have an argv (as was already done for those which have an argv). Add related tests and code commentary.

FossilOrigin-Name: 138f40543b26b2e02e27d830d92e30b12cfef5a8dc3f0b58b39c68e1b3c91cc6

20 months agoJNI doc updates.
stephan [Wed, 15 Nov 2023 06:28:51 +0000 (06:28 +0000)] 
JNI doc updates.

FossilOrigin-Name: 1b1f36a206319e99ccaed969893ff95dcf3b8e97ed301544cf3cd3fee2780335

20 months agoJNI: add the @Experimental annotation and mark all java.nio.ByteBuffer-related method...
stephan [Wed, 15 Nov 2023 06:10:37 +0000 (06:10 +0000)] 
JNI: add the @Experimental annotation and mark all java.nio.ByteBuffer-related methods with it.

FossilOrigin-Name: 0f4b223102e5dc9142c9d2cb8892b8d3cc476e579420028b93d4e12f4cf94d3e

20 months agoJNI test code cleanups.
stephan [Wed, 15 Nov 2023 05:08:39 +0000 (05:08 +0000)] 
JNI test code cleanups.

FossilOrigin-Name: 09142ac14347e6f41bbe50bc835920e271713452733a478ede547816cc291ace

20 months agoJNI: add CONFIG_LOG and CONFIG_SQLLOG support to wrapper1. Code-adjacent cleanups.
stephan [Wed, 15 Nov 2023 04:55:38 +0000 (04:55 +0000)] 
JNI: add CONFIG_LOG and CONFIG_SQLLOG support to wrapper1. Code-adjacent cleanups.

FossilOrigin-Name: 83c49b9e71e5ae8852bab60a6fa630e22164c8efbf074c85450136781d0fffd3

20 months agoJNI: apply an internal level of API indirection to avoid having to work with massivel...
stephan [Wed, 15 Nov 2023 03:02:11 +0000 (03:02 +0000)] 
JNI: apply an internal level of API indirection to avoid having to work with massively-mangled names for the various sqlite3_config() overloads.

FossilOrigin-Name: 24f20663b1c4e13ff7d9a89e1df6af2e6f5730e5042ae6479e0a8c1bb846f313

20 months agoAdd NEVER() to a branch made unreachable by [6f9eed826f5b3d1c].
drh [Tue, 14 Nov 2023 16:53:52 +0000 (16:53 +0000)] 
Add NEVER() to a branch made unreachable by [6f9eed826f5b3d1c].

FossilOrigin-Name: 26dcaa34e3521783bde687749d590eca54cecb4bb95ef332a4a6473c4141d052

20 months agoJNI: reimplement Tester2.execSql() using the high-level API.
stephan [Tue, 14 Nov 2023 14:59:41 +0000 (14:59 +0000)] 
JNI: reimplement Tester2.execSql() using the high-level API.

FossilOrigin-Name: 3a69679e41d23a760df349b2471a1ed306c087f9a7a7a2e2cba3723071dee6b2

20 months agoFix another obscure problem with nested aggregates. dbsqlfuzz 04408efc51.
dan [Tue, 14 Nov 2023 14:50:34 +0000 (14:50 +0000)] 
Fix another obscure problem with nested aggregates. dbsqlfuzz 04408efc51.

FossilOrigin-Name: 6f9eed826f5b3d1cb08402925b406a7fe9b54259af1ba5eba92d4d37fbad628a

20 months agoJNI: add Sqlite.Stmt.step(boolean) overload which returns the result code of sqlite3_...
stephan [Tue, 14 Nov 2023 14:38:11 +0000 (14:38 +0000)] 
JNI: add Sqlite.Stmt.step(boolean) overload which returns the result code of sqlite3_step() unless passed true, in which case it throws for any result other than ROW or DONE. The intent is to simplify handling of LOCKED and BUSY errors.

FossilOrigin-Name: f4f1cc201a7dc618a66617778ecf58ba60461ae700cb41f5c4abfa26dd0c0ed4

20 months agoExtra PRAGMA vdbe_addoptrace output showing when OP_Column gets translated
drh [Tue, 14 Nov 2023 13:51:19 +0000 (13:51 +0000)] 
Extra PRAGMA vdbe_addoptrace output showing when OP_Column gets translated
into OP_Copy due to using a coroutine instead of a cursor.

FossilOrigin-Name: eba180e77977acd6f3d4a0e3c99a2ebd4ce2839e9ce30c588929e36d69aa762a

20 months agoJNI: use ByteBuffer.limit() instead of ByteBuffer.capacity() when figuring out where...
stephan [Tue, 14 Nov 2023 05:33:44 +0000 (05:33 +0000)] 
JNI: use ByteBuffer.limit() instead of ByteBuffer.capacity() when figuring out where the logical end of a ByteBuffer is, for reasons explained at length in new code comments. This is unfortunately slower but is the correct way to do it.

FossilOrigin-Name: 51539419edc08ee6c70d8719d0f4d5ad47dd545a7fd9bf01d03a434aabd41d68

20 months agoJNI: add sqlite3_blob_read_nio_buffer() and iron out the blob/ByteBuffer interface...
stephan [Tue, 14 Nov 2023 04:59:57 +0000 (04:59 +0000)] 
JNI: add sqlite3_blob_read_nio_buffer() and iron out the blob/ByteBuffer interface somewhat.

FossilOrigin-Name: 7df317b448a09ae77e2c68cc901fdb6d56a2246c1313f06bebd1f3e53f02c19b

20 months agoAdd a few asserts into *Put*() functions to catch calls that might cause an address...
larrybr [Tue, 14 Nov 2023 03:24:43 +0000 (03:24 +0000)] 
Add a few asserts into *Put*() functions to catch calls that might cause an address fault.

FossilOrigin-Name: 2341f9b6a48634a94e90e849f579afd07d398c3e0304efccf07d18b41a0e40aa

20 months agoJNI: change sqlite3_prepare_multi()'s exception-handling semantics to be more C-like...
stephan [Tue, 14 Nov 2023 02:43:30 +0000 (02:43 +0000)] 
JNI: change sqlite3_prepare_multi()'s exception-handling semantics to be more C-like and, to support that, add the package-private sqlite3_jni_db_error() method to set the db error state from package-level Java code.

FossilOrigin-Name: 46656b354311ec0a36832af1c4ccb3b6a244aa55cfb3681e25c3f42b13b387dd

20 months agoJNI: add sqlite3_blob_write() overload which accepts a java.nio.ByteBuffer. Cleanups...
stephan [Tue, 14 Nov 2023 01:33:15 +0000 (01:33 +0000)] 
JNI: add sqlite3_blob_write() overload which accepts a java.nio.ByteBuffer. Cleanups in adjacent code.

FossilOrigin-Name: ca32af8542aa2725cc87f54541b19897556f610e4674edf9f22a84e3d4097a82

20 months agoJNI: add sqlite3_column_nio_buffer() and sqlite3_value_nio_buffer() using an only...
stephan [Mon, 13 Nov 2023 23:11:10 +0000 (23:11 +0000)] 
JNI: add sqlite3_column_nio_buffer() and sqlite3_value_nio_buffer() using an only-slightly roundabout approach to creating properly-sized ByteBuffer objects.

FossilOrigin-Name: efbc82b218d26b7ca9b881da69d5fd14d22b5211fbd85a835da50e5bfde3d160

20 months agoJNI: add sqlite3_result_nio_buffer() and tests. Discover that we cannot create sensib...
stephan [Mon, 13 Nov 2023 18:35:37 +0000 (18:35 +0000)] 
JNI: add sqlite3_result_nio_buffer() and tests. Discover that we cannot create sensible sqlite3_column_nio_buffer() or sqlite3_value_nio_buffer() counterparts because of ByteBuffer interface limitations.

FossilOrigin-Name: 44b4df01ff86841fb85b6295cbada422c6ba8a32a420a2e840e2d607b6c90164

20 months agoCure many warnings from gcc, clang and CL.exe.
larrybr [Mon, 13 Nov 2023 15:59:27 +0000 (15:59 +0000)] 
Cure many warnings from gcc, clang and CL.exe.

FossilOrigin-Name: 29ea2a3aadd34facc45a2e9f9a567bac16fca76beb019b879e2611433c85bbb3

20 months agoJNI: add sqlite3_bind_nio_buffer() and initial tests for binding ByteBuffer objects...
stephan [Mon, 13 Nov 2023 14:58:37 +0000 (14:58 +0000)] 
JNI: add sqlite3_bind_nio_buffer() and initial tests for binding ByteBuffer objects as blobs on JVMs which have JNI support for nio buffers.

FossilOrigin-Name: b10ce1ef82d84726fbf6a8f624d6530f84fefb505f7868b4a0ea910fed7a877f

20 months agoAdd new fts5 API xQueryToken().
dan [Mon, 13 Nov 2023 14:29:12 +0000 (14:29 +0000)] 
Add new fts5 API xQueryToken().

FossilOrigin-Name: 828566392b3ea8db603cb1ae5eccbc8ac035efaa284bc7c15ba89874f634aec9

20 months agoFix var-intro after executable code departure from old C.
larrybr [Mon, 13 Nov 2023 13:01:01 +0000 (13:01 +0000)] 
Fix var-intro after executable code departure from old C.

FossilOrigin-Name: 08996f4fd52f5742e77225ce3da2ac43ea5cc44bb0d8d21126b6d624273842a5

20 months agoSlight cleanup of length-limited strpbrk() replacement, and eliminate strpbrk() call.
larrybr [Mon, 13 Nov 2023 12:53:47 +0000 (12:53 +0000)] 
Slight cleanup of length-limited strpbrk() replacement, and eliminate strpbrk() call.

FossilOrigin-Name: 97e2c9621e3e01048e33da63ca4146ededa33cf6adefa996fa49b8c6a8d555b5

20 months agoEnhance console_io to permit emits limited in various ways, such as valid UTF-8,...
larrybr [Mon, 13 Nov 2023 05:24:00 +0000 (05:24 +0000)] 
Enhance console_io to permit emits limited in various ways, such as valid UTF-8, upto control chars, or with counted limits, all getting away from 0-termination as the sole limit. In CLI, use this capability to avoid certain emit-chars-singly procedures that were breaking up UTF-8 characters. This fixes broken json mode output (on Windows) and (maybe) C-literal-like emits.

FossilOrigin-Name: 906c5c4082e30b7a0d07df89a42566461e2113507c5a0b339827ca0822b8fe84

20 months agoAdd sqlite3_x86.exe unversioned binary.
larrybr [Sun, 12 Nov 2023 19:57:23 +0000 (19:57 +0000)] 
Add sqlite3_x86.exe unversioned binary.

FossilOrigin-Name: a731cdddbb99dbd3f9d1875cad5094239b78969c84fe4c56ecd63e33a5874e3f

20 months agoUse setOutputStream() to designate implicit output for oput{z,f}() emit functions...
larrybr [Sun, 12 Nov 2023 03:58:15 +0000 (03:58 +0000)] 
Use setOutputStream() to designate implicit output for oput{z,f}() emit functions, and use them extensively.

FossilOrigin-Name: 7850fb98a19d0ae3535367de3bca9e50408a2c21504c5772947fc39f287aa830

20 months agoWrite BOM without fwrite(), using sputz() so that if it goes to the console, it is...
larrybr [Sun, 12 Nov 2023 00:43:36 +0000 (00:43 +0000)] 
Write BOM without fwrite(), using sputz() so that if it goes to the console, it is translated "properly".

FossilOrigin-Name: 06ef96a8233c6b6ca2653a0b780b3a401cab2b77594125f4f1c54b269c22a9f9

20 months agoRemove SHELL_LEGACY_CONSOLE_IO PP symbol and code it made active. (It is in the repo...
larrybr [Sat, 11 Nov 2023 22:53:55 +0000 (22:53 +0000)] 
Remove SHELL_LEGACY_CONSOLE_IO PP symbol and code it made active. (It is in the repo if ever needed/wanted, but it is just inferior or dead code now.)

FossilOrigin-Name: 27c5bf6563bc24ba7b47865e8d2f3e2d439666e19038d86dd8445fcdb9abe97a

20 months agoComplete shell transition to using {f,o,e}put{f,z}() emit functions. This fails test...
larrybr [Sat, 11 Nov 2023 20:46:12 +0000 (20:46 +0000)] 
Complete shell transition to using {f,o,e}put{f,z}() emit functions. This fails test 13.1 in json501.test, but so does trunk in the same way.

FossilOrigin-Name: 923c6b8b3a508c715b816c6bcd2ae9ac519bc37a62afc4ef813085c00f1e7cb6

20 months agoJNI wrapper1: when checking for an out-of-bounds statement column index, perform...
stephan [Sat, 11 Nov 2023 14:50:01 +0000 (14:50 +0000)] 
JNI wrapper1: when checking for an out-of-bounds statement column index, perform the is-statement-finalized check before the range check so that the former exception trumps the latter.

FossilOrigin-Name: 0832f9a8e9f574b157c791c5cddc73aff7b2ff403509f5d78f310494d4a7f93d

20 months agoDo not cache a statement's column count in the JNI wrapper1 API because an ALTER...
stephan [Sat, 11 Nov 2023 14:43:50 +0000 (14:43 +0000)] 
Do not cache a statement's column count in the JNI wrapper1 API because an ALTER TABLE via another statement may invalidate it, as reported in [forum:6d80efd58d4591c7|forum post 6d80efd58d4591c7].

FossilOrigin-Name: a6ab88e9a67f23ab7885402776282b94033cb48dbe34d4d18356e4dc22aae7cd

20 months agoFix malf with redirected input due to bad assumption that stdin is a console in the...
larrybr [Sat, 11 Nov 2023 13:09:09 +0000 (13:09 +0000)] 
Fix malf with redirected input due to bad assumption that stdin is a console in the fgets() replacement.

FossilOrigin-Name: 79d1f2c1019964dd154fbdd3f349822cb946a2600883994523ed145047f0a9ea

20 months agoPervasive changes to console_io.{c,h} in support of simplifying ubiquitous emit ops...
larrybr [Sat, 11 Nov 2023 06:20:38 +0000 (06:20 +0000)] 
Pervasive changes to console_io.{c,h} in support of simplifying ubiquitous emit ops in shell, and to get better control of console streams that might be opened only via .read or .output commands. Changes to shell to use {s,o,e}put{f,z}(...) calls for initial testing, but this check-in has few such conversions so that most will be in a separate check-in. Many renames to better follow recent coding convention. This code seems to be working, but has not been tested on difficult platforms or with multiple console hosts yet. So it is a WIP.

FossilOrigin-Name: 14762a004cdf37d1e12f26aadff8ed3824893278f22ff141de86dd44d9b250f3

20 months agoFix another problem with mixed join types and the RIGHT JOIN strength-reduction optim...
dan [Fri, 10 Nov 2023 20:55:20 +0000 (20:55 +0000)] 
Fix another problem with mixed join types and the RIGHT JOIN strength-reduction optimization. [forum:/forumpost/befdab472d | Forum post befdab472d].

FossilOrigin-Name: f1eae192315335d7e385b0a801a17700a9718d245bda6628518c5df9a1e9d3d6

20 months agoAdditional debugging information on the tree-dump of the BETWEEN operator.
drh [Fri, 10 Nov 2023 20:46:58 +0000 (20:46 +0000)] 
Additional debugging information on the tree-dump of the BETWEEN operator.

FossilOrigin-Name: aca31e49d1d25043769544ccf2a07980c5f162a8eb2486e393bf9d9d1a394a60

20 months agoRemove an incorrect ALWAYS() that was inserted yesterday [1e039b6eb59c0001].
drh [Fri, 10 Nov 2023 20:35:59 +0000 (20:35 +0000)] 
Remove an incorrect ALWAYS() that was inserted yesterday [1e039b6eb59c0001].

FossilOrigin-Name: 12885e298b9d3f977f1de11a194692dfb5fbb7daeabd958674f884a5575ddd24

20 months agoEnsure 8-byte alignment of data structues in sqlite3_database_file_object().
drh [Fri, 10 Nov 2023 17:49:26 +0000 (17:49 +0000)] 
Ensure 8-byte alignment of data structues in sqlite3_database_file_object().
This should have appeared on trunk originally and then be cherry-picked onto
the branch.  Oh well....

FossilOrigin-Name: ac39800bb2685fa287c7d834faed75f0bc61320ef986de314392d6eadb574d30

20 months agoRemove a NEVER() from whereAddIndexedExpr() that is reachable if there
drh [Fri, 10 Nov 2023 16:29:02 +0000 (16:29 +0000)] 
Remove a NEVER() from whereAddIndexedExpr() that is reachable if there
is an unknown indexed function in the schema.

FossilOrigin-Name: a976b7208ff8603d7353ce9a0bdfba8e681cbb2ed3de6cfb5f0e8b07312ab86f