drh [Fri, 13 Oct 2023 22:19:23 +0000 (22:19 +0000)]
Earlier detection of a host of errors in CREATE TABLE, such the CREATE TABLE
statement itself fails, rather than generating an error on the first attempted
use of the created table.
drh [Fri, 13 Oct 2023 13:49:46 +0000 (13:49 +0000)]
Immediately fail a CREATE TABLE statement that attempts to create a
table that has a generated column loop. Legacy allows the table to be
created but the table would not be usable for anything.
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].
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.