]> git.ipfire.org Git - thirdparty/sqlite.git/log
thirdparty/sqlite.git
20 months agoJNI: extend [baf220e78a46246c47] to include macro-generated sqlite3_value_...() bindings. api-armor-audit
stephan [Sat, 14 Oct 2023 20:44:13 +0000 (20:44 +0000)] 
JNI: extend [baf220e78a46246c47] to include macro-generated sqlite3_value_...() bindings.

FossilOrigin-Name: ad34b2542e330c22fcf331810ab43e66346b1bad8de1a3989e6208cfa0fc2f92

20 months agoJNI: make the sqlite3_value_...() family of bindings resistent to NULL arguments.
stephan [Sat, 14 Oct 2023 20:34:40 +0000 (20:34 +0000)] 
JNI: make the sqlite3_value_...() family of bindings resistent to NULL arguments.

FossilOrigin-Name: baf220e78a46246c476cd429ac131698db5fa66f62fb5725d4f736fe5246283c

20 months agoAdd API_ARMOR support to the scanstatus family of functions.
stephan [Sat, 14 Oct 2023 20:01:55 +0000 (20:01 +0000)] 
Add API_ARMOR support to the scanstatus family of functions.

FossilOrigin-Name: 2f3101f016d5f8d954a262befdf5e0f938a223e444bc534e1d3655b733f4663d

20 months agoJNI: add a missing result code check to sqlite3_bind_value(stmt, null).
stephan [Sat, 14 Oct 2023 16:57:48 +0000 (16:57 +0000)] 
JNI: add a missing result code check to sqlite3_bind_value(stmt, null).

FossilOrigin-Name: f1a357f42de58927c33e7047dc4417e3b9549d7529625f30c583e66b7d603b00

20 months agoJNI: add missing sqlite3_bind_value() and minor memory-safety-related cleanups.
stephan [Sat, 14 Oct 2023 16:56:12 +0000 (16:56 +0000)] 
JNI: add missing sqlite3_bind_value() and minor memory-safety-related cleanups.

FossilOrigin-Name: 3900031763abf4b2aab7b57e886cc407571d0d5928b74f24dcea8fb7371655af

20 months agoAdd API_ARMOR support to the sqlite3_result_...() family of functions and sqlite3_bin...
stephan [Sat, 14 Oct 2023 16:29:36 +0000 (16:29 +0000)] 
Add API_ARMOR support to the sqlite3_result_...() family of functions and sqlite3_bind_zeroblob64().

FossilOrigin-Name: afabe3e35a66625527e2881749cdb6e13300888ab57bc0f05889d0e3ee203d73

20 months agoMore API_ARMOR additions.
stephan [Sat, 14 Oct 2023 14:53:18 +0000 (14:53 +0000)] 
More API_ARMOR additions.

FossilOrigin-Name: 78ebf838f645742f87733665cd72af736df345683b27377a2c8310c893b1769d

20 months agoAdd column name to API_ARMOR check in sqlite3_blob_open() to avoid a null-pointer...
stephan [Sat, 14 Oct 2023 13:24:30 +0000 (13:24 +0000)] 
Add column name to API_ARMOR check in sqlite3_blob_open() to avoid a null-pointer deref.

FossilOrigin-Name: 0114a6622afc4588c47e98d804340449417b603dc4831513eab4d8e4ccb15d42

20 months agoRevert [f6cd88e6b234] - the NULL callback case is perfectly legal.
stephan [Sat, 14 Oct 2023 12:45:11 +0000 (12:45 +0000)] 
Revert [f6cd88e6b234] - the NULL callback case is perfectly legal.

FossilOrigin-Name: 718ab67607895176e529eb7469832d262a347d030e83e7ee66d3b4704bf933de

20 months agoBring JNI-side sqlite3_last_insert_rowid() and sqlite3_table_column_metadata() in...
stephan [Sat, 14 Oct 2023 12:40:57 +0000 (12:40 +0000)] 
Bring JNI-side sqlite3_last_insert_rowid() and sqlite3_table_column_metadata() in line with the core's NULL handling.

FossilOrigin-Name: c2afc1c2a2fc9bdf3d7b7701004e0fa40965cf8c6b7cf44b46f2ca37cfa1d2aa

20 months agoExtend API_ARMOR checks on sqlite3_commit/rollback_hook() to include a check for...
stephan [Sat, 14 Oct 2023 12:20:55 +0000 (12:20 +0000)] 
Extend API_ARMOR checks on sqlite3_commit/rollback_hook() to include a check for the callback pointer.

FossilOrigin-Name: f6cd88e6b234560f729ff00da86144a0121ad96d5a07d227c9ffa3f43c22f72d

20 months agoAdd missing JNI bindings for sqlite3_db_readonly() and sqlite3_db_name(). Code-adjace...
stephan [Sat, 14 Oct 2023 12:19:59 +0000 (12:19 +0000)] 
Add missing JNI bindings for sqlite3_db_readonly() and sqlite3_db_name(). Code-adjacent tweaks for the API_ARMOR audit.

FossilOrigin-Name: e5eace747ae656f1e05a346e53a2827242e57107567d2c3470e292cf0b40858d

20 months agoRound one of an audit for SQLITE_ENABLE_API_ARMOR for functions exposed by JNI and...
stephan [Fri, 13 Oct 2023 12:48:35 +0000 (12:48 +0000)] 
Round one of an audit for SQLITE_ENABLE_API_ARMOR for functions exposed by JNI and those functions missing armor, as [forum:5e3fc453a69b49ca|reported in several forum posts].

FossilOrigin-Name: 8c25c4b18ad07861bf0e47f99f3db04b569b9b859ad0690602f748ddf3576939

20 months agoAvoid potential overflow in hex(). [forum:/forumpost/7ac0c9c5ea|See forum post 7ac0c9...
larrybr [Fri, 13 Oct 2023 01:39:47 +0000 (01:39 +0000)] 
Avoid potential overflow in hex(). [forum:/forumpost/7ac0c9c5ea|See forum post 7ac0c9c5ea.]

FossilOrigin-Name: 2e968114fd0e60eebcc088dec02684e10b06ac1ec42d6bedb5287362f5cbf032

20 months agoMake sure virtual tables have been connected before trying to invoke
drh [Thu, 12 Oct 2023 20:51:17 +0000 (20:51 +0000)] 
Make sure virtual tables have been connected before trying to invoke
the xIntegrity method during PRAGMA integrity_check.

FossilOrigin-Name: 4a4eccb681741917c6771101d4e329f91eae9b035f4d345218e522bb55fff6da

20 months agoFix a problem with an fts5 secure-delete on a rowid/term pair that follows a legacy...
dan [Thu, 12 Oct 2023 19:46:58 +0000 (19:46 +0000)] 
Fix a problem with an fts5 secure-delete on a rowid/term pair that follows a legacy delete of the same pair.

FossilOrigin-Name: 579aea0c28e01a79620ac758edc02db3a01baaa073e7773b8f0b6f610479520b

20 months agoEnable SQLITE_VTAB_INNOCUOUS for FTS3, FTS5, and RTREE.
drh [Thu, 12 Oct 2023 18:46:27 +0000 (18:46 +0000)] 
Enable SQLITE_VTAB_INNOCUOUS for FTS3, FTS5, and RTREE.

FossilOrigin-Name: f34c533b6c1f8ef3f69c75c1039406c12751cdde1fbdcb4d9776b24455facf8a

20 months agoAdd test case for [29937081].
dan [Thu, 12 Oct 2023 18:09:27 +0000 (18:09 +0000)] 
Add test case for [29937081].

FossilOrigin-Name: d3b983edf7164d30ddb8b4b745a3feff9737149d85b1c428d6ad488ac6a1960a

20 months agoMake sure the journal file is closed when transitioning into MEMORY journal
drh [Thu, 12 Oct 2023 17:41:18 +0000 (17:41 +0000)] 
Make sure the journal file is closed when transitioning into MEMORY journal
mode, to avoid an assertion fault in the new sqlite3_randomness() avoidance
code added by [c84e4483cb44f827].

FossilOrigin-Name: 29937081a986d88f495ad48748c35ff5829f0ac31dd4ad3e48d180ae2fcb9a0c

20 months agoCLI to check for rare prepare failures. [forum:/forumpost/5be6395182|See forum post...
larrybr [Thu, 12 Oct 2023 15:12:38 +0000 (15:12 +0000)] 
CLI to check for rare prepare failures. [forum:/forumpost/5be6395182|See forum post 5be6395182.]

FossilOrigin-Name: 286d1e8012a5f5d9e1fe6dce1a732f725b8a1837f66daf6aefb792e19e96f2d4

20 months agoUnconditionally force use of SQLITE_ENABLE_API_ARMOR in the WASM and JNI builds....
stephan [Wed, 11 Oct 2023 20:37:42 +0000 (20:37 +0000)] 
Unconditionally force use of SQLITE_ENABLE_API_ARMOR in the WASM and JNI builds. Their corresponding test suites still work.

FossilOrigin-Name: c11394b50d0687b6d6abad9c80d5cd3cdce77e9b9c278f40601c460f463744a1

20 months agoFix the use of an uninitialized value that occurs when doing a json_insert()
drh [Wed, 11 Oct 2023 17:24:31 +0000 (17:24 +0000)] 
Fix the use of an uninitialized value that occurs when doing a json_insert()
of a string value that contains embedded U+0000 characters.

FossilOrigin-Name: d3c0cbb90966316be9cd25e3edb501da42731e8a83c13227b90ce17d3975a2c3

20 months agoAdd (prepare, step, reset, finalize) parts of the JNI level-2 stmt wrapper and associ...
stephan [Wed, 11 Oct 2023 13:52:05 +0000 (13:52 +0000)] 
Add (prepare, step, reset, finalize) parts of the JNI level-2 stmt wrapper and associated tests.

FossilOrigin-Name: a7082f186f2b9b6666bbc65f2eadeb74d91fa0a681e3b2468b261ffd322bd249

20 months agoSimplification to sqlite3ApiExit(). Generates identical machine code, but
drh [Wed, 11 Oct 2023 13:34:18 +0000 (13:34 +0000)] 
Simplification to sqlite3ApiExit().  Generates identical machine code, but
easier for humans to read.

FossilOrigin-Name: 793bbfa5af9721bc3a61e8e5eda46dfce2f5ff3f223a7564c9e1b09f11e53cb3

20 months agoFix a bug in the mkautoconfamal.sh script, introduced by check-in [3308fdda4b81c110]
drh [Tue, 10 Oct 2023 15:33:05 +0000 (15:33 +0000)] 
Fix a bug in the mkautoconfamal.sh script, introduced by check-in [3308fdda4b81c110]
so that the "snapshot-tarball" and "amalgamation-tarball" makefile targets
work again when run from outside of the source tree.

FossilOrigin-Name: 65ccf5fef812d43aed9e00af36c90e1a499d197e30148753790445e25ee1324c

20 months agoStart adding tests for the second JNI layer.
stephan [Tue, 10 Oct 2023 12:16:04 +0000 (12:16 +0000)] 
Start adding tests for the second JNI layer.

FossilOrigin-Name: 0177f4dfe8a5c03c1d5dd279c6babe5a87b596c2351373f845b89fc6abf7947b

20 months agoUse snprintf() in place of sprintf() in a debugging function in the CLI.
drh [Mon, 9 Oct 2023 22:45:10 +0000 (22:45 +0000)] 
Use snprintf() in place of sprintf() in a debugging function in the CLI.

FossilOrigin-Name: 5e5e4d2b4958c329578d1e5af4ed25c1b774f0ed2d15fa6747d7d7fbbba4fa46

20 months agoAvoid calling sqlite3_randomness and taking the PRNG mutex when writing a journal...
dan [Mon, 9 Oct 2023 17:54:34 +0000 (17:54 +0000)] 
Avoid calling sqlite3_randomness and taking the PRNG mutex when writing a journal header in "journal_mode=memory" mode.

FossilOrigin-Name: c84e4483cb44f827416d8caafa22f076b2f31b2024fe8c5b5bcb0c9955149d11

20 months agoAdd a TCL script that does various verification checks on the source tree
drh [Mon, 9 Oct 2023 14:56:15 +0000 (14:56 +0000)] 
Add a TCL script that does various verification checks on the source tree
to make sure that generated code has been updated correctly.

FossilOrigin-Name: 1f1a358af77f4386f98010eeae8487e6d39548a6dfe58c2664552490e7661122

20 months agoFix a compiler warning caused by the previous check-in.
drh [Mon, 9 Oct 2023 14:47:25 +0000 (14:47 +0000)] 
Fix a compiler warning caused by the previous check-in.

FossilOrigin-Name: 7e8768bf8b4002b1c287f2bc95262548e2ae81b437936154f2bb1ea1f739a904

20 months agoTurn on SEH by default when building using MSVC.
drh [Mon, 9 Oct 2023 14:05:21 +0000 (14:05 +0000)] 
Turn on SEH by default when building using MSVC.

FossilOrigin-Name: f57e8275cf1ab3ad8027044cda0893282d1c403a5aa9fabbb1c7de280597b5cd

20 months agoFix a potential UAF caused by JSON parser cache spill.
drh [Mon, 9 Oct 2023 12:46:53 +0000 (12:46 +0000)] 
Fix a potential UAF caused by JSON parser cache spill.
[forum:/forumpost/b25edc1d46|Forum post b25edc1d46].

FossilOrigin-Name: a163fecca90cab9d1b7bf8ebac78d498775eed7b6d81e7920e3401633c3a4b60

20 months agoFlesh out the error state captured by SqliteException.java. Doc additions.
stephan [Mon, 9 Oct 2023 12:45:28 +0000 (12:45 +0000)] 
Flesh out the error state captured by SqliteException.java. Doc additions.

FossilOrigin-Name: 5c5397ff15543f4b3620244d9e57e15708eafcab1d42c9f87b4a60f0c01e8858

20 months agoFix harmless compiler warning in the test module for sessions.
drh [Mon, 9 Oct 2023 12:39:59 +0000 (12:39 +0000)] 
Fix harmless compiler warning in the test module for sessions.

FossilOrigin-Name: 3d5ec99397c183cfb8c5d31e1967e0df8a4d6edbea92bbdf728571e3a6a36d68

20 months agoAdd JNI Sqlite and SqliteException classes. Add Tester2.java as the main test app...
stephan [Mon, 9 Oct 2023 11:46:32 +0000 (11:46 +0000)] 
Add JNI Sqlite and SqliteException classes. Add Tester2.java as the main test app for the high-level API.

FossilOrigin-Name: 6acf52be7abce8dcf434c5ebf0d5e88859b033e6418077846247ecf00ccf9381

20 months agoMinor JNI doc and public/private cleanups.
stephan [Mon, 9 Oct 2023 10:44:10 +0000 (10:44 +0000)] 
Minor JNI doc and public/private cleanups.

FossilOrigin-Name: c49d36ece283274963ce2e5a4db1e8f586dffa22e47f4adb93c625f918c3fd5d

20 months agoRename SQLite3Jni to CApi to (A) reduce name prefix collisions with incoming classes...
stephan [Mon, 9 Oct 2023 10:30:54 +0000 (10:30 +0000)] 
Rename SQLite3Jni to CApi to (A) reduce name prefix collisions with incoming classes and (B) align with its counterpart in the JS build. Remove the Canonical annotation because (A) the new code separation will inherently make that distinction and (B) the line between truly canonical and semi-canonical (e.g. differing in signature overloads) is blurry enough that consistent use of that annocation is becoming an unnecessary burden.

FossilOrigin-Name: ca216b4486aff7d206ebfc3a5e84d48919c282425d4313396bc19313ffca8a0e

20 months agoFix a problem with sqlite3changegroup_schema() and patchsets.
dan [Sat, 7 Oct 2023 17:29:10 +0000 (17:29 +0000)] 
Fix a problem with sqlite3changegroup_schema() and patchsets.

FossilOrigin-Name: c4ab4200dc2538e1132d87d70fd309b26b0da8a918fede1cb09b567ea40ec889

20 months agoAdd the sqlite3changegroup_schema() API. To allow changegroup objects to upgrade...
dan [Sat, 7 Oct 2023 16:32:02 +0000 (16:32 +0000)] 
Add the sqlite3changegroup_schema() API. To allow changegroup objects to upgrade the schema of a changeset/patchset under some circumstances.

FossilOrigin-Name: 03f9e50b15c9c2fb4636dee24c1491c45322578b9fed08c6f4360be07c5c3830

20 months agoFix a problem with the changes on this branch and tables that use an implicit primary... session-alter
dan [Sat, 7 Oct 2023 16:07:02 +0000 (16:07 +0000)] 
Fix a problem with the changes on this branch and tables that use an implicit primary key.

FossilOrigin-Name: 1f9d10235ff32e72074be695049567135b02e681068ce117b66adc14a6214449

20 months agoAdd a test case to prevent a regression of the leak fixed in the previous
drh [Sat, 7 Oct 2023 08:15:47 +0000 (08:15 +0000)] 
Add a test case to prevent a regression of the leak fixed in the previous
trunk check-in.

FossilOrigin-Name: f99ff655d09763c4a22d065041644ece793d84c82c644931e89ccf50c4f4564a

20 months agoFix a resource leak: sqlite3_blob_reopen() was failing to invoke the
drh [Sat, 7 Oct 2023 08:00:54 +0000 (08:00 +0000)] 
Fix a resource leak: sqlite3_blob_reopen() was failing to invoke the
xDel() distructor on a register when it sets that register to the new
rowid.  This was never a problem prior to the large-column cache of
[771fe35074b50b8d] as that destructor was always a no-op.
dbsqlfuzz cd96368deaece480fb94d42427dde053737a650e.

FossilOrigin-Name: 545edd5ecf20a7feb99dc5ce6f338fa1f172c2e17b240cbede497f0729dbd3d7

20 months agoAdd missing source code comments and fix other issues with the new code on this branch.
dan [Fri, 6 Oct 2023 20:39:42 +0000 (20:39 +0000)] 
Add missing source code comments and fix other issues with the new code on this branch.

FossilOrigin-Name: df39fbe9ab87937beb77af353cd55602290b185e222e0a92a3ebf9a9a0b9e2e7

20 months agoUpdate this branch with latest changes from the trunk.
dan [Fri, 6 Oct 2023 19:46:19 +0000 (19:46 +0000)] 
Update this branch with latest changes from the trunk.

FossilOrigin-Name: 897e926a5eaa0eab7e09e5003e4c15c974897be298a18ae85345962dc3f410a1

20 months agoAdd tests for the sqlite3changegroup_schema() API.
dan [Fri, 6 Oct 2023 19:01:43 +0000 (19:01 +0000)] 
Add tests for the sqlite3changegroup_schema() API.

FossilOrigin-Name: 5dab481c101b1523b1cfde92678cbc654ea26d946bf29da372d71c1f89cbaf46

20 months agoRemove an unused parameter from the recomputeColumnsNotIndexed() routine in
drh [Fri, 6 Oct 2023 12:55:53 +0000 (12:55 +0000)] 
Remove an unused parameter from the recomputeColumnsNotIndexed() routine in
order to squash a harmless compiler warning.

FossilOrigin-Name: 9bf4bfd68080367b58594e0d44b110b3ee9766420f648537fd7bc638dacefb72

20 months agoEnsure that all fields of static sqlite3_module objects are explicitly
drh [Fri, 6 Oct 2023 12:51:05 +0000 (12:51 +0000)] 
Ensure that all fields of static sqlite3_module objects are explicitly
initialized, in order to hush-up nuisance compiler warnings.

FossilOrigin-Name: f3b3d712d6e58b1cb8fdebd2b6b3125080b6b3ac8c7c849a8cc1e5e778d62fe7

20 months agoRemove and unused static variable from shell.c.in in order to silence a
drh [Fri, 6 Oct 2023 12:22:14 +0000 (12:22 +0000)] 
Remove and unused static variable from shell.c.in in order to silence a
harmless compiler warning.

FossilOrigin-Name: 477577120b897bf15edc2a85e220d5c64a1d5a245354939269f6753d8140ac95

20 months agoIncrease the size of some variables associated with the PMA sorter in order
drh [Fri, 6 Oct 2023 12:15:01 +0000 (12:15 +0000)] 
Increase the size of some variables associated with the PMA sorter in order
to avoid any possibility of a signed integer overflow.
[https://bugs.chromium.org/p/chromium/issues/detail?id=1489025|Chromium fuzzer issue 1489025].

FossilOrigin-Name: dc3be3af471d90dd810c1e2cc59e83cf6a57f01971b1258ea0da402e4d577ef2

21 months agoAdd the sqlite3changegroup_schema() API. To allow changegroups to handle differences...
dan [Thu, 5 Oct 2023 19:09:23 +0000 (19:09 +0000)] 
Add the sqlite3changegroup_schema() API. To allow changegroups to handle differences in schema created by ALTER TABLE ADD COLUMN.

FossilOrigin-Name: 309deee2dd8dd07623fce79f6bb62d5279d140dd0be3b34bc42af20b0507726b

21 months agoImproved detection of corrupt databases in balance_nonroot().
drh [Thu, 5 Oct 2023 11:06:10 +0000 (11:06 +0000)] 
Improved detection of corrupt databases in balance_nonroot().
dbsqlfuzz d1cf013c50a620b68c2a5bd240d29afd65e5f58e.

FossilOrigin-Name: a2464bbb825b5976ef974a2e6c17ea150f5e6fcd0dd0f144b9f9c1c22a9c9c82

21 months agoDo not squelch exceptions from SAHPool VFS importDb() - rethrow them. Problem reporte...
stephan [Thu, 5 Oct 2023 11:04:49 +0000 (11:04 +0000)] 
Do not squelch exceptions from SAHPool VFS importDb() - rethrow them. Problem reported in [forum:c80fc578809b80a3|forum post c80fc578809b80a3].

FossilOrigin-Name: 325bcdea4a436e514d83095d3893caf07a714b718e1b643507179b101c108e3b

21 months agoRemove a stray blank line from the beginning of btree.c. No functional
drh [Thu, 5 Oct 2023 10:35:51 +0000 (10:35 +0000)] 
Remove a stray blank line from the beginning of btree.c.  No functional
code changes.

FossilOrigin-Name: c89983dcfc208faa86b31717144c069572598e9770228264d69a044a84bde277

21 months agoAllow a session object to generate a changeset, even if columns were added to one...
dan [Wed, 4 Oct 2023 21:15:24 +0000 (21:15 +0000)] 
Allow a session object to generate a changeset, even if columns were added to one of the tables using ALTER TABLE ADD COLUMN while the changeset was being collected.

FossilOrigin-Name: a3f435eccf3a2aa11cb7420e94af5efcdfa04e9c169c5aaf61fa5cdcb165ceef

21 months agoThe Makefile distinguishes between tcl8.4 and tcl8.5. Some makefile targets
drh [Wed, 4 Oct 2023 12:49:08 +0000 (12:49 +0000)] 
The Makefile distinguishes between tcl8.4 and tcl8.5.  Some makefile targets
require tcl8.5, but others (ex: "sqlite3.c", "shell.c", and "sqlite3") require
only tcl8.4.

FossilOrigin-Name: 770308db9776b8c0a70b8807463e89a9eddfe5552e25e67324cd303dc974f50e

21 months agoModify the main makefile so that it fails with an error if the tclsh found
drh [Wed, 4 Oct 2023 11:52:44 +0000 (11:52 +0000)] 
Modify the main makefile so that it fails with an error if the tclsh found
by ./configure is not tclsh 8.5 or later.
[forum:/forumpost/4380363682708ece|Forum post 4380363682708ece].

FossilOrigin-Name: 1765f3b5a00a8ca20a7b9e18ac7f9d7de0679470b234b83aea83aa5b4d4d34e6

21 months agoJNI: when fetching text-or-blob/length pairs, fetch the text-or-blob first, then...
stephan [Mon, 2 Oct 2023 17:12:16 +0000 (17:12 +0000)] 
JNI: when fetching text-or-blob/length pairs, fetch the text-or-blob first, then the length, as the API docs suggest.

FossilOrigin-Name: e4f9d3946fa570bccea2de17c5536901bdabd46cfe25678fdd37ba0e2bfd99b1

21 months agoFix the length of the string in the new concat() and concat_ws() functions.
drh [Mon, 2 Oct 2023 17:06:28 +0000 (17:06 +0000)] 
Fix the length of the string in the new concat() and concat_ws() functions.

FossilOrigin-Name: 325243226520376f4a142864ae3fb98866f25bff4dc50a6b648ef98428a7169f

21 months agoRemove an ALWAYS() from a branch that can in fact be false following an OOM
drh [Mon, 2 Oct 2023 15:56:37 +0000 (15:56 +0000)] 
Remove an ALWAYS() from a branch that can in fact be false following an OOM
fault.

FossilOrigin-Name: 3a1feb1c469d3dd50e2558581199b16bfd59b9d5bcb0de5f1a8f0ec30a17b4d1

21 months agoPointer-casting-related fixes for JNI on 32-bit ARM (pi4 armv7l).
stephan [Mon, 2 Oct 2023 14:44:28 +0000 (14:44 +0000)] 
Pointer-casting-related fixes for JNI on 32-bit ARM (pi4 armv7l).

FossilOrigin-Name: 54441039ae3ebe39e42f008f77ce1be117cbda6daeed8b01739ad42a3c1f0754

21 months agoAdd JNI binding for sqlite3_normalized_sql().
stephan [Sun, 1 Oct 2023 12:15:38 +0000 (12:15 +0000)] 
Add JNI binding for sqlite3_normalized_sql().

FossilOrigin-Name: 2532e5662a2bbb3e6b4c4be3fad035734b684bdf59b178cb64b444ca6d8b956b

21 months agoMake JNI binding of sqlite3_value_frombind() return boolean instead of int and add...
stephan [Sun, 1 Oct 2023 11:53:40 +0000 (11:53 +0000)] 
Make JNI binding of sqlite3_value_frombind() return boolean instead of int and add tests for it.

FossilOrigin-Name: 906e2ed3e9647f5c2355e9fea2beee141767cae7016da9fa1fe88283726b9369

21 months agoFix JNI binding to compile without SQLITE_ENABLE_PREUPDATE_HOOK. Add build option...
stephan [Sat, 30 Sep 2023 17:08:29 +0000 (17:08 +0000)] 
Fix JNI binding to compile without SQLITE_ENABLE_PREUPDATE_HOOK. Add build option to disable all optional ENABLE flags.

FossilOrigin-Name: c04022b7407f77eaf0175e831ebcd6bbdc0af1cef0d42c5c11102aa8484f24ca

21 months agoMake all SQLite3Jni methods which take a void-pointer-as-long-int argument explicitly...
stephan [Sat, 30 Sep 2023 16:19:57 +0000 (16:19 +0000)] 
Make all SQLite3Jni methods which take a void-pointer-as-long-int argument explicitly package-private, as they're always for internal use only even if SQLite3Jni is eventually made public.

FossilOrigin-Name: 5e387275f69ab2d3159b4b67b8cbfc6270410b61e5ac1f988616e8d051f6572e

21 months agoJNI: rename sqlite3_errmsg16() to sqlite3_errmsg(), as the 16 suffix is superfluous...
stephan [Sat, 30 Sep 2023 14:48:21 +0000 (14:48 +0000)] 
JNI: rename sqlite3_errmsg16() to sqlite3_errmsg(), as the 16 suffix is superfluous there.

FossilOrigin-Name: df25b21689de84b7b8c940df39461d3d88f592f0ba2dddcfcbb0bebcea6ee7da

21 months agoExpose sqlite3_stmt_busy() to JNI.
stephan [Sat, 30 Sep 2023 14:34:55 +0000 (14:34 +0000)] 
Expose sqlite3_stmt_busy() to JNI.

FossilOrigin-Name: 5733aa5fe341d50b84baebd8803a86e381bb95959a8bc733b8fff6fd4e732867

21 months agoCorrect an undefined-value deref in the JS bindings, triggered by passing invalid...
stephan [Sat, 30 Sep 2023 13:13:23 +0000 (13:13 +0000)] 
Correct an undefined-value deref in the JS bindings, triggered by passing invalid args and then tripping over an undefined value while trying to report that. Reported in [forum:dd42df144651d779|forum post dd42df144651d779].

FossilOrigin-Name: fd4632540717c4771ac9ae1fe4400091a2cd0553639bf809abaf4ecbc54de4f0

21 months agoMake (almost) all SQLite3Jni.sqlite3_... members public but make the SQLite3Jni class...
stephan [Sat, 30 Sep 2023 10:59:18 +0000 (10:59 +0000)] 
Make (almost) all SQLite3Jni.sqlite3_... members public but make the SQLite3Jni class package-private, which has the same foot-protection effect but makes it much simpler to patch SQLite3Jni to publicize the interface later. Remove some of the extraneous foot-shooting protection from indidivual functions, in lieu moving it to the still-pending higher-level interfaces.

FossilOrigin-Name: 082b86683e77b2d4a30e1515552f52511324ef97c43b622b4dab7975ae9fbd7d

21 months agoMerge in and close jni-ptr-passing branch. The remaining pointer-passing adaptation...
stephan [Sat, 30 Sep 2023 10:37:36 +0000 (10:37 +0000)] 
Merge in and close jni-ptr-passing branch. The remaining pointer-passing adaptation can be done incrementally without affecting the interface.

FossilOrigin-Name: 7927c42410ba0d5fc8e6e08caaa5cbaaeb359869f17d1afaa082f1aa47fdb2fc

21 months agoMake all native JNI sqlite3_...() bindings package-private as a foot-shooting protect... jni-ptr-passing
stephan [Sat, 30 Sep 2023 10:31:56 +0000 (10:31 +0000)] 
Make all native JNI sqlite3_...() bindings package-private as a foot-shooting protective measure (higher-level pre-native-call argument validation is largely pending). Move SQLTester.java and TesterFts5.java into the org.sqlite.jni package so that they can access the being-tested methods.

FossilOrigin-Name: ec82f7251acab7df40755ef5f456f36fe49b59e63a20be59bd610fc4280ba8cd

21 months agoMore work towards the new pointer-passing mechanism in JNI, and code-adjacent cleanups.
stephan [Sat, 30 Sep 2023 09:41:58 +0000 (09:41 +0000)] 
More work towards the new pointer-passing mechanism in JNI, and code-adjacent cleanups.

FossilOrigin-Name: 6c63987e893357dc8b10decaa96c30fb37b75481640a303e77a0d8224354491e

21 months agoAdd test case to ensure the assert() removed by [f090af77] no longer fails.
dan [Fri, 29 Sep 2023 15:56:40 +0000 (15:56 +0000)] 
Add test case to ensure the assert() removed by [f090af77] no longer fails.

FossilOrigin-Name: 615ab71761754b072439f92e73fdb98c916b820937bcca8904f4be34936d5f9c

21 months agoRemove an incorrect assert().
drh [Fri, 29 Sep 2023 15:53:55 +0000 (15:53 +0000)] 
Remove an incorrect assert().

FossilOrigin-Name: f090af775f6d2ce8b50850f5c9e33546bcb9cff5467d99ca210530cb7ca83d5b

21 months agoJNI: correct a NullPointerException triggered via SQLTester.
stephan [Thu, 28 Sep 2023 20:34:28 +0000 (20:34 +0000)] 
JNI: correct a NullPointerException triggered via SQLTester.

FossilOrigin-Name: 0a873de76c0cbcd8e2eda3f0508e427f1dcb32b01798687c0545acfe10102179

21 months agoClarify serialization API doc w.r.t. buffer validity and usage, instigated by [forum...
larrybr [Thu, 28 Sep 2023 15:00:25 +0000 (15:00 +0000)] 
Clarify serialization API doc w.r.t. buffer validity and usage, instigated by [forum:/forumpost/8922e2ad2ad41205|forum post 8922e2ad2ad41205]. No code changes.

FossilOrigin-Name: b488b9fb71652eca90d2bf73d32f3d748badf517859dc833c58e021b0e017194

21 months agoAdapted the JNI bindings for the sqlite3_value_...() and (pre)update hook APIs to...
stephan [Thu, 28 Sep 2023 11:19:37 +0000 (11:19 +0000)] 
Adapted the JNI bindings for the sqlite3_value_...() and (pre)update hook APIs to the new pointer-passing mechanism.

FossilOrigin-Name: 4182f0275d5d65e04a130eeef4d44642a5ffeeb4b84430d240ea2605345f1404

21 months agoConvert the remaining macro-generated JNI bindings to the new pointer-passing mechanism.
stephan [Thu, 28 Sep 2023 10:50:26 +0000 (10:50 +0000)] 
Convert the remaining macro-generated JNI bindings to the new pointer-passing mechanism.

FossilOrigin-Name: 250fd6ae806cf705c0f29ad30ad8fb885b12590848e7adae63bc21d874c6d3bd

21 months agoConvert the macro-generated JNI bindings which take a db pointer to the new pointer...
stephan [Thu, 28 Sep 2023 10:27:01 +0000 (10:27 +0000)] 
Convert the macro-generated JNI bindings which take a db pointer to the new pointer-passing mechanism.

FossilOrigin-Name: 5f47fb77db4ee77afc541e680559ad88e66ba7fd04b830e70f8be92cf8d0a60c

21 months agoAdapted JNI sqlite3_blob_...() and sqlite3_close...() to the new pointer-passing...
stephan [Wed, 27 Sep 2023 14:41:49 +0000 (14:41 +0000)] 
Adapted JNI sqlite3_blob_...() and sqlite3_close...() to the new pointer-passing mechanism.

FossilOrigin-Name: 0b22c8ef93e5ccd45316099fb8575e27620158b1992c0c70fe0348cfc10147f8

21 months agoAdapt JNI sqlite3_bind_...() bindings to the new pointer-passing method and correct...
stephan [Wed, 27 Sep 2023 11:01:32 +0000 (11:01 +0000)] 
Adapt JNI sqlite3_bind_...() bindings to the new pointer-passing method and correct the mapping of sqlite3_bind_zeroblob64() to use zeroblob64() instead of zeroblob(). Related internal API renaming.

FossilOrigin-Name: 980d559fff6e55d1e2ef39f242a8a09313a936cfb141807db475bcceff924869

21 months agoAdd missing license headers to JNI annotation classes and extend the definition of...
stephan [Wed, 27 Sep 2023 10:29:07 +0000 (10:29 +0000)] 
Add missing license headers to JNI annotation classes and extend the definition of @NotNull to include 0L as the equivalent of null to account for the current rework of how pointers are passed from Java to C.

FossilOrigin-Name: bccdfeb9efde20410bde545893fb98ce5c0c4d04a8e7797b868ba8994120e1db

21 months agoRework the JNI sqlite3_backup APIs to the new pointer-passing approach.
stephan [Wed, 27 Sep 2023 09:58:36 +0000 (09:58 +0000)] 
Rework the JNI sqlite3_backup APIs to the new pointer-passing approach.

FossilOrigin-Name: 48aeb1e2cdeb4aec85c4f63a1f809215cd4b473791169e72b5ddf6d6bdc2f7b7

21 months agoStart reworking JNI methods such that they pass void pointers from Java to C instead...
stephan [Tue, 26 Sep 2023 21:37:52 +0000 (21:37 +0000)] 
Start reworking JNI methods such that they pass void pointers from Java to C instead of passing their strongly-typed wrappers, as that is reportedly significantly faster than passing the wrapper objects to C and extracting the pointers there. There are still many, many functions left to rework for this.

FossilOrigin-Name: 66c814dd473731703ee00e1ff610acfdccf09d1b87dd2355795ed697d4ed5d3e

21 months agoFix harmless compiler warnings in the testfixture testing utility.
drh [Tue, 26 Sep 2023 21:22:46 +0000 (21:22 +0000)] 
Fix harmless compiler warnings in the testfixture testing utility.

FossilOrigin-Name: 5a39a02d2dfd9ed6171cd0bd434b2bc268d0ed8ead6e1a396d1603266d9493ef

21 months agoJNI: implement AutoCloseable for the sqlite3 and sqlite3_stmt classes, and adjust...
stephan [Tue, 26 Sep 2023 19:49:35 +0000 (19:49 +0000)] 
JNI: implement AutoCloseable for the sqlite3 and sqlite3_stmt classes, and adjust a few tests to use it. Override Object.finalize() for sqlite3 class but not sqlite3_stmt (where it triggers a JVM crash for as-yet-unknown reasons).

FossilOrigin-Name: b633d8bbdbd43464ee03058c273e5188117b9538ed5d5148a1a3851e4adf6410

21 months agoFix yet another assert() in the partial-index constant value optimization.
drh [Tue, 26 Sep 2023 19:38:24 +0000 (19:38 +0000)] 
Fix yet another assert() in the partial-index constant value optimization.

FossilOrigin-Name: f459d0806cf044fd07743e4c91d0a5a6ddf45b3b41004bde4278f190d99a4cf5

21 months agoRemove a NEVER() from a condition in the partial-index constant value optimization...
dan [Tue, 26 Sep 2023 19:26:47 +0000 (19:26 +0000)] 
Remove a NEVER() from a condition in the partial-index constant value optimization that can sometimes be true.

FossilOrigin-Name: 63aea8c3e0605edcf49ad1e5ce1a56d2690dcb8c4857043997545daab46ca035

21 months agoRemove unreachable code from the partial-index constant value optimization
drh [Tue, 26 Sep 2023 14:57:30 +0000 (14:57 +0000)] 
Remove unreachable code from the partial-index constant value optimization
([8d4160910d651246]).

FossilOrigin-Name: 7ad38254c37153efa72291d09800693ca60894359548eda877d59defa8c70d49

21 months agoRemove some outdated JNI docs.
stephan [Tue, 26 Sep 2023 09:46:04 +0000 (09:46 +0000)] 
Remove some outdated JNI docs.

FossilOrigin-Name: 2ca5cbbb2a8ee94fe9f4888dea695a4429aefa17611fd9ebe59bf4866290ab0c

21 months agoMinor JNI doc updates. No code changes.
stephan [Tue, 26 Sep 2023 07:43:51 +0000 (07:43 +0000)] 
Minor JNI doc updates. No code changes.

FossilOrigin-Name: 63687cc659f06a1f6aa9d4496ef01d9f0adbee6184b8e265fb8feec1ad30449b

21 months agoIn partial index scans, if the WHERE clause implies a constant value for a table...
dan [Mon, 25 Sep 2023 17:46:02 +0000 (17:46 +0000)] 
In partial index scans, if the WHERE clause implies a constant value for a table column, replace occurences of that table column with the constant. This increases the likelihood of the partial index being a covering index.

FossilOrigin-Name: 8d4160910d6512469cb0a060b89c2509dde1c8e33d9358034d7fb39cd494eabe

21 months agoAnother very minor tweak to code on this branch to save cycles. partial-index-terms
dan [Mon, 25 Sep 2023 17:21:53 +0000 (17:21 +0000)] 
Another very minor tweak to code on this branch to save cycles.

FossilOrigin-Name: 2c805dc68112db7f06aea56a731a33e046e876851bdda3e725ba96f6da1bf2ee

21 months agoChange the order of an if..else... in new code to make it slightly faster.
dan [Mon, 25 Sep 2023 15:25:49 +0000 (15:25 +0000)] 
Change the order of an if..else... in new code to make it slightly faster.

FossilOrigin-Name: f80dc64483a54a488e507da140836261ae1b864577cc95d8e869919d5a25e73c

21 months agoEnable -Wall for the compiler on --enable-debug builds.
drh [Mon, 25 Sep 2023 14:20:07 +0000 (14:20 +0000)] 
Enable -Wall for the compiler on --enable-debug builds.

FossilOrigin-Name: 63a7b521390001939909d43d908af78f7df7cb92272d2b74f038da918c2bef05

21 months agoFix a bad interaction between LEFT JOIN, bloom filters and partial indexes.
dan [Mon, 25 Sep 2023 11:12:39 +0000 (11:12 +0000)] 
Fix a bad interaction between LEFT JOIN, bloom filters and partial indexes.

FossilOrigin-Name: 5775f92b31f0539c66d37e50689bec17a82c0e857a781331c03e34bc18157087

21 months agoResolve the JNI FTS5 test5() failure and remove some nearby dead code.
stephan [Sun, 24 Sep 2023 19:13:31 +0000 (19:13 +0000)] 
Resolve the JNI FTS5 test5() failure and remove some nearby dead code.

FossilOrigin-Name: 5655c51f103c6dfade799ffb5ca2eb21b4360ada598741f373c952ae732535aa

21 months agoAdd extra tests for changes on this branch.
dan [Sat, 23 Sep 2023 21:31:40 +0000 (21:31 +0000)] 
Add extra tests for changes on this branch.

FossilOrigin-Name: cb45f5b070cfdbb4358e8e909b0b34d658b5925db06e282b38046298a159c545

21 months agoAvoid an error when parsing a schema that contains indexes with WHERE clauses contain...
dan [Sat, 23 Sep 2023 19:25:03 +0000 (19:25 +0000)] 
Avoid an error when parsing a schema that contains indexes with WHERE clauses containing unknown collation sequences.

FossilOrigin-Name: d5dd39e37ab994ce5d75688a40c6494c17807431529e85eb2b11d58f367fe232

21 months agoFix a failing assert() caused by changes on this branch.
dan [Sat, 23 Sep 2023 18:52:22 +0000 (18:52 +0000)] 
Fix a failing assert() caused by changes on this branch.

FossilOrigin-Name: d0e21f20bd8643d21c4b88fb75b83939d68e9b7118f7289a164656f11d2ee555

21 months agoFix a harmless compiler warning.
drh [Sat, 23 Sep 2023 18:49:30 +0000 (18:49 +0000)] 
Fix a harmless compiler warning.

FossilOrigin-Name: 7c4210253b660b385d14de3ae7ab30f038036308e1164ec17b40e2805b9b2235