]> git.ipfire.org Git - thirdparty/sqlite.git/log
thirdparty/sqlite.git
19 months agoInserts invalid JSONB should return "malformed JSON", not a json path error.
drh [Tue, 21 Nov 2023 22:36:32 +0000 (22:36 +0000)] 
Inserts invalid JSONB should return "malformed JSON", not a json path error.

FossilOrigin-Name: 306ee66fbd0231a9f5b229e5630d5cc66c9cf08b466d2d9204e79e1f44a16374

19 months agoDirect editing of JSONB using json_insert() and json_set().
drh [Tue, 21 Nov 2023 20:13:08 +0000 (20:13 +0000)] 
Direct editing of JSONB using json_insert() and json_set().

FossilOrigin-Name: fffb7a9538838e26991e6f16ea3138346a30c33ea6c3d3834680ee6d1f6eece2

19 months agoCorrect blob-to-text rendering in some corner cases.
drh [Tue, 21 Nov 2023 19:05:22 +0000 (19:05 +0000)] 
Correct blob-to-text rendering in some corner cases.

FossilOrigin-Name: 7822e0e59f9b611fe6289cc762b0aff61f9b87c3a82c60de110f447589a2c125

19 months agoFix the translation of JSON5 numeric values from BLOB into text.
drh [Tue, 21 Nov 2023 18:23:43 +0000 (18:23 +0000)] 
Fix the translation of JSON5 numeric values from BLOB into text.

FossilOrigin-Name: 40c4fb441f220982e4d61fd42597cf18546791a302fbcc8eec2eed29ee15ef35

19 months agoMerge all recent trunk fixes and enhancements into the jsonb branch.
drh [Tue, 21 Nov 2023 17:54:55 +0000 (17:54 +0000)] 
Merge all recent trunk fixes and enhancements into the jsonb branch.

FossilOrigin-Name: 6d78d50ed2357e6c943c1ef97b1d2ea0902cbadef90c2c35dccdbdc2bdf8702f

19 months agoMake edits directly to the JSONB BLOB when the input to json_replace()
drh [Tue, 21 Nov 2023 17:51:58 +0000 (17:51 +0000)] 
Make edits directly to the JSONB BLOB when the input to json_replace()
is a JSONB.

FossilOrigin-Name: d69c6acef54a81f46a97a05d443fe648635b4b70772069d6705ef829b718e985

19 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

19 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

19 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

19 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

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

FossilOrigin-Name: 91c888eddbcb1b461f7d562c2f0eee57f1a2be7f9959b9d69e80fc7c1da20e9e

19 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

19 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

19 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

19 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

19 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

19 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

19 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

19 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

19 months agoMerge the latest trunk enhancements and fixes into the jsonb branch.
drh [Fri, 17 Nov 2023 17:03:45 +0000 (17:03 +0000)] 
Merge the latest trunk enhancements and fixes into the jsonb branch.

FossilOrigin-Name: 162f0509ef27bcd3ec87629640281a71c773e7c3bbd2cd0df76faf481531e7f1

19 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

19 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

19 months agoBoth json_remove() jsonb_remove() work on pure JSONB as long as the input
drh [Wed, 15 Nov 2023 20:32:06 +0000 (20:32 +0000)] 
Both json_remove() jsonb_remove() work on pure JSONB as long as the input
is JSONB.

FossilOrigin-Name: 68d551730be0a3ea9579646ed4836c73554c83ca7f2303b69a18843f1750f1a7

19 months agoSome simple test cases for JSONB direct remove.
drh [Wed, 15 Nov 2023 19:21:09 +0000 (19:21 +0000)] 
Some simple test cases for JSONB direct remove.

FossilOrigin-Name: 8cb4d2cbfc1b5f3c612d85138e66da8735d6589c7538fdf494a761c9b8104f18

19 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

19 months agojsonb_remove() now works without having to use a JsonNode parse, assuming
drh [Wed, 15 Nov 2023 18:55:03 +0000 (18:55 +0000)] 
jsonb_remove() now works without having to use a JsonNode parse, assuming
that the input is JSONB.

FossilOrigin-Name: 5207679e929786e577a0553d0d84dda5125456dcde80c0f3156f14f4d8c804cb

19 months agoThe jsonb_remove() routine now appears to be working. jsonb-remove
drh [Wed, 15 Nov 2023 18:47:31 +0000 (18:47 +0000)] 
The jsonb_remove() routine now appears to be working.

FossilOrigin-Name: e76d48137ea823b7810dc8c3b70eb21adabdd6cfbac36050c85d1375e94be1de

19 months agoWork toward getting jsonb_remove() to work directly on JSONB blobs.
drh [Wed, 15 Nov 2023 16:10:31 +0000 (16:10 +0000)] 
Work toward getting jsonb_remove() to work directly on JSONB blobs.

FossilOrigin-Name: a79ff8e58fcaf718a6fb78e145117f1d6d40d133f31e9752bb9c6d484850a27b

19 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

19 months agoMerge all the latest enhancements and fixes from trunk into the jsonb branch.
drh [Wed, 15 Nov 2023 13:23:40 +0000 (13:23 +0000)] 
Merge all the latest enhancements and fixes from trunk into the jsonb branch.

FossilOrigin-Name: ba91408f4c044feda003ef93784ccefb619f99ab64379ced481ee8e9e890fd41

19 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

19 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

19 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

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

FossilOrigin-Name: 1b1f36a206319e99ccaed969893ff95dcf3b8e97ed301544cf3cd3fee2780335

19 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

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

FossilOrigin-Name: 09142ac14347e6f41bbe50bc835920e271713452733a478ede547816cc291ace

19 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

19 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

19 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

19 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

19 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

19 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

19 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

19 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

19 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

19 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

19 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

19 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

19 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

19 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

19 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

19 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

19 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

19 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

19 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

19 months agoMerge recent trunk enhancements and fixes into the jsonb branch.
drh [Fri, 10 Nov 2023 18:59:23 +0000 (18:59 +0000)] 
Merge recent trunk enhancements and fixes into the jsonb branch.

FossilOrigin-Name: 091a5f058dfe2115fb9213655b34f00bcec80aebb299b571975cfe4ecd5ec206

19 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

19 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

19 months agoFix an obscure problem with the join-strength-reduction optimization that could occur...
dan [Fri, 10 Nov 2023 15:03:18 +0000 (15:03 +0000)] 
Fix an obscure problem with the join-strength-reduction optimization that could occur when mixing LEFT and RIGHT joins in the same query. [forum:/forumpost/7f74ce0bee|Forum post 7f74ce0bee].

FossilOrigin-Name: 530d10e93a5f63b71aaa94a2b89102d012a2cda815997066beb0f585fe823536

19 months agoExpose the missing SQLITE_SUBTYPE to wasm.
stephan [Fri, 10 Nov 2023 15:00:26 +0000 (15:00 +0000)] 
Expose the missing SQLITE_SUBTYPE to wasm.

FossilOrigin-Name: ac9534b2ceb8185b1fc03282f881cd3e4aea64af75a02ebded1e07d4d8278739

19 months agoExpose the missing SQLITE_SUBTYPE to JNI.
stephan [Fri, 10 Nov 2023 15:00:11 +0000 (15:00 +0000)] 
Expose the missing SQLITE_SUBTYPE to JNI.

FossilOrigin-Name: 0f92f4c90eb9397325f1a86836e356862108e2e850c1801e0bec4a7030dea271

19 months agoExpose SQLITE_RESULT_SUBTYPE to JNI.
stephan [Fri, 10 Nov 2023 14:15:07 +0000 (14:15 +0000)] 
Expose SQLITE_RESULT_SUBTYPE to JNI.

FossilOrigin-Name: 3bf75875b8be8d2e878681506fb35f2062d59f07fa23f571c58cd92f270bb197

19 months agoExpose SQLITE_RESULT_SUBTYPE to wasm.
stephan [Thu, 9 Nov 2023 17:53:44 +0000 (17:53 +0000)] 
Expose SQLITE_RESULT_SUBTYPE to wasm.

FossilOrigin-Name: 6d2fe9848beb35a8206e49c2ffae29a3eb2fe6411d77f366e962ced3f83e4749

19 months agoAdd the SQLITE_RESULT_SUBTYPE flag for application-defined functions. Add
drh [Thu, 9 Nov 2023 17:36:37 +0000 (17:36 +0000)] 
Add the SQLITE_RESULT_SUBTYPE flag for application-defined functions.  Add
the -DSQLITE_STRICT_SUBTYPE=1 compile-time option that raises an error if
any function invokes sqlite3_result_subtype() without the SQLITE_RESULT_SUBTYPE
flag.  SQLITE_RESULT_SUBTYPE prevents an indexed value of that function from
being used to replace an equivalent expression, since the indexed expression
does not carry the subtype.  Fix for the problem described at
[forum:/forumpost/68d284c86b082c3e|forum post 68d284c86b082c3e].

FossilOrigin-Name: ba789a7804ab96d81b15d6ef6fed1f802fa69db47cf91d368933e55289fa1d6e

19 months agoFix compilation issue seen with MSVC.
mistachkin [Thu, 9 Nov 2023 17:28:31 +0000 (17:28 +0000)] 
Fix compilation issue seen with MSVC.

FossilOrigin-Name: 0dfe790d8118ff1bacc9e7c97d4f8ff9e5789f6cda8ec6fd981ea38b4da3905d

19 months agoPut an ALWAYS on an true branch.
drh [Thu, 9 Nov 2023 17:26:39 +0000 (17:26 +0000)] 
Put an ALWAYS on an true branch.

FossilOrigin-Name: 1e039b6eb59c0001a9efdd2f9928a34d4e9e01972ee76aa04a1279369dc03840

19 months agoFuther documentation refinements.
drh [Thu, 9 Nov 2023 16:52:44 +0000 (16:52 +0000)] 
Futher documentation refinements.

FossilOrigin-Name: 311c2eba93097bbecfa286bbeaff9bd6fc75a238e20cd2b6f834e594032d8c59

19 months agoFixes: (1) In the ->> function, instead of setting a subtype and clearing it,
drh [Thu, 9 Nov 2023 15:01:56 +0000 (15:01 +0000)] 
Fixes: (1) In the ->> function, instead of setting a subtype and clearing it,
do not set it in the first place, as doing the set would trigger an error
under SQLITE_STRICT_SUBTYPE.  (2) Allow the SQLITE_STRICT_SUBTYPE through
the property filter on sqlite3_create_function().

FossilOrigin-Name: 6195468b14f6f17ea072cf191c9ef1bd0713acd314bc6dc128be7322bfd612cc

19 months agoA .class file build dependencies fix in the JNI build.
stephan [Thu, 9 Nov 2023 13:00:33 +0000 (13:00 +0000)] 
A .class file build dependencies fix in the JNI build.

FossilOrigin-Name: 8cc32915165efd7c261f008bb6fa4cc6581ee7bd73ea5da47513742b9e6d34e4

19 months agoAdd the SQLITE_STRICT_SUBTYPE compile-time option. This change reveals that
drh [Thu, 9 Nov 2023 12:58:03 +0000 (12:58 +0000)] 
Add the SQLITE_STRICT_SUBTYPE compile-time option.  This change reveals that
the current SQLITE_RESULT_SUBTYPE design does not work unless we tag the ->>
operator with SQLITE_RESULT_SUBTYPE.  But that will disable an important
optimization.

FossilOrigin-Name: e98a9a65dd309f72c240e280c7bebabc58af664fae9ee0d30c3fa1c78db5bae9

19 months agoAdd some notes about the JNI pointer-passing approach and convert a couple of potenti...
stephan [Thu, 9 Nov 2023 12:48:54 +0000 (12:48 +0000)] 
Add some notes about the JNI pointer-passing approach and convert a couple of potential NullPointerExceptions into appropriate C result codes. Clarify that invocation of undefined behaviour from the Java API does not (due to the addition of defensive code) mean the same thing as it does in C (e.g. no NULL pointer dereferences).

FossilOrigin-Name: 19c4778f45261006368b2d9460350fed1e55fed314c8b3e1af34cd8c3c73b7d8

19 months agoDo not replace expressions that return subtypes with values taken from an
drh [Thu, 9 Nov 2023 12:17:57 +0000 (12:17 +0000)] 
Do not replace expressions that return subtypes with values taken from an
index.

FossilOrigin-Name: a35d13db09e32ee339f3983fe36b073714753ee3d39f577ae8d20596d7adc3eb

19 months agoOmit the new SQLITE_VALUE_SUBTYPE name. Stay with legacy SQLTIE_SUBTYPE.
drh [Thu, 9 Nov 2023 12:08:16 +0000 (12:08 +0000)] 
Omit the new SQLITE_VALUE_SUBTYPE name.  Stay with legacy SQLTIE_SUBTYPE.
Add extra documentation to sqlite3_value_subtype() and sqlite3_result_subtype()
indicating that the SQLITE_SUBTYPE and SQLITE_RESULT_SUBTYPE properties are
required on functions that use those interfaces.

FossilOrigin-Name: 563ad3be60d22c45f1c5b9a3e67738593f8b38f137147c56514166fbabf95365

19 months agoTwo more JNI build fixes for Windows/MinGW, reported in [forum:4f949edc312d2a75|forum...
stephan [Thu, 9 Nov 2023 12:01:02 +0000 (12:01 +0000)] 
Two more JNI build fixes for Windows/MinGW, reported in [forum:4f949edc312d2a75|forum post 4f949edc312d2a75].

FossilOrigin-Name: a3f9c39086e582e16ca15647961956b3c28d038655d3b43d4b94bd306fbec1a4

19 months agoJSON5 bug fix: Escape double-quotes that occur inside of single-quoted strings.
drh [Thu, 9 Nov 2023 01:54:26 +0000 (01:54 +0000)] 
JSON5 bug fix:  Escape double-quotes that occur inside of single-quoted strings.
[forum:/forumpost/ddcad3e884|Forum post ddcad3e884].

FossilOrigin-Name: 1c98d46d60ef1494bd8b7561c7d0cd5aafc178201a6f1f0da25dea6140b91cd0

19 months agoMake a distinction between functions that consume subtypes and functions
drh [Wed, 8 Nov 2023 21:38:30 +0000 (21:38 +0000)] 
Make a distinction between functions that consume subtypes and functions
that generate subtypes.

FossilOrigin-Name: 48a92e3ad855227188a4c5afe4abbb7171761cf6fc930660084d9abeecfd91d9

19 months agoDo not cover expressions using an indexed expression if the indexed expression idx-expr-fix
drh [Wed, 8 Nov 2023 18:08:07 +0000 (18:08 +0000)] 
Do not cover expressions using an indexed expression if the indexed expression
is a function that might set a subtype.

FossilOrigin-Name: e908b26a990929996b3c16f0429e8313cd8fcefe7c883c77f66ea69f4059d6e2

19 months agoMerge recent trunk enhancements into the jsonb branch, and especially the
drh [Wed, 8 Nov 2023 17:11:13 +0000 (17:11 +0000)] 
Merge recent trunk enhancements into the jsonb branch, and especially the
finer-grain characterization of JSON function properties.

FossilOrigin-Name: 72393b003f9f8675e4a124dddd09607b5b34ddefe56716b283c68c0982fb3d96

19 months agoMore precise characterization of JSON functions. Indicate when functions might
drh [Wed, 8 Nov 2023 16:37:12 +0000 (16:37 +0000)] 
More precise characterization of JSON functions.  Indicate when functions might
return JSON (subtype 'J') and when they make use of the function argument cache.

FossilOrigin-Name: b2b62546c4a5e9dccb8aa0cb8eda228d662c69159e320b01a377317bc909e89f

19 months agoHave the shell tool emit a warning if the user attempts to use ".scanstats vm" in...
dan [Wed, 8 Nov 2023 15:56:41 +0000 (15:56 +0000)] 
Have the shell tool emit a warning if the user attempts to use ".scanstats vm" in a non-SQLITE_ENABLE_BYTECODE_VTAB build.

FossilOrigin-Name: 3978c084a509c3c739fbe87e20feec9ddf1325e35170329987af197ca9fd731a

19 months agoRemove old files related to wapptest.tcl from test/ directory.
dan [Wed, 8 Nov 2023 15:51:42 +0000 (15:51 +0000)] 
Remove old files related to wapptest.tcl from test/ directory.

FossilOrigin-Name: dd3e7b5bcad122ac1e7e19ec547f4486ce90a6a2aa89a64e36bea13a216492fe

19 months agoAvoid blocking as part of passive checkpoint operations, even if SQLITE_ENABLE_SETLK_...
dan [Wed, 8 Nov 2023 15:49:57 +0000 (15:49 +0000)] 
Avoid blocking as part of passive checkpoint operations, even if SQLITE_ENABLE_SETLK_TIMEOUT is defined.

FossilOrigin-Name: e5ecc404cae1ce8b639d0263fa07571c066f11bfc62f5ba331ad7ae138e78572

19 months agoRemove an unused/invalid test from the wasm suite.
stephan [Wed, 8 Nov 2023 15:34:03 +0000 (15:34 +0000)] 
Remove an unused/invalid test from the wasm suite.

FossilOrigin-Name: 916ae898743a969295a48ae2a6e9e366586834b32d77d3fa281bbaf7f2818502

19 months agoJNI build fixes for platforms where the jint type is not the same as int, as reported...
stephan [Wed, 8 Nov 2023 12:56:23 +0000 (12:56 +0000)] 
JNI build fixes for platforms where the jint type is not the same as int, as reported in [forum:9089d2049a|forum post 9089d2049a].

FossilOrigin-Name: b32b0873274bfe472114da8a308a04bee76ba26a5830d8d04fc921f9c1544f9d

19 months agoSuppress harmless UBSAN warnings about memory overflow in OP_AddImm. The
drh [Wed, 8 Nov 2023 00:45:14 +0000 (00:45 +0000)] 
Suppress harmless UBSAN warnings about memory overflow in OP_AddImm.  The
exact same machine code is generated by GCC.

FossilOrigin-Name: b0594383b9fa021a8713d640a4606b9053f8e21d64b4ec8ea60a0b6cddfca306

19 months agoChanges a no-op call to freeP4() into an assert().
drh [Wed, 8 Nov 2023 00:12:38 +0000 (00:12 +0000)] 
Changes a no-op call to freeP4() into an assert().

FossilOrigin-Name: 32a7b1bd4d88a6839c2c5061a38b4a28f31b22aa8fa08c743633ff96fc4bf88d

19 months agoAdd -DSQLITE_ENABLE_SETLK_TIMEOUT=1 to a release-test configuration.
dan [Tue, 7 Nov 2023 20:56:29 +0000 (20:56 +0000)] 
Add -DSQLITE_ENABLE_SETLK_TIMEOUT=1 to a release-test configuration.

FossilOrigin-Name: cd3e38fb0f2f7e134bb6cfbe86b6621017344e4361dc6a09ec1367860ba8773b

19 months agoFix an assert() that could fail within calls to sqlite3_snapshot_open() in SQLITE_ENA...
dan [Tue, 7 Nov 2023 20:11:49 +0000 (20:11 +0000)] 
Fix an assert() that could fail within calls to sqlite3_snapshot_open() in SQLITE_ENABLE_SETLK_TIMEOUT builds.

FossilOrigin-Name: 84634bc268e5c80146f3f3b2e13118f239c9a7e4e4e9dfcaccef2b17252ce53b

19 months agoAn attempt to work around compilation errors on MinGW reported in [forum:9089d2049a...
stephan [Tue, 7 Nov 2023 19:39:23 +0000 (19:39 +0000)] 
An attempt to work around compilation errors on MinGW reported in [forum:9089d2049a|forum post 9089d2049a].

FossilOrigin-Name: d5658a3ee4f585cc1e96d84425aad2e1f56b3ae507c9e17b71e030f83f0b70e8

19 months agoUpdate the documentation to the sqlite3_set_auxdata() and sqlite3_get_auxdata()
drh [Tue, 7 Nov 2023 19:03:13 +0000 (19:03 +0000)] 
Update the documentation to the sqlite3_set_auxdata() and sqlite3_get_auxdata()
routines to make it clear that they do not work as one might expect when they
are called during query planning, instead of during query execution.  The JSON
routines misuse those interfaces, so add a special flag to JSON routines that
prevents them from being invoked during query planning.  Fix for the problem
in [forum:/forumpost/a655ee159eca1ea5|forum post a655ee159eca1ea5].

FossilOrigin-Name: 796a23f9ee33da0803844a2f40c1733db894cc4ef7fbaa1fa94af6af2d3b873b

19 months agoJNI: during static init record whether the current JVM supports JNI-level access...
stephan [Tue, 7 Nov 2023 17:15:55 +0000 (17:15 +0000)] 
JNI: during static init record whether the current JVM supports JNI-level access to java.nio.ByteBuffer raw memory, and add sqlite3_jni_supports_nio() to query that.

FossilOrigin-Name: fb8dbb77a4d8efafd6772333824b4ab589828cf155a63ca6a26730314d0a4bd9

19 months agoAdd Sqlite.prepareMulti() to JNI wrapper1, for preparing multiple statements from...
stephan [Tue, 7 Nov 2023 15:56:39 +0000 (15:56 +0000)] 
Add Sqlite.prepareMulti() to JNI wrapper1, for preparing multiple statements from a single input.

FossilOrigin-Name: e4670d68b52233ab376a1725983e148aaf2a2c3658a41f5768e37a0f1f87428a

19 months agoDiverse minor cleanups in the JNI pieces.
stephan [Tue, 7 Nov 2023 13:44:29 +0000 (13:44 +0000)] 
Diverse minor cleanups in the JNI pieces.

FossilOrigin-Name: 35233dd900632b997b5e532170a3b2af0ca7f1dccb8407555b93f2b395b0f7b4

19 months agoFlesh out [7a63b5b65a79] to be able to build JNI with or without SQLITE_ENABLE_COLUMN...
stephan [Tue, 7 Nov 2023 13:22:49 +0000 (13:22 +0000)] 
Flesh out [7a63b5b65a79] to be able to build JNI with or without SQLITE_ENABLE_COLUMN_METADATA.

FossilOrigin-Name: fcee41b3d4d2558299ead28cc17f290b9ff1957a84c3feaa0a24872feeb22901

19 months agoAdd -DSQLITE_ENABLE_COLUMN_METADATA to the JNI build, as per [forum:9205518c0568fdf0...
stephan [Mon, 6 Nov 2023 21:57:15 +0000 (21:57 +0000)] 
Add -DSQLITE_ENABLE_COLUMN_METADATA to the JNI build, as per [forum:9205518c0568fdf0|forum post 9205518c0568fdf0]. Add tests for the functions that flag enables so that the build will fail if that flag is missing.

FossilOrigin-Name: 7a63b5b65a79d15658a160d0878c7371941c67e9b48a7442762c68c60b77288a

19 months agoFix an fts5 problem where a transaction consisting of (a) a DELETE on rowid X, (b...
dan [Mon, 6 Nov 2023 18:40:25 +0000 (18:40 +0000)] 
Fix an fts5 problem where a transaction consisting of (a) a DELETE on rowid X, (b) a prefix query, and (c) an INSERT on rowid X, could corrupt the index.

FossilOrigin-Name: c2058a045b57571b2b5d342adb212fe606717c633a0422755691ae6bf5725d25

20 months agoAdd incremental blob I/O support to JNI wrapper1.
stephan [Sun, 5 Nov 2023 04:20:04 +0000 (04:20 +0000)] 
Add incremental blob I/O support to JNI wrapper1.

FossilOrigin-Name: 7f1c76fe930d69a0274f70fa7b7e68e0db6226b731a065fa57d0936c8400ffb0

20 months agoJNI wrapper1 normalizeSql() now throws UnsupportedOperationException, instead of...
stephan [Sun, 5 Nov 2023 03:37:33 +0000 (03:37 +0000)] 
JNI wrapper1 normalizeSql() now throws UnsupportedOperationException, instead of returning null, if built without SQLITE_ENABLE_NORMALIZE. Remove SQLITE_PREPARE_NORMALIZE from the JNI interface because it's a legacy no-op.

FossilOrigin-Name: d081a126697e214082f3b203f23ea63510080e5c2aac1d8badc9e6e4bfea7c95

20 months agoAdd authorizer support to JNI wrapper1.
stephan [Sun, 5 Nov 2023 01:55:20 +0000 (01:55 +0000)] 
Add authorizer support to  JNI wrapper1.

FossilOrigin-Name: 773f9873865b5277a6a682c4695f216bfe1ec05ed5e5a2a70aaa451934ba2dc0

20 months agoAdd progress-handler support to JNI wrapper1. Correct the return type of the extended...
stephan [Sun, 5 Nov 2023 01:39:29 +0000 (01:39 +0000)] 
Add progress-handler support to JNI wrapper1. Correct the return type of the extended_result_codes() JNI binding and expose it to wrapper1.

FossilOrigin-Name: 6c0acfdce2160d8db261a59677cec571b6abc333481525b1ec975d98e88bec88