drh [Tue, 17 Oct 2023 13:41:41 +0000 (13:41 +0000)]
Fix a JSON bug introduced by the optimization of [df099ad713011b67] and
first appearing in 3.43.0. The problem occurs when doing a JSON_EXTRACT()
on an array element that was added by JSON_SET() without first reparsing.
Reported by [forum:/forumpost/fc0e3f1e2a|forum post fc0e3f1e2a].
drh [Tue, 17 Oct 2023 11:57:36 +0000 (11:57 +0000)]
Enhance the documentation of sqlite3_deserialize() to make it clear that
the input database may not be in WAL mode.
[forum:/forumpost/a7e272cee9ac469f|Forum post a7e272cee9ac469f]
drh [Tue, 17 Oct 2023 10:47:42 +0000 (10:47 +0000)]
When an I/O or similar error occurs during a transaction with
journal_mode=MEMORY, attempt to rollback before closing the journal, as
all rollback information is forgotten when a memory rollback journal is
closed.
stephan [Mon, 16 Oct 2023 13:04:42 +0000 (13:04 +0000)]
JNI: initial draft (untested - requires more infrastructure first) of a UDF argument/result-handling interface which completely hides the C-style API from the client.
stephan [Mon, 16 Oct 2023 10:27:19 +0000 (10:27 +0000)]
JNI: move the C-style API parts into the capi subpackage and the higher-level wrapper into (tentatively) wrapper1, so that CApi.java can support multiple independent higher-level wrappers without name collisions, and CApi can be made public but have the option to be elided from wrapper-level javadocs for wrappers which do not wish to expose it.
stephan [Mon, 16 Oct 2023 08:10:11 +0000 (08:10 +0000)]
JNI: after calling a Java-side UDF, zero-out the pointer of the Java-side sqlite3_context and sqlite3_value array entries to avoid misbehavior if a client makes the mistake of holding a reference to one of those objects.
drh [Sat, 14 Oct 2023 20:24:52 +0000 (20:24 +0000)]
Do not allow an ALTER TABLE ADD COLUMN on a STRICT table if the added column
contains a DEFAULT clause that would violate the type of the added column.
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.
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].
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.