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.
stephan [Thu, 14 Sep 2023 20:02:49 +0000 (20:02 +0000)]
JNI: move XTokenizeCallback interface out of the Fts5 object - that level of indirection is a holdover from when those classes were in the core package.
According to [forum:/forumpost/9f6db917e1|forum post 9f6db917e1], older
MSVC compilers are unable to convert a double directly into an unsigned
long long int, but must first go through a signed long long int. Work
around this by restricting the range of doubles that are converted into
long long integers so that only the lower 63 bits are used.
Do not set the global bUseLongDouble flag based purely on sizeof(long double)
being more than 8. That is a necessary but not sufficient condition to use
the long double routines. Instead, do a run-time test to verify that long
double really does provide extra precision.
Omit the Reinsert algorithm from RTree. This causes most benchmarks to run
faster, at the expense of having a slightly less dense and hence larger index
(example: 33 entries/node versus 34 entries/node).
In the ChooseLeaf algorithm of RTREE, do an initial pass through the cells
of a node looking for solutions that involve no cell enlargement. Only look
for the minimum cell enlargement if the enlargement is non-zero for all cells.
This results in a performance improvement by reducing the number of calls
to cellUnion().