Commit Graph

26468 Commits

Author SHA1 Message Date
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
dan
46451fa8b5 Fix the mdevtest target so that it works with msvc.
FossilOrigin-Name: 01f49448cd0cfe3af499aedfe887b7b0be4f1ab09cd5a16119ddafb32b107708
2023-08-12 19:58:47 +00:00
dan
890a9ede3b Fix testrunner.tcl so that it restarts itself using [testfixture] if its current interpreter does not support [package require sqlite3].
FossilOrigin-Name: 408be98dddf500f2d6c9049703997836d80d156d86cf297f664175a107f7331e
2023-08-12 19:25:26 +00:00
dan
7c036fabe5 Have the mdevtest target support the OPTS variable on unix.
FossilOrigin-Name: 940f58d9b944d3344b40a4bc020842d9b6703685c9c51f4010e265afd98608ff
2023-08-12 18:23:38 +00:00
dan
a6f09a0193 Add "mdevtest" target to makefiles. Equivalent to running "devtest" on both debug and non-debug builds.
FossilOrigin-Name: af354fbc0be06d5792a1e712ec4e9cec4c6cb4521335aa31f8f51ca5c94499ae
2023-08-12 17:36:57 +00:00
stephan
6c6badd2ef Modernize the sqlite3 shell man page a bit, per [forum:d9aa201dee553bb2|forum request].
FossilOrigin-Name: 3bc0693c4633f545f09dbee702e25354504b20836373a068447e6c61cb2ebd79
2023-08-11 22:40:06 +00:00
dan
2a28cff2e7 If SQLITE_USE_SEH is defined, handle structured-exceptions thrown by MSVC builds if the *-shm file mapping is accessed after it becomes invalid for some reason.
FossilOrigin-Name: 8a6b0c24937e855b710f97b4aea973eff53e6d43e1182842731547aa4b37db2a
2023-08-11 19:31:51 +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
drh
59d01de837 Provide the -DSQLITE_LEGACY_JSON_VALID compile-time option to restore the
(incorrect) legacy behavior of json_valid(NULL).

FossilOrigin-Name: 00bc9f1b573d683829bf5eb301606c38d6a60fba957d8edaf59116c02cc650bf
2023-08-11 11:30:43 +00:00
drh
b8a0fc52a2 Fix bug in the test case for the previous check-in.
FossilOrigin-Name: c5daae88612607aa7a8b13b021cf586fc66e8bcd1fa9d948a860c881b7247761
2023-08-11 11:24:44 +00:00
drh
91c0092917 Up until version 3.42.0, there was a bug in json_valid() such that it would
return False (0) for a NULL input.  That bug is fixed in 3.42.0.  This
check-in adds a compile-time option -DSQLITE_LEGACY_JSON_VALID that restores
the old buggy behavior for applications that depend on it.

FossilOrigin-Name: 15c2eadbff8e732cca45d6c3771d1fcea5aab2127e87f2a611b41ccfef4d1a0d
2023-08-11 11:12:46 +00:00
drh
89e1caf294 New testcase() macro in the tokenizer, to better document its behavior.
FossilOrigin-Name: b2fdac0b151864eb2aa79f0b0ee60f9c6d9f3eb8c7626605eac17a02a8cf59bc
2023-08-10 18:50:00 +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
dan
6de6121e36 Merge latest trunk changes into this branch.
FossilOrigin-Name: 3ed89c344fcb3b7ee8b764d95144643e42e053e1116150d6eda8355fbd6669df
2023-08-10 17:07:34 +00:00
drh
80c438613a Minor cleanups in sqlite3Int.h. By reordering some fields in the Parse
object, it packs more tightly and uses less memory and less CPU to
initialize.

FossilOrigin-Name: aa6de539c09faa320b68c63659e602107145c4263fa680d5b40fe4d7d7ac4534
2023-08-08 17:36:03 +00:00
drh
73cdbeb632 Fix an issue in the amalgamation generator in which it was not correctly
expanding the SQLite version in the header comment.

FossilOrigin-Name: 293f6191e9b328cb8a8d3fff0f7bd5a6f5390b5ff090497a170c791b6ea22917
2023-08-08 16:53:12 +00:00
dan
786a9dcf5d Enhance sqlite3_vtab_nochange() so that it works with "UPDATE ... FROM ..." statements. Use this to allow some updates on fts5 contentless-delete tables.
FossilOrigin-Name: 27ff86e4d8d251dbbcc9f0682d3d7b040518cbeee891cfe253661d1fdbec4e4f
2023-08-07 17:09:25 +00:00
dan
be3ab76bfb 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.
FossilOrigin-Name: 16cd2161e312cf97129011fc829079db8f762b822b2f4fabf7ff6742c071302f
2023-08-07 16:15:56 +00:00
stephan
7c26811c2f 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.
FossilOrigin-Name: 2ca064d8eb37252e16b0fec9924e9ba9289d96a737346431c6ba9cb1c161e5de
2023-08-07 09:44:00 +00:00
stephan
47c5db7f77 Tiny doc typo fixes from [forum:31eb707250|forum post 31eb707250]. No code changes.
FossilOrigin-Name: 8ede50082e7bcf0226a3b42a590f188b5a139bbf081c9eed7ff8f6f2a6a274a0
2023-08-05 19:15:19 +00:00
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
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
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
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
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
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