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.
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.
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.
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].
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.
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.
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].
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.
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].
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.
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.
Clarify serialization API doc w.r.t. buffer validity and usage, instigated by [forum:/forumpost/8922e2ad2ad41205|forum post 8922e2ad2ad41205]. No code changes.
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.
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.
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.
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).
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.
stephan [Sat, 23 Sep 2023 06:50:19 +0000 (06:50 +0000)]
Resolve the JNI FTS5 test5() crash, caused by two unrelated typos in JNI callback signature strings. That test now fails with an expected-vs-got mismatch but no longer dies in the native code.
dan [Fri, 22 Sep 2023 20:21:27 +0000 (20:21 +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.
Drop support for the view-scan optimization (check-in [609fbb94b8f01d67]) as
it was causing multiple performance regressions. In its place, reduce the
estimated row count for DISTINCT subsqueries by a factor of 8.
Do not reduce subquery output row count estimates due to DISTINCT until
after the decision of whether or not to use an index for ORDER BY has been
made.
The view-scan optimization was added to enhance the performance of one specific
query, but it causes performance regressions on a host of others. Disable it
(at least temporarily) in order to try to find an alternative way of fixing the
one specific query that it was created to fix - an alternative way that does
not cause performance problems for other unrelated queries.
Do not try to convert a double into an unsigned 64-bit integer, as that does
not work on all platforms. A double can only be converted into a signed
64-bit integer.