Commit Graph

4342 Commits

Author SHA1 Message Date
stephan
0c2ba994d2 Export sqlite3_(db_)free_memory() and sqlite3_table_column_metadata() to JNI. Further internals renaming for consistency and legibility.
FossilOrigin-Name: 7c86aa3400ed591d38c1828f366f4b5de97954c2b301919d3f06d9c2d3d7d1f2
2023-08-31 14:57:01 +00:00
stephan
7fc4223411 Replace JNI's per-db-instance state tracking with the new sqlite3_set/get_clientdata().
FossilOrigin-Name: e7c11d34ee2eebdca4d9db1496bbb4152e4c62745c083ad5e0337733e8d1254e
2023-08-30 18:45:42 +00:00
stephan
85a05d895a Further tweaking in both SQLTesters.
FossilOrigin-Name: 46b0eb98e7a56cc188836c46f4289de6281f80e6bc6eb33e0aa9133a0f86f00c
2023-08-30 15:51:42 +00:00
stephan
8dd07389ac When a JS SQLTester script throws, report the exception details back to the UI regardless of whether it's fatal.
FossilOrigin-Name: 273d3b05f630d399d42914e95c416b107b4746bbef129cfba9d00fd921666261
2023-08-30 14:20:02 +00:00
stephan
24c32c2e39 Add a JS implementation of Java's SQLTester.
FossilOrigin-Name: b530792a514d95c4e8f93cf2170d9fc4de367055fa1704fc171551c946024fa9
2023-08-30 13:07:35 +00:00
stephan
e621556724 Add a UI, of sorts, to the JS SQLTester.
FossilOrigin-Name: 249e82b9917ea47c56ee1cbd3345a977d335fd3fc0d67a1ef157813ef4571c7c
2023-08-30 11:54:43 +00:00
stephan
ac5e1f82ce Add a mechanism with which to import external SQLTester scripts into the JS testing tool.
FossilOrigin-Name: bb08ba020ce1d86ca6aa92f43d5ae915f67d08fa73120e1f603d150e76166624
2023-08-30 00:22:54 +00:00
stephan
4f1387e9ab Add directives support to JS SQLTester comparable to the Java impl. This brings the two to feature parity.
FossilOrigin-Name: 7cef4a8300826adbdcb3b205e134a4272b12b4aa7dbee97731ac12282a4a9f06
2023-08-29 21:30:37 +00:00
stephan
267c44771f More fleshing out of JS SQLTester.
FossilOrigin-Name: 8c503dfb9fa15389613a819fcc1792e23d3c05f99a9f450f82eac5125298726f
2023-08-29 20:44:40 +00:00
stephan
aa15047796 JS SQLTestRunner can now run the Java impl's core-most sanity tests, missing only support for directives.
FossilOrigin-Name: 5e798369375ce1b0c9cdf831f835d931fbd562ff7b4db09a06d1bdca2ac1b975
2023-08-29 20:01:01 +00:00
stephan
69a55ca17d Get the JS SQLTester command handlers in place sans those which have to run SQL.
FossilOrigin-Name: d21b1217964a53f33b7ba3958b34aa8560dff8ede33e66f54aa0afbab7099ec3
2023-08-29 15:39:57 +00:00
stephan
0fc20a32c0 Get the basic parsing pieces and command dispatching in place in the JS SQLTester.
FossilOrigin-Name: 8fcc2a553c1e26734902bbdee0c38183ee22b7b5c75f07405529bb79db34145a
2023-08-29 13:28:36 +00:00
stephan
524ddc940d Init bits of a port of Java's SQLTester to JS. Far from complete.
FossilOrigin-Name: 60eec5ceda80c64870713df8e9aeabeef933c007f2010792225a07d5ef36baef
2023-08-29 11:22:45 +00:00
dan
b44b802378 Change a variable from "int" to "i64" to make it easier to prove that it cannot overflow.
FossilOrigin-Name: 00a8b3a263f3537588063ce42fad6e21fa343dad850b086d0929ed1617eb44fc
2023-08-29 10:50:11 +00:00
stephan
d10ed826eb Remove some dead code. Add a skeleton SQLTester script for fts5.
FossilOrigin-Name: 6c83e31fa96f65b61377c0c801cc32b3c8ca27a0c8442f860364bec258c003cb
2023-08-29 00:10:31 +00:00
stephan
4e379078e7 Factor out a superfluous struct member.
FossilOrigin-Name: 76d3911c370b3dc02d119045003f87ad20a6efd9f7a44d4feb59b7c801ac8981
2023-08-28 23:18:19 +00:00
stephan
924c4545d3 Further minor internal JNI simplifications.
FossilOrigin-Name: 1808d12ee0d1f1e5ee49d48c699ca10c4f822989ac9b4ac08f2b861513ee5997
2023-08-28 22:52:04 +00:00
stephan
fa23b4fc61 Improve threadability of the JNI collation-related bindings and add infrastructure for similar cases.
FossilOrigin-Name: f02dad66b965b9e3c504001e9603af8f74977f151bede9db369f88e86a4aeb00
2023-08-28 21:27:32 +00:00
stephan
a08f737503 Correct JNI mapping of collations to be 1-db-to-many-collations.
FossilOrigin-Name: b927b0f5a68684b0a9799396d153bf1e2306351e8039c2bacb3d5b2056a0634f
2023-08-28 20:21:56 +00:00
dan
35c7f538e9 Updates to testrunner.tcl so that it runs fuzztest using multiple jobs.
FossilOrigin-Name: ceeabe9f8b31a30c65147fd270b92d43c7842247548cee9de165113991f6c2cf
2023-08-28 20:14:19 +00:00
stephan
ece2d7f2be Remove a pair of what are arguably unnecessary mutex locks (and often hit). More JNI-internal cleanups.
FossilOrigin-Name: ecf07a0144dc6402b1e0924b1775d99dc465b27aa86a2718cac60a9b4c974312
2023-08-28 16:22:31 +00:00
stephan
25e7d8af75 Duplicate code consolidation.
FossilOrigin-Name: 71f239747c7934310dedf9fc0cbf84fbeeed53808234067147335c12396849a1
2023-08-28 14:59:27 +00:00
stephan
bdb149d063 Move a metrics counter so that it can be used to indirectly witness the race condition fix from [f5274e00f17d58e0] by recording varying final values for that metric across consecutive multi-threaded test runs.
FossilOrigin-Name: 54d2209d24547dbb05e7c12daa27211593c34de8005e8adba0989b8d219f5f3b
2023-08-28 13:18:46 +00:00
stephan
4e9b48cfc4 Resolve a JNI-side race condition. Removed a now-extraneous struct member. Internal API renaming for consistency.
FossilOrigin-Name: f5274e00f17d58e075f90ae5c1d4b38933da315e51592171fa35bcbd67b40b2a
2023-08-28 13:06:26 +00:00
stephan
f0e9e59d8d Further JNI cleanups and javadoc additions.
FossilOrigin-Name: c393b1c9f5639c259406e587b3e08efdc1962203001823747681379ffc54fc10
2023-08-28 11:10:13 +00:00
stephan
2597ec6385 Lots of javadoc-related tweaks.
FossilOrigin-Name: cfe06f90e2c0231efded98767ef3cc646d3a7daa34d77b62b7c04b5aae9448fd
2023-08-28 07:28:36 +00:00
stephan
23dfa67c1e Correct a package renaming bug in the previous check-in and start applying the @Canonical annotation to functions to distinguish canonical API functions and Java-specific APIs.
FossilOrigin-Name: 8a016006805b08b72bfc4093c795d8cd8d7fe72f8ae234c175a8b7be3a841cbf
2023-08-28 05:48:34 +00:00
stephan
b041f8ffdd Move the JNI annotations into the annotation subpackage.
FossilOrigin-Name: e4dedf90a92a069daef967dfe975469bf8ec7883c44c95e73345d4eded48e996
2023-08-28 05:39:05 +00:00
stephan
56d3b21317 Resolve a makefile bug which causes sqlite3-worker1-bundler-friendly.mjs to be built incorrectly. Reported in [forum:a874e435cf4690c1|forum post a874e435cf4690c1].
FossilOrigin-Name: 9d68c7ef103b9b51ed35fb91e62351eb6c62ad63ab03ac456ff9787cc83f10ab
2023-08-28 04:59:16 +00:00
stephan
5020ddc243 Reimplement JNI's sqlite3_value_text() as a native instead of a Java-side proxy. Unrelated minor simplifications.
FossilOrigin-Name: 401dd6ee283a4e7da2e50175a1b58e6a83afb0ea2d3b6cf80c7c621e17bcce98
2023-08-27 15:15:46 +00:00
stephan
0639c58836 Generic cleanups in Tester1.java.
FossilOrigin-Name: fbc1b6310b01f4f79439bb6ce59b2aaabd126da7201f36d4fc5d7ef95118a494
2023-08-27 14:47:45 +00:00
stephan
5575d6421b Remove JNI sqlite3_column_java_object(), as the protection rules of sqlite3_values makes it impossible to implement safely. Add JNI sqlite3_bind_java_object().
FossilOrigin-Name: 29bd4a23a4afd96b2cc06d2b91a4f30c0bbf2347af0b0d18f8d4cf8aafa63160
2023-08-27 13:43:45 +00:00
stephan
88bd53dfd0 Correct the signature mismatch between JNI sqlite3_column/value_text16() and add related tests.
FossilOrigin-Name: 77f6e70f17c0cb6d031f983c458c9ec2e88d92b4716397533a029af39da2d128
2023-08-27 11:28:57 +00:00
stephan
95f5d85d4a Make JNI sqlite3_trace_v2() thread-safe. Re-add a piece removed in [bae4d022aad9b] to work around a JVM crash which is unpredictably triggered by its substitute. Fix the THREADMODE=0 JNI build. Further internal API simplifications.
FossilOrigin-Name: 3f9f7a9cb08b0687ad206605a5109306762df9ae8bdeab2d8d60bf9373c9ad32
2023-08-27 10:40:00 +00:00
stephan
32a79760b5 Factor out an unnecessary struct member. JNI sqlite3_shutdown() now frees up the various object-recycling bins. Doc touchups.
FossilOrigin-Name: bae4d022aad9bbeb78cb027ecad799af87afe331e697add44ec22297c873141d
2023-08-27 09:12:50 +00:00
stephan
60aca33a8b Factor out a superfluous JNI class. Doc and code style cleanups.
FossilOrigin-Name: 0f37f27148dfa93ecc42381ad3455a9059285d1af2df027429044942dc4d861b
2023-08-27 08:10:59 +00:00
stephan
0f4bf3435a JNI code reorgs and simplify the failing-alloc interface a bit.
FossilOrigin-Name: deed5797de65a25896e991a441f0d05eb92662536296485920fb081e84ad5d32
2023-08-27 07:26:33 +00:00
stephan
c7e7c88873 Apply the JNI OOM checks to memory returned by JDK APIs, as distinct from our APIs.
FossilOrigin-Name: 1ff78582bfd934e0c76464b5f23ed9bf09a3491b145e0ca34acb6e59c4f53995
2023-08-26 22:34:26 +00:00
stephan
0deaea218d Eliminate a superfluous JNI-internal middle-man class.
FossilOrigin-Name: daede0f801f59d6501a863c4688e4635b34171e98b56b8ab4432c779113f1997
2023-08-26 21:13:57 +00:00
dan
1f1169ad09 Updates to testrunner.tcl so that it runs "make fuzztest" using multiple jobs.
FossilOrigin-Name: 7596ea7074e0ac73312586ed3d28cdacf97f54b8af73f804cbc8066c94d4b4ef
2023-08-26 21:04:54 +00:00
stephan
506a8b52f3 Whether or not OOM is always fatal in JNI is now a compile-time option.
FossilOrigin-Name: 320a34c080d8bc1feae1578697923dfa7c4144b78de36f704c24cc4a4ce9d535
2023-08-26 21:02:50 +00:00
stephan
6428cd18d6 Correct a string length misuse in JNI sqlite3_result_error() in an OOM case. Unrelated minor JNI cleanups.
FossilOrigin-Name: 4252f56f3d8574b7b43306440726daf3b5f5500d5d9105784b2f82753e7c71dd
2023-08-26 19:34:49 +00:00
stephan
6a1ebbdb90 Remove a bunch of commented-out debug output.
FossilOrigin-Name: b49488481e2952294960bb0ee971f6eca126c19d68ef92152894aa28393e6865
2023-08-26 18:15:33 +00:00
stephan
220b6145f5 Re-order some out-of-order JNI APIs. Correct JNI sqlite3_open_v2() behavior in a particular OOM condition.
FossilOrigin-Name: 49d3be002ce5e594027f47a3ba448f0c21ec68b416b8df997497753f53e3ca52
2023-08-26 18:01:36 +00:00
stephan
2a6835fe0c Two significant typo fixes for [1a30919bfbb686].
FossilOrigin-Name: 6a6ee6dd54ec1a1dc7fb7d2f331951525d394a8362aef911f62878ac3961898f
2023-08-26 17:36:15 +00:00
stephan
3cb610c010 Bind sqlite3_db_handle() to JNI.
FossilOrigin-Name: 1a30919bfbb686464e8020e684120d22dd2375b910a17446b75452fda96a7449
2023-08-26 17:30:14 +00:00
stephan
2a0dc4895b Correct a potential duplicate xDestroy() being triggered for Java-side collations.
FossilOrigin-Name: 25331172f78544f7f23ad7821cbf065589f6d02706184d4c83fe3988452dac5d
2023-08-26 16:55:27 +00:00
stephan
fec793dd8a Recycle per-UDF JNI state.
FossilOrigin-Name: cf406528eb86d8d0d55a468b2c4ec32a11a4947f45c4bbabdde8742ae199ce1f
2023-08-26 16:29:48 +00:00
stephan
a7da592bd7 Code consolidation cleanups.
FossilOrigin-Name: d6b5ecd28740c2c5d21797fce9fe137c8a83f702f22901720cc6e8b1b42af001
2023-08-26 14:55:44 +00:00
stephan
acfbe5284e Add -sqllog flag to the JNI 'tests' target because it hits APIs which are otherwise not tested.
FossilOrigin-Name: cc3153ed341f59262485c3541a8879c4e86520c8a10f4ce819344a88099e7d0e
2023-08-26 12:19:51 +00:00
stephan
3ff458d61e JNI internal cleanups and docs.
FossilOrigin-Name: b7b26bfb4f86e0b8aaabab258ccb0713737ffd4ecd3156d6a83a4f9a1d25edf6
2023-08-26 11:57:34 +00:00
stephan
d9cf47e377 Remove the Java BusyHandler.xDestroy() method - it should not have had one. Eliminate the last of the potentially-significant MUTF-8 cases.
FossilOrigin-Name: c852f1ebbde273c3d28fe5aff0bf73cfc06b41dd371a94d7520536dc7a1dbcc1
2023-08-26 10:51:19 +00:00
stephan
6f8f587d2f Improve threading support for all types of JNI-side callback hooks, making them safe to invoke if another thread is busy replacing them.
FossilOrigin-Name: f2af7bbf493fe28d92fc9c77425f8bb9d48c02af9a5eabceb0365c705651e114
2023-08-26 10:20:38 +00:00
stephan
25033b6b3b Move the 3 Java SQLFunction subclasses from inner classes to package scope.
FossilOrigin-Name: 21fd47a68db9df1828f4cc4131d326a193b5751d56a40ae77ed0a78dc0621af1
2023-08-25 16:43:51 +00:00
stephan
9fed4aab77 Missed a straggler when renaming Java classes in [8ca528006533ac1]. Document threading limitations.
FossilOrigin-Name: 5786b95f5d09b4462aff0fdeac37992a2b64c47b004d18960f51e4e6a5796106
2023-08-25 16:26:16 +00:00
stephan
a5f09eb29d Hopefully the last major API rename in the JNI bits: rename all lower_camel_case classes which do not have direct counterparts in the C API to UpperCamelCase, as that's more idiomatic. Java types which reflect C-style types are unaffected.
FossilOrigin-Name: 8ca528006533ac152e9b322e421cf5d339414c77332d9836a9ff429b793d0d2d
2023-08-25 14:17:36 +00:00
stephan
ad818380cc More Java API renaming for consistency.
FossilOrigin-Name: 4e457778de189d8393e88f399dc521c8a5ad4ddd80a5fd69295bcb104fac5cbf
2023-08-25 13:23:45 +00:00
stephan
a899186c86 Re-enable SQLITE_THREADSAFE=0 in the JNI build and add multitest target which builds and runs the tests in all 3 threading modes.
FossilOrigin-Name: 6b1c816f6aae9face07ed7ead969257cf915c21ff9cdad9a21b7cf0e7496e09e
2023-08-25 12:29:59 +00:00
stephan
0199669fa1 Code restructuring. Force SQLITE_THREADSAFE in JNI builds for the time being, as threadsafe==0 leads to as-yet-mysterious JNI-level reference errors.
FossilOrigin-Name: 5a099caa2c21bec647f0a521e7f5d0d1cc2f96d388d3d6c53d5ec80947f33e8d
2023-08-25 11:32:56 +00:00
stephan
5ecb51c260 Only build in the JNI-side metrics tracking in SQLITE_DEBUG builds.
FossilOrigin-Name: 646e7fc3b5ba81c207f013c9a06781986138379f20e787320a811ba3ed5489dc
2023-08-25 04:27:17 +00:00
stephan
aec1361a2b Javadoc and internal API cleanups.
FossilOrigin-Name: 10a43cba9bb2c23b5f31b31fcac81be34acec1940cca47d0b8e5a5ccbf1aa8eb
2023-08-25 04:02:33 +00:00
stephan
5276552083 Replace all of the JNI XyzHook/Handler classes with snake_cased ones which follow unified naming conventions to make them easier to apply.
FossilOrigin-Name: 76e62a381249b3b4262b22bdffe7fc2816c820115c9df266956ab8817b127aca
2023-08-25 02:57:30 +00:00
stephan
44b4b8260f javadoc additions.
FossilOrigin-Name: bedf33d403677d243a1505ce549166850ab55671700b143278db5feb84883ab3
2023-08-25 00:27:28 +00:00
stephan
3401736694 Re-frame the incongruous SQLite3Jni.uncacheThread() API as sqlite3_java_uncache_thread().
FossilOrigin-Name: 7232b033954fae40df3db43e489e0e5a703c03308f500a1ae36fd9d707632d7f
2023-08-24 22:28:44 +00:00
stephan
70dcc2822d Update some outdated JNI docs and account for a function renamed earlier this evening.
FossilOrigin-Name: 3f684ef5018116f4be46a07779451c8983ac87a5db182477f71ee7bf28287a04
2023-08-24 21:45:30 +00:00
stephan
0f0bf3ff9e Do not pre-allocate sqlite3_aggregate_context() for Java UDFs, as it unduly complicates UDF initialization.
FossilOrigin-Name: e8308f0c6ec2d8999c8a2502fb130cb3501ba326f23f71f2cd8d452debae79b5
2023-08-24 21:31:56 +00:00
stephan
eef599dbd4 More code legibility and style improvements in the JNI pieces. Start work on a javadoc build.
FossilOrigin-Name: 62b404d62fd62f4d220838b59c9f38a71afa2d4a8c3af0a5c9495fa7020972cf
2023-08-24 18:43:25 +00:00
stephan
e336d92688 Doc, code style, and legibility cleanups.
FossilOrigin-Name: cf185bcd25629d882a030b8b87048179a120ab1f84aa1d68b279c499dbdf0dba
2023-08-24 17:25:05 +00:00
stephan
cf8a93f804 Doc style fixes.
FossilOrigin-Name: 862f9828e078ae138c3533658c45e4c45155975794e752b9b3a71a693842f37a
2023-08-24 15:42:08 +00:00
stephan
e6c299a5c8 Add a new non-goal to the JNI README.md.
FossilOrigin-Name: 53000cdae9b265752f8d8616679da621a571a6590c6eaeca23cf87a0e13aa4c4
2023-08-24 15:11:28 +00:00
stephan
8e52281659 Merge the jni-threading branch into trunk, eliminating the JNI API's prior threading limitations.
FossilOrigin-Name: 3739c8aa7080d8e1044ca51ab7b699b50da4d29620b35acfcea2745059b65bac
2023-08-24 14:49:29 +00:00
stephan
49ca4d20fa Merge into trunk improvements made to the wasm APIs which were too late for 3.43.
FossilOrigin-Name: ac9da5c79a4f56d25202d50974e16e2a463d77c99b1907aee2605d5a3e50a565
2023-08-24 14:43:30 +00:00
stephan
e7a4685837 Correct JNI layer's misuse of an sqlite3-internal error-reporting API (no mutex held). Style cleanups. Eliminate lookups of per-thread state by approximately 85% across the test suite.
FossilOrigin-Name: 1f46ba8d3bc61af771c1e33d09ad25f0da4fc4f915f7a9f6223ebfd99526d81d
2023-08-24 14:31:36 +00:00
stephan
6043947eee Ensure that db mutex is held when using sqlite3ErrorWithMessage() to avoid a potential assertion in debug builds.
FossilOrigin-Name: b8f6a50a4bf9478324f0272d79f2fe6992a49b753e79e39a268c6afb261bb01e
2023-08-24 14:17:30 +00:00
dan
e174dba739 Change a variable name in fts5FlushOneHash() to avoid shadowing another.
FossilOrigin-Name: 3f5bec9a684f6b3d88383617831862fc5595a51ad99ec12430ac6650b704ccbb
2023-08-24 12:01:30 +00:00
stephan
bfdc7ab5a7 Add more JNI docs, tests, and a handful of Java-side overloads.
FossilOrigin-Name: d19a431facbde6a6b960664674753ee85d2c051a76109ce7db0b079c65fbdea0
2023-08-24 11:57:51 +00:00
stephan
8cafdfa916 JNI cleanups regarding building with certain features disabled.
FossilOrigin-Name: a9e6d5158b8a4a6b8554a5f8f0a35785ee450d42ea877275dc27085e89716c18
2023-08-23 17:52:51 +00:00
stephan
1c3bf8a3e1 Remove unnecessary jclass-type struct members.
FossilOrigin-Name: d67255f7251cc5d1d27d77d4c84ff216e2da71202db989718189a6b4beff1cd0
2023-08-23 17:15:48 +00:00
stephan
495046ef88 Add a note to the JNI README explaining why the Java API has callback names like xFunc() and xPreUpdate().
FossilOrigin-Name: 415447a310f6a7d06b4aa9ef51f110cf8e2ef9545c69cb5983c367c50fe641d2
2023-08-23 13:36:27 +00:00
stephan
bea9ed0f1f Bind sqlite3_preupdate_hook() and friends to JNI.
FossilOrigin-Name: d0c425b5c1d3aac5ead18a501a3760b4506d68d373cb3be484247042cf2fa8d4
2023-08-23 13:17:37 +00:00
stephan
4e97ab4296 Bind a subset of sqlite3_config() to JNI: threading modes and sqllog.
FossilOrigin-Name: fce8ecaf7f2e69a168978e6993e58c452c45f76c39da33f2869c9d947c16cab1
2023-08-23 10:36:12 +00:00
stephan
4c8ef3894e Numerous minor cleanups and code style conformance improvements.
FossilOrigin-Name: 6c92d884920e4ace54913fc60ceef6e43a4351f45a4cb3c4a0ed3d29d544a31b
2023-08-23 09:05:16 +00:00
stephan
336bc8a281 Improve C-side exception handling from Java-side UDF callbacks.
FossilOrigin-Name: aebbc24afb339ed07b7cd767fbc0d25f3e9c3d9bb5ef3d1c10b04b605c7261bc
2023-08-23 00:17:28 +00:00
stephan
d53565b4f8 Minor Tester1.java cleanups.
FossilOrigin-Name: 70d936953ba55cfed32efe7e3a9d4b71da9a7ffc8818b6540471e0bf311bc688
2023-08-22 23:00:44 +00:00
stephan
3600976bf1 Fix Tester1 so that exceptions triggered via threads are not silently ignored. Disable auto-extension tests in multi-thread mode because concurrent threads rightfully interfere with that.
FossilOrigin-Name: 56b2a077ace6e6ad5834e1a597b710f212a5b7d5db5b9a27a41f2aa0f6952c55
2023-08-22 22:13:08 +00:00
stephan
d1c7216b2f More work on the JNI multi-threaded test runner.
FossilOrigin-Name: 9a74ad716bded1e14333bf7c72392916f800d58a96240eabe4988ca5fc9e8752
2023-08-22 20:10:28 +00:00
stephan
87bb103038 Disassociate JNI db handles from the thread that created them, as it's no longer relevant.
FossilOrigin-Name: 8b78b737e66a399b04e555a8197f63a73198a4105cb2f37ffd5b0e6014302caf
2023-08-22 18:36:30 +00:00
stephan
c675add616 Correct JNI binding of sqlite3_shutdown() to clean up all cached JNIEnv objects.
FossilOrigin-Name: 02e868690f97ca728b0f2dd018aa79a9d13c85dd85b164caa895d319ae8f3ff5
2023-08-22 17:51:57 +00:00
stephan
a7e3a1c09b JNI internal cleanups and correct two leaked db handles in test code.
FossilOrigin-Name: f927a30b5bba35991f472084ebaf02779e84c343a4e84f0efb3df7679ff212f8
2023-08-22 17:36:59 +00:00
stephan
9828aa223a Move the JNI per-thread cache of NativePointerHolder refs into global space. This allows better-targeted mutex locks and incidentally eliminates the lagginess and post-run hangs in Tester1's multi-thread mode (presumably caused by deadlocks).
FossilOrigin-Name: e209f56a9745695aadc04418c7bebe62b79e38e5aee26c3248a30f73bfa460c2
2023-08-22 15:30:35 +00:00
stephan
0a102087d8 Move most of the per-JNIEnv global Java class refs into the global state, saving a bit of per-thread overhead.
FossilOrigin-Name: 7342bf578790e1a87c128a7c1c7745fe2e7c442890370feb160d406597d4d8ec
2023-08-22 11:34:34 +00:00
stephan
484f9bed4e Minor JNI cleanups.
FossilOrigin-Name: b88910aaaaaaa0936974379bb3eb8a5a3a634395b14e67cc9030f8a520f471f1
2023-08-21 23:45:19 +00:00
dan
da7662a4b0 Fix an undefined integer overflow in fts5.
FossilOrigin-Name: f5c50349b1e4da233b554f371be49297b8b40ca5fe0188899ed906f682bf70d6
2023-08-21 16:14:58 +00:00
drh
114ad2f86f Address minor inaccuracies in fuzzcheck and RTREE found by UBSAN.
FossilOrigin-Name: a64e6c2fd8ef1d2d7f14aa9265629853298bbc480c2683c79dfd24847a61b68b
2023-08-21 14:28:47 +00:00
stephan
1089277105 JNI cleanups.
FossilOrigin-Name: 0a84131008a2e7886dac64a3545dea634811f6eac2b90885ec9c61ed1e6544c3
2023-08-19 14:49:08 +00:00
stephan
6f92f35449 Merge trunk into jni-threading branch.
FossilOrigin-Name: 8254479c6ff1ea3cc9e56de1698db8405c03da90b9bf4c401182e47e0842baf8
2023-08-19 12:34:23 +00:00
stephan
bfa486d5fc JNI doc additions.
FossilOrigin-Name: 0c7ac34f30e1f7e35a2ac4e5e55e5f24857b24afa81a7abecba60f1c9c68b9ff
2023-08-19 12:32:00 +00:00
stephan
187da43379 JNI test code cleanups.
FossilOrigin-Name: e202b6e69da8cced114d027cf2e91a04dfdd50b601b3274214783f7d750c558c
2023-08-19 11:52:36 +00:00
stephan
8d9179bd07 Minor JNI cleanups.
FossilOrigin-Name: 1cecb9e0383aa78c491f9ba88c831a88b4b2d40ceef1b87be494b6ddc0789e41
2023-08-19 11:26:52 +00:00
stephan
3cf6c0f276 Add multi-thread run mode to JNI Tester1. It works but hangs on exit sometimes for Java reasons as yet not understood.
FossilOrigin-Name: bdbaf7a4534f40e550b646979e67e7b7731566bb5a2631ed376ac85a9bec40a7
2023-08-19 10:43:05 +00:00
stephan
46d677e713 Replace JNI::NewStringUTF() for the remaining cases where output may be incompatible with MUTF-8. It is now only used when we know the output to be plain ASCII.
FossilOrigin-Name: 2d955eef25ab116c487ebc34c6f2d2836d310af239ef1993f5aeee5a3f68d590
2023-08-19 08:22:34 +00:00
drh
4d8eb16f07 Rename the decimal_sci() function to decimal_exp().
[forum:/forumpost/fa027bb0ab|Forum post fa027bb0ab].

FossilOrigin-Name: c48f1be8cc505a7e2902c79e26c1d9a121ff5c55785ac812d2e09232b2414695
2023-08-18 15:39:38 +00:00
stephan
656f6c0c80 Improve exception handling in OpfsDb.importDb().
FossilOrigin-Name: a4eedd63b58f5c273b671f687cb68a32259963dbb053a710770383c735fb7f26
2023-08-18 14:41:21 +00:00
stephan
ccbfe97cd5 Extend the importDb() method of both OPFS VFSes to (A) support reading in an async streaming fashion via a callback and (B) automatically disable WAL mode in the imported db.
FossilOrigin-Name: 9b1398c96a4fd0b59e65faa8d5c98de4129f0f0357732f12cb2f5c53a08acdc2
2023-08-18 14:16:26 +00:00
stephan
383df02b16 Remove some obsolete JNI-internal docs.
FossilOrigin-Name: 00a2a3736a6dcde81d920815520040f3c47f965165e7128ca1f4062e6ec7c17c
2023-08-17 22:04:07 +00:00
dan
e15b35d5a6 Fix an error in documentation comments in fts5.h.
FossilOrigin-Name: 24d96bd65d8ccdd50a6f4fe217d196728a2f8658d128f9352c287f64e034104a
2023-08-17 16:59:35 +00:00
dan
fab6882fd6 Add extra test to fts5synonym2.test.
FossilOrigin-Name: 39ea11be3b35c5ecde9bc0fe66af673b8f440dc523422887d05a29feef036b01
2023-08-17 16:49:06 +00:00
stephan
6c5f96fc4d Tighten up the JNI auto-ext handling.
FossilOrigin-Name: c09c8d05a20d916a9d9304eeea723ef7666a862a9e53f5feeeb1b03f9153d4b2
2023-08-17 13:13:22 +00:00
stephan
1dcb246988 Minor internal JNI cleanups and fixes.
FossilOrigin-Name: 0e9437de026cbfb333b90bb3400f1c015f85d49d73a25ad1000623216b88bfa0
2023-08-17 12:44:52 +00:00
stephan
0fa2545e7f Remove the FIXME markers related to threading. Code style cleanups.
FossilOrigin-Name: 154ab26dc6ba2d1fd976e8fe6dc1b1a06c734f7e9a276a3edc5c2f30b0d6d36a
2023-08-17 10:49:06 +00:00
stephan
ff9ff54801 Cherrypick [00ac653562a6] to remove stray JNI debug output. No functional changes.
FossilOrigin-Name: e12d70f38c0ed5c0abf9a1e30ce4db59a4426e1e8cb1f8f07834fc1bedfcc65a
2023-08-15 21:44:22 +00:00
stephan
c131675401 Cherrypick [653ed92dc391] (went to wrong branch). Doc change only, no code changes.
FossilOrigin-Name: 79a14457f0067814e7c33de709e2f9e19ab880d3eebbcb6f9fcce52a4720ecac
2023-08-15 20:57:42 +00:00
dan
8c5611a169 Fix problems in fts5 test code.
FossilOrigin-Name: c16ed3b1cc7b4c21bfa96062bf9028ae071c89e63df3b444b59f1753594e4e94
2023-08-15 14:53:49 +00:00
stephan
abfe646c12 Add note about the current threading limitation to ext/jni/README.md. No code changes.
FossilOrigin-Name: 653ed92dc39185cdedfab3ea518bc7ec2d2826120e5fa4cbdee3343301396184
2023-08-15 13:01:20 +00:00
stephan
6b51e35a9b Minor reshaping of Tester1 moving towards making a multi-threaded run mode.
FossilOrigin-Name: f104c14c26c123ee78c09fc1bc59efb8668dc624da05c1d8dbeaf3c9dd02a393
2023-08-15 09:26:47 +00:00
stephan
39c3f5f363 Remove a piece of stray debug output. No functional changes.
FossilOrigin-Name: 00ac653562a66aad3112ea322d08be68e05e6bf7413c814dd3f81bf850fcf43b
2023-08-15 09:16:41 +00:00
stephan
9019e2e667 Bring handling of the Java auto-ext handler more in line with the core in terms of locking and mutability during traversal. This removes the explicit synchronous requirement from the Java open() and auto-ext bindings.
FossilOrigin-Name: 42994b952e092ae4fa319395208622e887387ca3ff8ac57961c824a6c272bf0e
2023-08-14 17:12:55 +00:00
stephan
24b4cdd8d3 Remove some obsolete, commented-out makefile code. No functional or build changes.
FossilOrigin-Name: ea574cd5de6dbc7db2f4cffe0b6c83c795c4ba634ae1984e5c95bb3529daa5bb
2023-08-14 14:21:28 +00:00
stephan
7f2dea75ad More work on the JNI-specific mutexes. Rework the NativePointerHolder cache lookup to be slightly simpler and O(1) instead of O(N).
FossilOrigin-Name: c84ded0e59aea4861d72b53b4b40cf580747c0f6ca58c334a996f1a825276cb5
2023-08-14 13:27:40 +00:00
stephan
d518e94adb JNI-internal docs and removal of obsolete code.
FossilOrigin-Name: b62d93258b6a661f3a9b61468b3b641c14faf2d2196f78aca95fe14de43c9444
2023-08-14 08:28:46 +00:00
stephan
6a1ed4c811 Internal API renaming for clarity's sake.
FossilOrigin-Name: 911e4fc5aaf9478214095a65f74af3ebca883922c36cf7a8d911116c42cf9de8
2023-08-13 20:58:12 +00:00
stephan
88381e53fc Add a mutex for auto-extensions, tied in to the open() process since that's the route into auto-extensions.
FossilOrigin-Name: 8da97e0db4eeacf91aa6fd909fd7cb73b050d194dfc7739a502b55f7eca6d7b1
2023-08-13 12:40:27 +00:00
stephan
4b4a911c5f Add some docs and metrics for the new mutex internals.
FossilOrigin-Name: 33d1780b43182d2574adbc1928707af825c485c99762738e58bc6d7c6c52ac6a
2023-08-13 10:28:35 +00:00
stephan
8a6888c19e Remove SQLITE_DEBUG from JNI build.
FossilOrigin-Name: 82f004cf7408c503c5787b46c7b13ceb0a20a3ad1d4f69d56127772c40e214a1
2023-08-13 10:22:15 +00:00
stephan
71e5694cd5 An initial attempt at protecting the JNI global state via mutexes at the C level instead of relying on Java's synchronized keyword. It seems to work but increases the run time of the single-threaded batch tester by roughly 3 times.
FossilOrigin-Name: c64e6a52ac79164be37fe643a4a39bd187af198a379410def8b8419f7c2224d4
2023-08-13 09:53:27 +00:00
stephan
0c07549fd6 Bind sqlite3_interrupt() and sqlite3_is_interrupted() to JNI but with caveats regarding mutexing of the JNIEnv cache. Add a loud warning to the JNI 'dist' target that it should be built with JDK8 (a.k.a. Java 1.8) for compatibility reasons.
FossilOrigin-Name: fbf99a2423dd20e4544bdeea85f714e9368ce3b92fefe97efb39a0fb4a557abe
2023-08-12 23:47:58 +00:00
stephan
202651fe86 Merge the Java Native Interface (JNI) binding into trunk.
FossilOrigin-Name: 48b13edcec6935bf125b265b41a3e6f7b2407afff89d5b4daa2939e3c5679ca0
2023-08-12 21:39:18 +00:00
stephan
54402964b0 Update wasm's push-testing rule to exclude files which were recently removed from the build.
FossilOrigin-Name: 0a6930a7ff8f8c6ca244d1d654532f3d2a02d77ef67c6cae0c53092743d59ea6
2023-08-12 21:08:41 +00:00
stephan
d8a94dbb36 Correct JNI .jar rules to only include *.java/class files, not *.* (*~ files).
FossilOrigin-Name: 1ba7754045a009d9c94b23ac76b9bb8d9c9cb24d42dcdf1203ee75ac85765d3e
2023-08-12 20:50:29 +00:00
stephan
68522e1627 More JNI docs.
FossilOrigin-Name: 290028d3ca5638f3bb18a0b243c7ba3c31c8a2b1a837c36ec29e0fc4ed6533f0
2023-08-12 15:37:53 +00:00
stephan
5b3a754360 Further simplifications in the interface of the OutputPointer family of Java classes.
FossilOrigin-Name: 962c3e0de2d64ab8a2bcf1a19f9c4224df3d15a41ac9f9b29da685be95c4ef7a
2023-08-12 15:09:09 +00:00
stephan
c216df75c6 Tweaks and docs for the OutputPointer family of Java classes.
FossilOrigin-Name: 265c8fd0d4d425054f6bf7e9cb607ad2e0e46189f16c3014f7fdf9b650085497
2023-08-12 10:39:26 +00:00
stephan
613390680d Bind sqlite3_db_status() to JNI.
FossilOrigin-Name: b79477a0af94127b0638a8822de01156bef855a7e167f678809e1c978e1a0c3e
2023-08-12 10:27:08 +00:00
stephan
238bea2ae6 Bind sqlite3_status(64)() to JNI.
FossilOrigin-Name: cefb6614e65ca1764ec72702f92f801382e63aa9b221fc9c68719d497e7499fd
2023-08-12 10:06:59 +00:00
stephan
48dcdd3b74 Add timing info to SQLTester.
FossilOrigin-Name: b69b5facbf94e03e74d4a739ab85c5baac1c9ecbea8c330b2135d77e525b5d8a
2023-08-11 21:25:33 +00:00
stephan
a6746456d9 Merge trunk into jni branch.
FossilOrigin-Name: 4f0aeeba0287e846908180eab6f7080ebe1323ebe49340771864d110e1ca5b2b
2023-08-11 21:24:08 +00:00
stephan
783f5b5aa2 Fix a makefile deps problem which caused ext/jni build to fail if sqlite3.c/h were not created beforehand.
FossilOrigin-Name: 101de670774f63757180282763730aa53e70198bd7a674c27e6044632d39d22a
2023-08-11 20:32:40 +00:00
stephan
16c8c96745 Minor SQLTester test tweaks and have 'make tester' include the out-of-tree tests if they are found.
FossilOrigin-Name: 6c8538d83495ce65dbd7417263b3b06dbbb2a649e9a61a743911944599d75ffc
2023-08-11 18:59:57 +00:00
stephan
7009c43eaf Bind sqlite3_sql() and sqlite3_expanded_sql() to JNI. Start marking C-side functions which would need explicit mutex support if we remove 'synchronized' from their Java entry points (but there are many more left to mark).
FossilOrigin-Name: c7fb32d1ef30d34449c3289c384ce33317c770927534af20d4b96fa385da40bc
2023-08-11 18:04:53 +00:00
stephan
c3b7e1c4e8 Add a doc link for the new sqlite3_js_posix_create_file().
FossilOrigin-Name: 0d7aac45b8e7078cc80757e12d6f0b2584f2b0b184dacc2348ad3519978e5bf9
2023-08-11 17:45:23 +00:00
stephan
b949244ea1 Add sqlite3.capi.sqlite3_js_posix_create_file() and oo1.OpfsDb.importDb() as alternatives for the newly-deprecated sqlite3_js_vfs_create_file().
FossilOrigin-Name: da6eaf8d8258f3e2c8633fd7faf4e90c3307b5c60bd8b69c626b3c82b19dbdef
2023-08-11 17:38:17 +00:00
stephan
7e13152952 Deprecate sqlite3_js_vfs_create_file() because, it was discovered today, its out-of-scope use of the sqlite3_vfs, sqlite3_file, and sqlite3_io_methods APIs triggers unresolvable assertions in the core when built with SQLITE_DEBUG.
FossilOrigin-Name: f3647a3ac8eca8c821b0b1e403da7bfb0feabd0eb5ee83709cd4956dfc56a492
2023-08-11 14:31:20 +00:00
stephan
a0423e0fc1 Mark _all_ JNI binding funcs as synchronized so that Java can lock them and protect our global-state access. The alternative is writing a mountain of C-side code to do the same thing.
FossilOrigin-Name: afe190a940441de9bef8835c2dc6d278f861a772c3b7c7a2d399b2eabd4872e3
2023-08-10 21:50:52 +00:00
stephan
5c9f5e4022 Work around jdk8 and jdk19 mangling the C name of sqlite3_db_config() differently. Correct the variadic arg handling of the JNI-side subset of sqlite3_db_config() options.
FossilOrigin-Name: 746894c3c043c47f8b4c231de8921df81c5d0634260d299359bea73132dc7867
2023-08-10 21:29:59 +00:00
stephan
0c08c8c208 Add a working dist zip file for the JNI bits.
FossilOrigin-Name: d6a4d212ceba662470d8957b6a8d7075d18a84bd0d3e13ce7adcab03604fc3b7
2023-08-10 20:52:14 +00:00
stephan
a52b8c8845 Initial pass at 'make dist' rules for the JNI bundle, but they still need a bare-bones, posix-make-compatible makefile to include in the bundle.
FossilOrigin-Name: ff54e66a4d43f2f0f8b25ded970779e6760865a05346e09b39607bb035b02bd7
2023-08-10 18:57:37 +00:00
stephan
2ee01b0c9a Merge trunk into jni branch for the newly-relocated version-info tool.
FossilOrigin-Name: cc8e8cba67c0dcfb9b416041a19456cf5248d909f3efb6fee707a5950be4f374
2023-08-10 17:39:26 +00:00
stephan
bb51af68f4 Move ext/wasm/version-info.c to tool/ for re-use in build other dist bundles.
FossilOrigin-Name: 4b0871fd367b6d9706e892aa13f64604967f5e3ba92381960f73aeabd3d23f84
2023-08-10 17:32:37 +00:00
stephan
a22a2d266f Add SQLTester --keep-going flag to allow it to continue to the next script after an error.
FossilOrigin-Name: 4d635f781b55ed9011bdf07ee6bed2d004b1c2ebba76aa110e26d8fe3152a733
2023-08-10 16:42:22 +00:00
stephan
92f699d384 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.
FossilOrigin-Name: 99c0941f1c006622932a9cca12661f354f363a6c8a2b5675ea66149e0a9eb927
2023-08-10 13:10:25 +00:00