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.
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 [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 [Mon, 31 Jul 2023 13:52:46 +0000 (13:52 +0000)]
Experimentally change the JNI sqlite3_trace_v2() callback type to have more convenient access to the current Java-side sqlite3_stmt at the cost of some uncomfortably fiddly current-statement tracking in the JNI layer. Subject to change.
stephan [Mon, 31 Jul 2023 12:10:32 +0000 (12:10 +0000)]
Add some JNI-internal metrics, accessible via passing -v when running Tester1.java. Document an OpenJDK bug which leads to incorrect -Xlint:jni warnings.
stephan [Mon, 31 Jul 2023 10:55:30 +0000 (10:55 +0000)]
Correct a mis-cast in the JNI wrapper which just happened to accidentally work. Update JNI binding of sqlite3_context_db_handle() to return the bound-at-open() db instance instead of a new/temp proxy object.
stephan [Sun, 30 Jul 2023 10:47:38 +0000 (10:47 +0000)]
Internal JNI refacoring to support the pending sqlite3_collation_needed() callback. Correct a bug in the linked-list handling of PerDbStateJni which triggered an assert().