Commit Graph

26745 Commits

Author SHA1 Message Date
stephan
195611d8e6 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].
FossilOrigin-Name: a617ebf4e5d1af1b5b15e9782ad111399caaa3ea7b99bb0c8691c8b4283b6d6e
2023-08-04 16:01:55 +00:00
stephan
cc8202b646 More work on the JNI binding of fts5 customization (still a long ways to go).
FossilOrigin-Name: 1a246fd21657f5bb13eeacc4059894ab787ea9a3c45bd9bdd3030a66643d2fef
2023-08-04 15:38:59 +00:00
stephan
c7795cfd47 Eliminate code duplication in the two JNI tester classes.
FossilOrigin-Name: 63e7bbe3d5fcfb531f9d7fa88398c1191570e69b5d11adcb9c5e64b8345b4e6c
2023-08-04 13:27:45 +00:00
drh
b87278f414 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].

FossilOrigin-Name: ba7a66db13b28da0b41f03be825a593608474a5ebda89e12d58d89db709b8f65
2023-08-04 13:19:11 +00:00
stephan
5e208f712f FTS-related JNI refactoring. Move FTS-specific tests into their own class and dynamically load it, if possible, from the main test app.
FossilOrigin-Name: b7a8428fcd969e7a29a23c2dae61883f69501094f2de0f79bbee3c02c672cbf5
2023-08-04 13:03:31 +00:00
stephan
b15223bce6 More work towards binding FTS5 customization to JNI. Add Fts*.java files missing from previous checkin.
FossilOrigin-Name: 91263178f463ca4623dd0203696eff6bcfd68abde5d2471be3f5a3edd791c52a
2023-08-04 12:44:06 +00:00
dan
b383744835 Change comment on Fts5ExtensionApi.iVersion from "always set to 3" to "always set to 2".
FossilOrigin-Name: b7de399c277394a6a3bbf253d4177aa82753271e5087b98b2c2268f629a7dfdd
2023-08-04 11:10:10 +00:00
stephan
c0952c11a7 Start including fts5 customization bits into JNI, but it's far from functional.
FossilOrigin-Name: abaf5edd0430e3301a11bd0acb9ce4b81b310237e1799701411db56ef7605e01
2023-08-04 11:08:25 +00:00
stephan
e133a0ec05 Improve internal error handling in the JNI create_function() impl.
FossilOrigin-Name: 2c88390faa108a60c8fb1eb7aad05d90f3daf4cfef14ca73987597aaf7be83c9
2023-08-04 09:53:13 +00:00
stephan
a24769454e Resolve the timing/ordering issue of a JS-to-WASM-converted xDestroy() function being uninstalled from WASM right before the underlying native call tries to call it. This has been a long-unnoticed bug which appears only when removing such functions or replacing them.
FossilOrigin-Name: 031c9a76b6ad1572e7a88f4d2d62f206b0d37bd1170e2c8a24248c5ec628f2f5
2023-08-04 08:45:25 +00:00
stephan
444424dab8 Part 2 of the fix from [a0f808363318c00fd1db78b].
FossilOrigin-Name: 5c3104228d75c8fafbe24e46623777f3a8647f1b50267af61d46f7fad0e0434e
2023-08-04 08:41:55 +00:00
drh
1050f1d2a1 Fix harmless scan-build warnings.
FossilOrigin-Name: 65a8716d8a1b7c5cffe9cdd25e4cbfa6528fcb146ff0fe67b0ce771b0537473d
2023-08-03 18:14:09 +00:00
stephan
e98fa205f8 Fix a discrepancy between sqlite3_values_to_js() and its API docs/intended behavior.
FossilOrigin-Name: 7b85c68fe252c0aa69724c82a95a4432e33ebdfb879b4b1b2ee2f9b98e9b792a
2023-08-03 16:22:59 +00:00
drh
86d77fd95d Fix build problems associated with SQLITE_OMIT_WSD and SQLITE_OMIT_TRIGGER.
FossilOrigin-Name: de031a5ec863b11f0216d1a114740c8cf4572adb034a5d35ff1a5c07d81df800
2023-08-03 13:30:00 +00:00
drh
038ac625af Fix a test case whose value changes under the no_optimization permutation
due to the recent change to add the ability for SQLITE_TESTCTRL_OPTIMIZATION
to disable one-pass.

FossilOrigin-Name: 976e39c6322f9e51054546e2d9bc135b683d141054c645c9098002cdc310c7c7
2023-08-03 13:07:58 +00:00
drh
9b1334b7d3 Unix builds now assume the presence of nanosleep() in the standard library.
The -DHAVE_NANOSLEEP=0 compile-time option can be used to build on systems
(if any still exist) where this is not the case.

FossilOrigin-Name: 779d5dc8797ea246d0397f7e94b1be716b0baa735e8d9f5a6fc4cffd887a7420
2023-08-03 12:41:30 +00:00
stephan
ed86e0a0a7 More JNI-internal docs. Correct handling of a Java exception if a trace callback throws.
FossilOrigin-Name: 306b269a01037bc5c98276276fdb17b37027d1ee0d603183f42a65966245bdff
2023-08-02 17:29:18 +00:00
stephan
decc1425a3 Internal doc additions in the JNI bits.
FossilOrigin-Name: b56643644e065b03fe2c3545e02ed3b2f6fd9f77c39aa84a02a00d695e9a12dc
2023-08-02 17:20:52 +00:00
drh
c874d60353 Performance optimization for JSON rendering logic.
FossilOrigin-Name: ea0b9aecbaca9a8e784fd2bcb50f78cbdcf4c5cfb45a7700bb222e4cc104c644
2023-08-02 16:06:02 +00:00
drh
d3229ce23e Remove an unreachable branch in the ascii-to-floating-point conversion that
was added by [e989a37ff9d5b52e].

FossilOrigin-Name: c4347e4400e96f932ac12f8f22484a2ebce2a578d1b2181977954c432f117bfd
2023-08-02 13:45:16 +00:00
drh
b1dcebfea3 Stricter enforcement of the idea that a MATERIALIZED common table expression
is an optimization fence.

FossilOrigin-Name: 354425f8d97437bd156265a6914f98cce91b42abc9e773453ef4d817e308dc9a
2023-08-02 13:38:02 +00:00
drh
26cf4af5d7 Remove a condition from query flattening that is now taken care of by
the caller.  Factor out the reverse_unordered_selects processing from the
main loop of sqlite3WhereBegin() for performance.

FossilOrigin-Name: f068f105fb158634321bf6401f0774c81059932d213a18b627ae98bcffc10912
2023-08-02 13:29:01 +00:00
drh
aa250db66a Simplify the select.c logic that enforces the optimization fence around
a MATERIALIZED common table expression.  Do not allow the
reverse_unordered_selects setting to affect a fenced CTE that itself has
an ORDER BY clause.

FossilOrigin-Name: 165b9bda243777ae7fb6f51ee7ad58771c581b82ef9a70268eb9764e9e6eba6f
2023-08-02 12:39:56 +00:00
drh
5e82c06cf8 Never flatten a CTE that is labeled MATERIALIZED. This is really something
of a bug fix because the documentation says that a MATERIALIZED CTE is an
optimization barrier.

FossilOrigin-Name: b7ef9796f548ce43e06673f86bbec68157aae5e4ee8451e1d87ee5f70af1bb27
2023-08-02 11:06:27 +00:00
drh
4178849736 When a query is inside an AS MATERIALIZED CTE, do not attempt the
omit-ORDER-BY optimization.  If the developer specifies MATERIALIZED,
that means he wants the sort to actually happen.

FossilOrigin-Name: aa769ee7477171f26a091cadff98aa4f48da7752ade20b405a95c4525456f62e
2023-08-02 00:09:15 +00:00
drh
cbaef88980 Avoid ASAN warnings when converting over-sized long double values into double.
FossilOrigin-Name: e989a37ff9d5b52e0090d59be077ad2260c8df5d4c2c2d8088b1160de64dffd4
2023-08-01 19:10:30 +00:00
stephan
2877c43e6c Filter the wasmfs-specific JS module result type check out of non-wasmfs builds.
FossilOrigin-Name: ef7c121049f77200ecc4da260a90776264af0e84122d0133b4986959aedc653a
2023-08-01 16:41:12 +00:00
stephan
887f6e5082 Fix part 2 of 2 for /fiddle: a make deps problem which caused fiddle to load but fail to run when sqlite3.c was missing.
FossilOrigin-Name: 6011bc26764760af750de68f1553f45382766dd2195633ae267bdb4f9ac75d0f
2023-08-01 16:38:08 +00:00
stephan
a08d363f67 Fix part 1 of 2 for /fiddle not running: build flags which were renamed during refactoring.
FossilOrigin-Name: 214ffeeff77997c3352d30aaa6e51e2dea9706f0d08f73f4eacfad1864817fc6
2023-08-01 16:17:00 +00:00
dan
c1a07d3bab Fix an assert() in fts5_index.c that might fail when dealing with corrupt records.
FossilOrigin-Name: aa55c83f35c2ab134e0842201e46e021079283f9c65595c86664060b3aa8d715
2023-08-01 11:03:06 +00:00
stephan
ed77e13f05 More docs for the Java side of the JNI bindings.
FossilOrigin-Name: d8e9bcee96b90d56701f7907a8bd48853211caf757e1aa8decc7ed25eece6770
2023-08-01 10:19:05 +00:00
stephan
e209d144c3 Internal exception-handling cleanups in the JNI bindings.
FossilOrigin-Name: 057b1d4f6ffff73c120566895f61ea3fd8118968464d67ec9262096a7aa03f39
2023-08-01 09:44:26 +00:00
stephan
0bc72d2b91 Minor JNI-related doc tweaks and code re-ordering.
FossilOrigin-Name: b663b27e425966f34fb62482a18048f0e2934380e5c411ae3627f1fe6a765c04
2023-08-01 08:48:13 +00:00
drh
b9894f88b8 Remove redundant comparison operator.
FossilOrigin-Name: 018984329892c243b21adb10aa8efc7f49313ecf80477e6b61dc6365f62c489d
2023-08-01 01:07:45 +00:00
drh
d192b4441d Restore part of the UPDATE one-pass optimization that was removed by
check-in [2c56b984a0bd3be5]: only disable one-pass if the WHERE clause
contains a subquery.  Allow subqueries in the SET expressions.
Fix for performance problem reported by
[forum:/forumpost/8ab195fd44e75ed0|forum  post 8ab195fd44e75ed0].

FossilOrigin-Name: 42916af9fc0f379a608a08db894400bd735a28e26ab1ffd604d1fddfbdb3ec0c
2023-08-01 00:34:03 +00:00
drh
00d635dda4 Restrict the new column cache to table-btree, which is the common case anyhow.
That way, writes to indexes do not need to clear the column cache.

FossilOrigin-Name: 659284ab0e22a4746c1337b3489e7b166d497fb7e5301e24dc115d2b0c4e097d
2023-07-31 22:03:24 +00:00
drh
98ab970bac The original column-cache implementation from check-in [ab1edcc7fedcf279]
(merged to trunk at [771fe35074b50b8d]) is unsound.  This check-in fixes
the issue.  Had to give back a little performance, the optimization is still
a overall win.

FossilOrigin-Name: ec95e970fb737adf0fab3cb4363040b036949e5eb966fc2d030a20f95e2bde60
2023-07-31 20:02:11 +00:00
drh
1f097a2f29 Add bit to sqlite3_test_control(SQLITE_TESTCTRL_OPTIMIZATIONS) that will
disable the one-pass optimizating in DELETE and UPDATE.

FossilOrigin-Name: 22f6dd5cd32ed9e7b932fdba98aa8652fde999df79f4995d3d8ac1acf430cf53
2023-07-31 17:39:36 +00:00
drh
c8c6763782 Improved debug tracking of the Parse.nQueryLoop value.
FossilOrigin-Name: 4a8a17498ecaccca5e5aab65d4596cbca9799547f50683237d08c1fa3556f1cf
2023-07-31 17:20:12 +00:00
stephan
db6f0bef91 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.
FossilOrigin-Name: 459db332af6ea358b42bac096b9d26f1045b9ec32fad8463bca06807b2396b2c
2023-07-31 13:52:46 +00:00
stephan
e3e9bdcd0b Add some JNI-internal metrics, accessible via passing -v when running Tester1.java. Document an OpenJDK bug which leads to incorrect -Xlint:jni warnings.
FossilOrigin-Name: a5d68a6b64abe3c2dfc3a32157f70fd8a4ad89feef2510b3bbb2d86b325d51ae
2023-07-31 12:10:32 +00:00
stephan
8f714e21a0 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.
FossilOrigin-Name: 9faca5d9ed4a749421e08bd1da8b7672c0fd31366124fdb613c46e19dece0fc1
2023-07-31 10:55:30 +00:00
stephan
ede8900912 Add another test for JNI-bound scalar UDFs.
FossilOrigin-Name: 8b322d92e247be606f83977767dc361ee4f7bc819122a630bdaa1110177db9b8
2023-07-31 10:42:05 +00:00
stephan
e2e696d11f Update some internal docs for the past two checkins. Add a way to dump out some debug info about the current JNI environment.
FossilOrigin-Name: ac9b8bb1e64450d980e2986084996549ae5c59e68c9f0c4c69539c239b64468b
2023-07-31 10:22:34 +00:00
stephan
452108b4fc Refactor the busy-handler-specific JNI hook type to use the generic hook type.
FossilOrigin-Name: d9efdc6dd20a34bfdaad5d4bf8e67cce7e35238299eb91e4459d59fda11978a6
2023-07-31 10:08:36 +00:00
stephan
46c46e400a Refactor the collation-specific JNI hook type to use the generic hook type.
FossilOrigin-Name: 02c1d3b6501fedf3d6e6d1ca60699df268522182c5ba3b49ae8f4691499ef0fc
2023-07-31 09:45:49 +00:00
stephan
41a7ac637a Internal JNI doc tweaks.
FossilOrigin-Name: f4aa2c82882cb6be1fd52977de19fd03c2e38abb857b520f951b32d610972ab6
2023-07-31 09:28:15 +00:00
stephan
9c1c6da930 Consolidate triplicated xDestroy()-calling code. Remove some unnecessary casts.
FossilOrigin-Name: 24c0763d0e025187c74002ffee11fd48d3cd7b40e01469d28484bb67f701884b
2023-07-31 07:15:25 +00:00
stephan
09947d0aad Internal JNI API renaming.
FossilOrigin-Name: fcfc070673cef2f657f4737f096678439ed7c011fb2e5391e0721f82f5d8af51
2023-07-30 18:41:25 +00:00
stephan
91710673e7 Internal JNI refactoring towards consolidating support for callbacks with and without finalizers.
FossilOrigin-Name: 120983a570d6de055cef9d916096de3410897ea9f46d23ea6eff1f9b549e423a
2023-07-30 17:24:01 +00:00