stephan [Thu, 10 Aug 2023 13:10:25 +0000 (13:10 +0000)]
Document that auto-extensions registered via JNI will fail if they open a db (to avoid triggering an endless loop in the auto-extensions). Discover the hard way that JDKv19 creates different mangled JNI names for some functions than JDKv8. Start reformatting much of the JNI API decls in prep for making them even longer.
stephan [Thu, 10 Aug 2023 12:36:40 +0000 (12:36 +0000)]
Resolve two assertions in the auto-extension JNI which were triggered via new SQLTester infrastructure. Move SQLTester's db-init SQL injection into an auto-extension.
stephan [Thu, 10 Aug 2023 01:44:48 +0000 (01:44 +0000)]
Move all of the SQLTester code into a single file, since it's only got 1 public class. Remove 'public' from many methods which don't need it. Add more documentation to it.
stephan [Wed, 9 Aug 2023 17:04:58 +0000 (17:04 +0000)]
Move the test command body's trim() back into the TestScript class (to simplify Command-level code) but do it after double-verbose has had the chance to emit it as-is (so that debug output is not mangled by the trim).
stephan [Wed, 9 Aug 2023 16:29:07 +0000 (16:29 +0000)]
Strip --oom commands from SQLTester input since (A) we can't currently do anything with them and (B) they can appear as body content of --testcase commands and the current parser cannot deal with that. If --verbose is provided once, emit the name and args of each command as it's run. If --verbose is used twice or more, also emit the command's body text, if any.
stephan [Wed, 9 Aug 2023 15:46:55 +0000 (15:46 +0000)]
Extend TestScript to be able to report why it should be skipped. Expand the test-skipping rules to account for the current spec doc. Add the {} empty-string case to the spec doc.
stephan [Tue, 8 Aug 2023 22:10:27 +0000 (22:10 +0000)]
Remove the current-statement tracking from the JNI internals because it will break down in the face of client-side mixed-mode native/java code, e.g. in cases like SQLTester. This makes tracing of sqlite3_stmt a micron slower but also reliably correct.
stephan [Tue, 8 Aug 2023 19:20:12 +0000 (19:20 +0000)]
When SQLTester hits an unknown command, emit a warning and skip the rest of that script instead of aborting the whole run, per /chat discussion. Reduce verbosity a bit.
drh [Tue, 8 Aug 2023 14:49:16 +0000 (14:49 +0000)]
Updates to the test script interpreter spec: Rather than failing immediately
upon encountering an incompatibility, simply abandon the rest of that particular
input file.
dan [Mon, 7 Aug 2023 17:09:25 +0000 (17:09 +0000)]
Enhance sqlite3_vtab_nochange() so that it works with "UPDATE ... FROM ..." statements. Use this to allow some updates on fts5 contentless-delete tables.
dan [Mon, 7 Aug 2023 16:15:56 +0000 (16:15 +0000)]
Changes so that sqlite3_vtab_nochange() works with "UPDATE ... FROM...". Use this to allow UPDATE on a contentless fts5 table if new values are supplied for all indexed columns.
stephan [Mon, 7 Aug 2023 11:18:44 +0000 (11:18 +0000)]
When converting a Java exception to a db error message, use Throwable.toString() instead of getMessage() so that the exception type's name is included. More internal API renaming for consistency.
stephan [Mon, 7 Aug 2023 09:44:00 +0000 (09:44 +0000)]
Rename fts5_api pContext parameters to pUserData, per /chat discussion. This is a cosmetic change made to reduce confusion between those parameters and the two other context-type parameters in that API.
stephan [Sun, 6 Aug 2023 22:09:09 +0000 (22:09 +0000)]
Rework the sqlite3_open(_v2)() order of operations so that pending auto-extension support can get ahold of the open-time Java state despite the Java/C (sqlite3*) binding not having yet been established.
stephan [Sun, 6 Aug 2023 21:29:13 +0000 (21:29 +0000)]
Completely rework how the JNI sqlite3_open(_v2) and sqlite3_prepare(_vN)() bindings deal with output pointers to give the JNI side full control over the origin of db and stmt handles (necessary for solving chicken/egg situations in auto-extensions and prepare-time trace). Lots of adjacent internal API renaming.
stephan [Sun, 6 Aug 2023 20:01:30 +0000 (20:01 +0000)]
Start adding JNI-side support for auto extensions, but hit a brick wall which requires slightly awkward semantics changes in the JNI bindings for sqlite3_open(_v2)() to resolve, so stash this #if'd out for the time being.
stephan [Sun, 6 Aug 2023 11:05:17 +0000 (11:05 +0000)]
Remove doc outdated warning about sqlite3_trace_v2() JNI binding being incompatible with MUTF-8. Use new to-string capability to simplify Fts5ExtensionApi::xColumnText() JNI binding.
stephan [Sun, 6 Aug 2023 10:14:53 +0000 (10:14 +0000)]
Bind sqlite3_db_filename() and (closely related) (A) add many more docs about the UTF-8/MUTF-8 discrepancy (B) start adding internals to enable us to perform the standard-UTF-8-to-Java conversion from C.
stephan [Sat, 5 Aug 2023 21:35:58 +0000 (21:35 +0000)]
Refactor the per-JNIEnv cache from a fixed-size static array to a linked list of dynamically-allocated entries. Uncache all per-db state (which is necessarily JNIEnv-specific) when the corresponding JNIEnv is uncached.
stephan [Sat, 5 Aug 2023 20:19:45 +0000 (20:19 +0000)]
Add SQLite3Jni.uncacheJniEnv(), a way for Java threads to clear their thread-specific cached state from the JNI bindings when they're about to terminate (or are otherwise done using the library).
stephan [Sat, 5 Aug 2023 11:16:54 +0000 (11:16 +0000)]
Bind Fts5ExtensionApi::xUserData() to JNI and extend xCreateFunction() to accept that argument. In test code, use assert() instead of exceptions if assert() is enabled so that test failures (exceptions) thrown via callbacks do not get suppressed (which they otherwise necessarily are to avoid crashing the host app).
stephan [Sat, 5 Aug 2023 00:40:28 +0000 (00:40 +0000)]
Bind the remaining Fts5ExtensionApi methods to JNI, noting that all are completely untested because the higher-level bits needed to do so are still missing.
stephan [Fri, 4 Aug 2023 16:01:55 +0000 (16:01 +0000)]
In the opfs-sahpool VFS's importDb() and exportFile() methods, throw if the actually-wrote/read amounts differ from the expected-to-write/read amounts, per feedback in [forum:a4122e986f|forum post a4122e986f].
drh [Fri, 4 Aug 2023 13:19:11 +0000 (13:19 +0000)]
Fix a bug in the jsonLookup() routine used to search JSON. Bug was
introduced by the recent (unreleased) JSON caching enhancements
check-in [a4c1af616e672a0d] merged into trunk at [df099ad713011b67].