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.
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().
CLI .import to accept EOF in lieu of record terminator on last field of CSV (with multiple field records), per RFC 4180. [forum:5b21c25bdfa|forum post 5b21c25bdfa]
dan [Tue, 12 Sep 2023 18:36:46 +0000 (18:36 +0000)]
Fix a use-after-free error in fts5 that could occur when querying the "rank" column immediately after another connection changes its definition. [forum:a2dd636330|forum post a2dd636330].
64-bit builds on Windows default to using UTF-8 output (as if the -utf8
command-line option had been specified.) 32-bit builds continue to use
Windows code pages. There is also a new -no-utf8 command-line option to
force the use of legacy code pages.
stephan [Sat, 9 Sep 2023 11:20:35 +0000 (11:20 +0000)]
In the JNI build, emit a reminder to not check in the javac-generated sqlite3-jni.h when FTS5 is disabled because changes in that feature flag result in unnecessary and large diffs in checked-in generated code.
Enhance the ./configure script and its associated Makefile.in so that the
--with-linenoise=DIR argument cause the linenoise command-line editing
library located in directory DIR to be linked with the sqlite3 CLI.
Add documentation to sqlite3_get/set_clientdata() to make it clear that these
are security-sensitive interfaces that should not be exposed to potential
attackers.
Add the xIntegrity method to the sqlite3_module object, thus enabling
PRAGMA integrity_check to operate on virtual tables. Make use of this
new method in the FTS3/4, FTS5, and RTREE virtual tables.