Commit Graph

25525 Commits

Author SHA1 Message Date
drh
da69802e92 Fix minor problems in the new sqlite3ExprDataType() function.
FossilOrigin-Name: c1d5261b222bbf94c20e558089f3d2eae6a88b6d739225ee4f7d0338e0e59994
2022-12-14 23:53:29 +00:00
drh
70ac36e877 Adjust the query planner to be more aggressive about using co-routines rather
than materializing subqueries and views.  Implementation of enhancement
request [73ebbb3a3d1a7bd3].

FossilOrigin-Name: 0b58d1b354a0f91bafeafee102acedd4654dc420afdf4eb4aaac9bf5bcb63c1f
2022-12-14 18:34:05 +00:00
stephan
1a1d8bbdc3 Rename the new peek/pokeF32() and peek/pokeF64() to peek/poke32f() and peek/poke64f() for consistency with related APIs and because they're easier on both the eyes and the fingers.
FossilOrigin-Name: cc86f03ed698a071cd02ef3dfaba69092226bff20c917d662f808061627ad285
2022-12-14 18:06:01 +00:00
drh
604314d94e Merge all the latest trunk enhancements into the coroutines-exp2 enhancement
branch.

FossilOrigin-Name: ea278438b72e85d217e72c836cbefd68bd8b336baf33507b2d8d12ef436424cd
2022-12-14 17:52:15 +00:00
drh
daa46142ec Rework the code that computes the datatypes and affinities for subqueries
and views.  If the subquery/view is constructed from a compound SELECT where
the affinity varies across arms of the compound, set the affinity for the
corresponding column in the constructed view to be BLOB so that it is allowed
to take on any data type.

FossilOrigin-Name: 27655c9353620aa58105e87d1e171d1f0a637deedde41c081824078385cd49ac
2022-12-14 17:46:35 +00:00
stephan
e5e61d40e9 Slight reformulation of some test code to test multi-arg wasm.peek() call form.
FossilOrigin-Name: 349bb28f614bc210b3283ed1c1144c45fbc7d9e2ffc3dc6193ccb9932d347efb
2022-12-14 16:40:17 +00:00
drh
ed07d0ea76 If the SELECT that implements a subquery or a VIEW or a CREATE TABLE AS is
a compound with different result datatypes on two or more arms of the compound,
then the overall column type becomes BLOB (ANY).

FossilOrigin-Name: 6ebb178c6b688ebd632e91a5ec4c748567833037c679ab3d72fb770deb230fe1
2022-12-14 14:41:35 +00:00
stephan
8a5c032b07 Use the new peek/poke() variants throughout tester1.js.
FossilOrigin-Name: ef7b783552f7783a728837fcfc81e493b135a7aac59747397e7e3d28f4309f95
2022-12-14 14:40:36 +00:00
stephan
feb9123a8c Add convenience variants of sqlite3.wasm.peek/poke() for each numeric type to help reduce errors related to typos in the final argument (type-name strings). If wasm.xWrap.FuncPtrAdapter is called as a function, instead of a constructor, it now behaves as if it were called as a constructor (previously it threw an exception).
FossilOrigin-Name: 14e3fc01b929fa3f9a2fdbd93deb4a8aad58c111d46369c772def0437152fa75
2022-12-14 14:28:54 +00:00
drh
a8b5c8739c Back out the part of the change in [88a05141c28e5ff1] that adds affinity to
the materialization of a view, as the affinity can be undefined for a compound
query.  This passes all TCL tests, but shows failures in the TH3 tests derived
from [forum:/forumpost/6f842bc5b2dadcb2|forum post 6f842bc5b2dadcb2], presumably
because the WHERE clause of the query uses constraints of the form
"source_crs_code='8675'" instead of "source_crs_code=8675".  Perhaps further
changes on this branch should reimplement affinity on joins in cases where
the affinity is unambiguous.

FossilOrigin-Name: fe5a77bcc4de8f49cc4fe6bd2e2e1f31da8d3bc84120daaa99eb853b06291d15
2022-12-14 09:06:45 +00:00
stephan
bca56f384f Add a test to demonstrate/verify which object acts as "this" in a oo1.DB.exec() callback.
FossilOrigin-Name: 8fc4b3f10f61e965853a22bf7a64ad2511ef656d66658a7910bac35b0f9805ec
2022-12-14 08:12:01 +00:00
stephan
b943df9323 A micro-optimization in sqlite3.oo1.DB.exec(). Changed the rowMode option of that method to only accept $X instead of $X, @X, and :X, as the extra options are entirely superfluous and may lead to confusion.
FossilOrigin-Name: 82a6c7fdf59729c182545b15c084b136e34513f340e87a7b6e5aa199117357b0
2022-12-14 08:01:34 +00:00
dan
5d75eb3fbf Fix a comment in ext/session/test_session.c.
FossilOrigin-Name: bd814af14b6d67c4f8cf6482a0657f9437811a2820196ea6ccf22514291fe360
2022-12-13 19:52:23 +00:00
dan
e1dcb44307 Prevent the sessions rebaser from generating changesets containing UPDATE records for which non-PK fields are present in the old.* but not the new.* record. Also update the changeset iterator to work around such changesets.
FossilOrigin-Name: f9cd23dffba06b1982c0a5e5362dba53eba768120a2daa985b4f649d3fea1427
2022-12-13 19:40:56 +00:00
drh
c799217cc8 Remove an unused variable from sqlite3SubqueryColumnTypes().
FossilOrigin-Name: c6e3ff396947e6954e77195419b35de8b39bd540d3f4bff456bab25b512e1792
2022-12-13 16:59:09 +00:00
drh
177b8c9c28 Use standard datatype names for the column datatypes in views and subqueries.
FossilOrigin-Name: baf2c2413346feb72ecb0bac800be9b945ebb4e01b42212132434d8ddef9cad0
2022-12-13 16:55:23 +00:00
drh
9e66087a49 Refactor the sqlite3SelectAddColumnTypeAndCollation() routine. Improved
comments.  Now called sqlite3SubqueryColumnTypes().

FossilOrigin-Name: 4dfb1b450b87e2c6207c83c102b785781d1dbdeadbeeab6a83f96d58bb96cfbf
2022-12-13 15:54:43 +00:00
dan
83084267e0 Add extra test cases for applying sessions module changesets to databases that have been modified using "ALTER TABLE .. ADD COLUMN".
FossilOrigin-Name: a7b404f21f657f395eddb32e218eae14e09df08fa03f68ca8bba79ea322ce8ba
2022-12-13 14:59:28 +00:00
drh
6042e30bda Slightly faster implementation of sqlite3ExprAffinity().
FossilOrigin-Name: 01cf3278c9c00dddcac67aa4b22ca26a52c31932cba35daa634a56b4c264bdeb
2022-12-13 13:33:28 +00:00
stephan
3c9749ab74 Document the role of the sqlite3.client JS API property.
FossilOrigin-Name: 5f11f1c7d5f8b627acd2ace277521d39fe2ffb0ef1dfe532e65fb56ea3dfb4d8
2022-12-13 10:54:12 +00:00
stephan
30f50a2d34 Extend the sqlite3.wasm function pointer argument converter to be able to handle the "two-layered context" of sqlite3_create_collation() and friends and make use of FuncPtrAdapter to perform JS-to-WASM function conversion for them.
FossilOrigin-Name: 0a60b7215e433f8c50027c70731b11e58d74c90ec5903e66ae42f9c98e40b044
2022-12-13 08:25:28 +00:00
drh
393021938d Merge recent trunk changes into the coroutine-exp2 branch.
FossilOrigin-Name: c43f433bcab29db0f1f8afd3948f5a4149e1f277c853c66f99c31f226d82bc0f
2022-12-13 00:51:34 +00:00
drh
7ca4312ff2 Further fix for ticket [57c47526c34f01e8]. If a subquery has a result set
column of the form "CAST(expr AS NUMERIC)" do not give that column NUMERIC
affinity.  NUMERIC affinity always goes to an integer if able, but a CAST
to numeric is a no-op if the input is a number.  So the two are not equivalent.

FossilOrigin-Name: f0325359d5795237b79f90f21b42d7d942c7e918137cb0231d404365d3041e81
2022-12-12 21:22:23 +00:00
drh
89e160a96a If a subquery has a result column of the form "CAST(... AS NUMERIC)" then
give that column no affinity rather than NUMERIC affinity.  This is because
casting to numeric preserves real values that could be integers but numeric
affinity does not.  By using no affinity on the column, we make the behavior
consistent if the subquery is implemented as a co-routine or is materialized.

FossilOrigin-Name: ece07d091c2ef3367a914187e0b6512c1f2390b8c34844536ad50e88c7e8c2f2
2022-12-12 18:58:53 +00:00
stephan
33ce0b3ff3 Revert part of [9386d6f63468] because the new automatic function pointer binding cannot properly track per-context function mappings when the context is more complex than a single context-type pointer. e.g. it is fine for sqlite3_trace_v2() but it breaks down with sqlite3_create_collation() because that one needs to use the collation name as part of the context key and we cannot sensibly do so with the current code.
FossilOrigin-Name: 6cd21b79075367227b57bccf829cc7d4ccc7d7fbcfaed226b4c8e942ddae4eb6
2022-12-12 18:42:39 +00:00
dan
d8e07c780c Add new logging code SQLITE_NOTICE_RBU and use it when logging for the spurious error that RBU injects into SQLite as part of applying an update.
FossilOrigin-Name: cd881d35150be7f28cc1ca1eca0e950b5a039bef61190fcae4f944ef0e91f234
2022-12-12 17:33:36 +00:00
stephan
124fc52d96 Move JS-to-C binding signatures from sqlite3-api-prologue.js to sqlite3-api-glue.js to allow for use of the new/experimental sqlite3.wasm.xWrap() feature which automatically binds JS functions to WASM/C as needed, which simplifies creation of bindings which take C function pointers. Reimplement sqlite3_exec(), sqlite3_create_collation(), sqlite3_progress_handler() to use this new feature.
FossilOrigin-Name: 9386d6f634680b4e0fa5487c34c63acb29f0b7a6ae738b8f6164ad084a229b62
2022-12-12 14:31:38 +00:00
stephan
5dbfc0dfdd ext/wasm/module-symbols.html: for C APIs which have extended JS-side semantics, link to the JS-side API docs instead of the C docs.
FossilOrigin-Name: d557015208f504c6d5d20ebf1e451b3f07b19590d76371b16a9f4b54e9645282
2022-12-12 11:38:22 +00:00
stephan
13e5512b28 ext/wasm/module-symbols.html: add a hyperlink to the API docs for each exported sqlite3_...() function.
FossilOrigin-Name: 01d3a9bba3120cfec3f752048281f18ce7ab48fa7584750c097233a9ce095a20
2022-12-12 11:22:05 +00:00
stephan
b2eb8a5352 Rework the internals of how argument/result types are converted to/from wasm in prep for attempting to support automated conversions of function pointer argument types.
FossilOrigin-Name: 58052d8285cbc2aa8c4f8a9f5c2d33ac12014f6a70afbc93bc4ce5b9fd1f9ee5
2022-12-12 08:16:47 +00:00
stephan
81aca2574a Add sqlite3.mjs to the new 'quick' wasm build for the sake of the snapshot build.
FossilOrigin-Name: 5a3f2224c37c7e28ce627bd98a9907a16635bffeea36e8ead707586aad37ccfe
2022-12-12 07:52:22 +00:00
stephan
fda3c30b7d Expose sqlite3_txn_state() to wasm.
FossilOrigin-Name: f6f3397a4667b15a96bdf4189c54789d622fd90351405e963d7f56ac93a9344c
2022-12-12 07:31:37 +00:00
stephan
9bda4c53c1 Expose a number of infrequently-used sqlite3_...() functions to wasm whose absences were noticed while documenting.
FossilOrigin-Name: 3144e7c0b8633d99daa07d75dabfe6e115ad401110f6f3c85f768e973299f3d9
2022-12-12 07:27:22 +00:00
stephan
56bc31588e Minor build tweaks in ext/wasm to create a faster-running build for the common dev-mode cases. No code changes.
FossilOrigin-Name: 6a61b14a6cf8279a5b8b77f934c2b97965f5e3fe4cddb03e78c2c0a840dbe6f6
2022-12-11 07:53:03 +00:00
dan
1d0de81f84 Ensure that the types and collation sequences of a view are taken from the leftmost component of compound SELECTs, even when column names are explicitly provided for the view.
FossilOrigin-Name: 6f0bf892695acaa2f6fd1fccc767340caf5edfdb8b0816bda33d52cc21d5da45
2022-12-10 19:22:39 +00:00
dan
6fce561905 Ensure that the types and collation sequences of a view are taken from the leftmost component of compound SELECTs, even when column names are explicitly provided for the view. Possible fix for [679ed6a2].
FossilOrigin-Name: b0e49aa81a09c183b8baf8346b8a9b593c2b13073958617b6594500958d5bd46
2022-12-10 17:54:55 +00:00
stephan
e8bbf12ad3 Remove -flto from wasm build flags, as it increases build time and doesn't seem to have a measurable benefit.
FossilOrigin-Name: 35a88747eb0bb9eebb60550f91d0fe0c7a5ae11ec0a1315ae056fd79e9436a3f
2022-12-10 17:45:40 +00:00
stephan
130cd85026 Correct wasm heap corruption introduced in test code added in [e144fd5c88fa4] which led to unpredictable failures.
FossilOrigin-Name: 6c1e07e3857b38e394853891a9028e88319bad4bc7b7b15078e25f430c3b1222
2022-12-10 17:20:29 +00:00
stephan
8c0041f5bf Remove two incorrect calls to structType.dipose() which prematurely freed objects in use by the virtual table test/demo code.
FossilOrigin-Name: 060eb2848975a24ff6683a8a9c4d7546ae36147323b0edae01fb42f52d9bb2d6
2022-12-10 15:41:47 +00:00
stephan
9cb6ff2792 Expose sqlite3_column_value() to WASM and add sqlite3_column_js().
FossilOrigin-Name: 7783aa4af1331190fd1f42a71bb724041e2e82b51745f9740926e4ead83a97ed
2022-12-10 15:13:29 +00:00
stephan
5c99d91e53 Refactor the internal JS routines for converting UDF results and errors to JS into public APIs.
FossilOrigin-Name: 35d1d63c7d60119b64341c561294890812837d5432d1d7bed3ed88d6212fbfa0
2022-12-10 10:24:46 +00:00
drh
93f41e22d4 Remove the SQLITE_PREPARE_SAFEOPT flag. The name is obsolete and it is at the
wrong level.  Instead use the SF_UpdateFrom flags on the Select object.

FossilOrigin-Name: 78723a9a7e72b42d28fc5645661da17f20cedcf864819b861800ad9340007be1
2022-12-09 18:26:15 +00:00
drh
e974e73f69 Do not allow OOM faults in EQP messages associated with automatic indexes
on co-routines to go unreported.

FossilOrigin-Name: d125d5afdf1b0a1c64fc64f180898099af07b8290ea9da49419df75d8b455f71
2022-12-09 17:33:21 +00:00
stephan
8ccef8f27f Export sqlite3_result_subtype() and sqlite3_value_dup/free/subtype() to WASM.
FossilOrigin-Name: 4600a7bbdc4cbe14591d48ea19fe5f7de3a0c10a14cdd97fd51e263a13163d10
2022-12-09 15:26:58 +00:00
stephan
706780fbd9 Expose sqlite3_value_frombind/nochange/numeric_type() to WASM. Add a flag to sqlite3_value_to_js() to cause it to return undefined, instead of throwing, if no conversion can be found.
FossilOrigin-Name: de8fc4bf34f80f320012a0e506ed8e3e24806daf67845d5dabb00b916108f6ef
2022-12-09 15:12:07 +00:00
stephan
99f30f1cd4 Refactor the sqlite3_value-to-JS conversion from an internal detail to sqlite3.capi.sqlite3_value_to_js() for use with routines like sqlite3_module::xFilter().
FossilOrigin-Name: f6dbf280f99809a80c99337e4c22a86dea7a35ae41ae9a69144c4502385a0a1f
2022-12-09 14:46:24 +00:00
drh
edfbde52fd Fix typo in the SQLITE_DBCONFIG_LOOKASIDE documentation.
FossilOrigin-Name: c6e7582aea4ebcc4563afb4367fded1e8a74f6ef522a569460023c340ca24b30
2022-12-09 13:49:44 +00:00
stephan
3ec44736b5 Remove some unused sqlite3_status() codes from the JS API. Add custom JS wrappers for sqlite3_create_collation/_v2() which accept JS functions (plus tests). Expand the argument options for sqlite3_wasm_db_error() to enable it to translate exception objects to C-level errors.
FossilOrigin-Name: 073a2f1eb006230ae0995a5ea6c789407bcaa819ec15b5064c66d8973ed4671a
2022-12-09 12:12:49 +00:00
stephan
81a3683174 Rename the oft-used, verbose sqlite3.wasm.get/setMemValue() and get/setPtrValue() to peek/poke() and peek/pokePtr(). The old names are retained as aliases just in case any client code actually uses them, but they are now deprecated.
FossilOrigin-Name: ad0a8139b0b025f8e9d2eca0c303557ef10fdfab8c8b65afb08c510a804073d5
2022-12-09 09:23:27 +00:00
stephan
5a83f52f48 Micro-optimization in the oft-activated JS-to-WASM arguments conversion step.
FossilOrigin-Name: ee47e9b83ca668b37dc1d8e519048a635693cf33d9967a2d81ff0824b7eea4ba
2022-12-09 08:44:22 +00:00
stephan
a3451dd990 Correct a test bug which broke the previous checkin's wasm tests in higher optimization levels. Test bug - it should not have worked in -O0 mode.
FossilOrigin-Name: f07141b7500c36169c2c96e045acf37ec97a0d75c0a5f4d0ebed4dc1d2094ccf
2022-12-09 07:17:54 +00:00
stephan
464c80d4c2 Export sqlite3_status() and sqlite3_stmt_status() to wasm. Expand the arg/return semantics of wasm.get/setPtrValue() and get/setMemValue() to simplify handling of multiple pointers.
FossilOrigin-Name: e144fd5c88fa4151429a2fef3daf389588402e158267f0afa0dfd142527d76b9
2022-12-09 05:47:42 +00:00
stephan
75f54dba50 JS API doc updates.
FossilOrigin-Name: 4f80fd3b8d4c85894664093d8310d6f5299faac4eb879edc608b3ffcd8558e9a
2022-12-09 02:23:15 +00:00
stephan
735dd03377 Expose sqlite3_table_column_metadata() to wasm.
FossilOrigin-Name: c31eb509e5cb1025de058132ee9a45d70c84ee47a6abe18811a65ce339f062a0
2022-12-09 02:12:43 +00:00
stephan
6ca03e14e9 Expose sqlite3_db_status() and sqlite3_db_config() to wasm, noting that the latter requires several internal wrappers to account for the various varidic forms (C varargs cannot be bound to wasm).
FossilOrigin-Name: d5753668915c1db204fa80153614653243081ffaddea22f26ad59bb1836948b9
2022-12-09 01:49:17 +00:00
stephan
d27c3e4e7e Reorganization and renaming in the new VFS/vtab JS pieces.
FossilOrigin-Name: 1c2dda177a11fcc5b66e5554507c23ba4b9948a710b3bccfb26963b9851d40a4
2022-12-09 00:50:39 +00:00
dan
2797ac028c Support ".scanstats est" to enable including planner estimates in query profiles.
FossilOrigin-Name: 0fe71287c953bd813a34ba383f5debd4d1fc8bf3c74e1e27adacec0d6e207ded
2022-12-08 21:05:33 +00:00
stephan
1a9a29815a Further docs and minor cleanups in the JS virtual table helper.
FossilOrigin-Name: c31e7488ac1a6b957782b72bd026b1f0590637b631e44a1fdf1dedeb5c587819
2022-12-08 18:18:37 +00:00
stephan
500fa7d518 Ease-of-use/legibility improvements in the virtual table JS helpers.
FossilOrigin-Name: 54c7ad7e08bdb87579398ade366605bfa2e2538a94aabcc6e4cda8e173649760
2022-12-08 17:07:27 +00:00
drh
a60d61bf14 Improved comments on the new co-routine logic. Fix a C++-ism in the code.
Update test cases to accommodate the more aggressive use of co-routines.

FossilOrigin-Name: 9243e850ae656d16adc8f0e5c4dcf3dcf476312cee192c39c38685fc437ccbbd
2022-12-08 16:47:16 +00:00
stephan
4bfacc4b40 Initial support for virtual tables implemented in JavaScript.
FossilOrigin-Name: a1454744c770a30a32a6d7b7fc59ef7be48cf67348b238540592850d7c2c7757
2022-12-08 15:00:53 +00:00
drh
05cb9d881e Do not use a co-routine on a subquery that is participating in a self-join.
FossilOrigin-Name: ea4306a03cd8dd706100dac3f11653068a25c50c5d06c34ad08534aec0a580bc
2022-12-08 13:56:06 +00:00
stephan
56f7813141 Describe the SQLITE_DBCONFIG_RESET_DATABASE flag's policy regarding virtual tables, per /chat discussion.
FossilOrigin-Name: 53dcb81b029e4422bdc0b5cf694183854b997195427d437b6154ed4dad7ad0ba
2022-12-08 12:51:11 +00:00
stephan
16bf97b507 More work on the JS vtable tests.
FossilOrigin-Name: 51e3c3b569dce2097063d39dc484f44b2f98cad0a902ef66765ca4cdc3e06f47
2022-12-08 10:06:07 +00:00
stephan
d061f14466 Got JS non-eponymous vtable working thanks to a hint from Dan.
FossilOrigin-Name: 750719b4981df62fa2ff3665e6f559ec760609ad2493495628295ad9ae6024fc
2022-12-08 09:06:20 +00:00
stephan
ab8b22a03d Remove some dead JS code and tweak some docs.
FossilOrigin-Name: 0ee495452c014680697aa9035c245024df127a52d1820ab0e02580a015d96ecb
2022-12-08 04:19:38 +00:00
drh
619ff3f505 Merge the latest fixes and enhancements from trunk into the
coroutines-exp2 branch.

FossilOrigin-Name: 1c5f41986f5af181bf389675361c9f176e9195e847319f07ebd5c87992ded38b
2022-12-07 21:19:37 +00:00
dan
7f4b066eb2 Reduce the overhead of SQLITE_ENABLE_STMT_SCANSTATUS some.
FossilOrigin-Name: 212927e97e7be7d237de08359dce0dfb9211ac406b32009a6e15afd79c006475
2022-12-07 20:09:54 +00:00
drh
209dbab997 Fix harmless compiler warning in the dynamic continuation prompt of the CLI.
FossilOrigin-Name: 68947b0a1147365a29e335d5e4dc55fe5d9afe3562a0709b111067d6017c5a42
2022-12-07 19:51:48 +00:00
larrybr
7474de702d Omit CLI use of pragma_table_xinfo when it is not defined in the build.
FossilOrigin-Name: 976c23520fa64b39aa54047f2fd12445e65940206768ce51c0d690d0d0d570ab
2022-12-07 19:29:13 +00:00
dan
f2cc3387f7 Have sqlite3_stmt_scanstatus() report cycle, loop and row counts separately for creating an automatic index and using that automatic index.
FossilOrigin-Name: 3bc9df82ea5b0fb085c56a326a65e19c9baf98d48d8fa6344c0d7004747594ba
2022-12-07 17:29:17 +00:00
drh
7c66faa634 Streamline and improve testing of the locking in the memdb VFS.
Follow-on to [15f0be8a640e7bfa].

FossilOrigin-Name: d71a08375aeb525c10037c373b8eeb7e29f7dfaf7c4bfc02f4d99616c5940405
2022-12-07 16:58:04 +00:00
stephan
1eb1b59b89 Work on an alternate (slightly simpler) approach to binding JS vtabs. Non-eponymous vtabs are not working, for reasons as yet unknown.
FossilOrigin-Name: 6a0fefb93bcccd950df211cf5c2f49660c7b92115dd01b2b508a4ab9e3ab3d23
2022-12-07 07:22:34 +00:00
stephan
30da58c5d6 Add addOnDispose() method to Jaccwabyt and code-adjacent minor internal cleanups.
FossilOrigin-Name: 6a2723fe3f28dd94328d901e64e1e9ee9a1b2e9eeaed6c54038a5b83c914db78
2022-12-07 03:42:39 +00:00
drh
b54f71e205 Fix a (harmless) off-by-one error in code generation that comes up when
doing a DISTINCT query against a virtual table with an OR term in the
WHERE clause and where the ORDER BY clause has 64 or more references to
the result set.  [forum:/forumpost/dfe8084751|Forum post dfe8084751].

FossilOrigin-Name: 04af7ef77043702f93cbff23548610759786893bd3d4d6fc08181e1e249c6663
2022-12-07 00:14:25 +00:00
larrybr
7726629ab2 Enhance CLI .sha3sum to warn of text fields that are not to-blob-to-text reversible.
FossilOrigin-Name: bbde0f36d03cdbbc749427fe7d2dafd5c5031c9e655ebd772857b521f53eb18f
2022-12-06 19:32:07 +00:00
larrybr
1751f875bc Merge from trunk prepratory to branch end.
FossilOrigin-Name: 1d01f8483af7b6a4e93a49fd8bbb6a2b9300e969b574efeb96d56081a33055c4
2022-12-06 19:25:07 +00:00
larrybr
3c01af6ffc Avoid several -Wall warnings in textfixture build.
FossilOrigin-Name: 03ae8680e430c6d2c39ca26fa2cb6eed46e3c3e52b53f7a8bf548560446c6d3d
2022-12-06 19:20:49 +00:00
larrybr
09d953706c For CLI .sha3sum, emit warning to stderr for any invalidly encoded text fields.
FossilOrigin-Name: 8e833ecc81367658e81acd1d3a0242ab954a62d6f719af56f1d185656d0b73e6
2022-12-06 18:48:37 +00:00
dan
2adb309ead Have sqlite3_stmt_scanstatus_v2() return an NCYCLE value for all loops, not just virtual tables ones. The value returned is the sum of the NCYCLE counts for the various opcodes that move or read data from the table or index cursor associated with the loop.
FossilOrigin-Name: 9499b2f51e8174c6b8a67840c92ba23b7dd1dc8dc2b91fca0c5dc07b71662149
2022-12-06 18:48:06 +00:00
larrybr
29226fc023 Clear a few more -Wall warnings and simplify dynaprompt feature keep/omit macros.
FossilOrigin-Name: 540e895d877fab1ea138786e56923a202018f68c78199a89adfc296c75735b30
2022-12-06 17:59:05 +00:00
drh
ad9ff1d5f2 Simplified experimental changes to promote the use of co-routines. Less
cruft than the coroutines-exp1 branch, but still does not work.  Checked in
as a work-in-progress.

FossilOrigin-Name: e2318a30bf6ad2aeb4c4cb29661bc24ff78eb51bf07decc4b8da1ecac0015ef0
2022-12-06 15:24:05 +00:00
drh
d84f185f97 Fix compiler warnings in the new dynamic continuation prompt logic of
the CLI.

FossilOrigin-Name: 0d80500d358fa1c9b5867c2c8250d278ba813bf2ad81bb0bc3f820a71489b374
2022-12-06 15:11:13 +00:00
drh
b1026aeda9 In the unix backend, when implementing the defenses against small file
descriptors, delete a file just created if it was opened with
O_EXCL|O_CREAT so that it can be created again the next time through the
loop.  Fix for the problem described by
[forum:/forumpost/699af709ab3a8ccf|forum post 699af709ab3a8ccf].

FossilOrigin-Name: c0cfe0582add87981826d124a0763482f51fae4b105b5a970dd56919f1d04d60
2022-12-06 13:12:33 +00:00
dan
109f173b6f Support an SQLITE_SCANSTAT_NCYCLE statistic for "CO-ROUTINE" elements.
FossilOrigin-Name: d3f6a207fd1b3f53688fa1ff35eb71e1c5bcc4115c0c35bb187d22ccf7100b71
2022-12-06 11:41:05 +00:00
stephan
241cde98b8 JS vtables: add infrastructure related to accessing and modifying sqlite3_index_info.
FossilOrigin-Name: 0d77c348039926c24e0fb50a7dc7e4b62895cd201c021f8e29832917e4b8b09f
2022-12-06 11:21:46 +00:00
stephan
d254db53e5 Remove deprecated symbol sqlite3.opfs.OpfsDb, which was renamed to sqlite3.oo1.OpfsDb on 2022-11-29.
FossilOrigin-Name: 0ce51bed65d5e430364f74bf959fb76c42ac5eec0769490231d8c8110a1f388c
2022-12-06 09:49:04 +00:00
stephan
75435f8b2d Rename wasm.cstringToJs() to wasm.cstrToJs() for consistency with other wasm.cstr... APIs.
FossilOrigin-Name: cbf483ea0ba3e6dc08ad7ed654380f818544b4c3cedfdb8aa848a83298268ceb
2022-12-06 08:46:39 +00:00
stephan
671386c637 Add wasm.cArgvToJs() to support sqlite3_module::xConnect().
FossilOrigin-Name: c3ebdccf94d5e63c229bf91056c08052d78732e663334070ef3b0ef6fb4bfb8f
2022-12-06 08:39:17 +00:00
stephan
b849832a79 Minor internal JS code/docs cleanups.
FossilOrigin-Name: 21331bdd36a91b07a687ffadce392dcf2ccd0fd824b35d9dd027d4289a40fc96
2022-12-06 08:21:23 +00:00
stephan
f2bbef3951 Merge trunk into wasm-vtab branch.
FossilOrigin-Name: d106edb956bbe22bddc2c6e5bcdf4fb8f797794c725c2e359e3fa4b31d881843
2022-12-06 06:21:02 +00:00
stephan
2a665edbd4 Minor test tweaks.
FossilOrigin-Name: f902f3b2c79d6c699ead1efeb1426e1e0f4ac709afdff88be1de62f34f3d5ccc
2022-12-06 06:16:11 +00:00
stephan
6b271abc98 Add a demonstration sqlite3_vtab/module implemented in JS, based on ext/misc/templatevtab.c. Add oo1.selectArrays() and selectObjects().
FossilOrigin-Name: 60482c97e02bc4cafefef281be0cf0bc8c5c53232162829c137f3f7a80cdc534
2022-12-06 06:09:03 +00:00
larrybr
f9d40801c3 Add optional feature: A CLI continuation prompt which reflects open lexemes and parens, similarly to PG shell.
FossilOrigin-Name: f41f18b1c3c950565ee3c237aebb51cfc3241813c6425813a8217e07aa0153a6
2022-12-06 05:31:20 +00:00
larrybr
9ab1598e52 Add optional feature: A CLI continuation prompt which reflects open lexemes and parens, similarly to PG shell.
FossilOrigin-Name: dac2ddc287db7a68d0cd49b785060f62290868fbb1aa2ee09e54d3b1acfbf55f
2022-12-06 05:09:51 +00:00
dan
d2db31c971 Enhance the sqlite3_stmt_scanstatus() API and add sqlite3_stmt_scanstatus_v2(). For creation of enhanced query performance reports.
FossilOrigin-Name: 4893b4e3eafc7c9c22b24717f90a585862203f987cf108b079ce6e946093e675
2022-12-05 19:16:23 +00:00
dan
07c8e08889 Update comments in sqlite.h.in to account for sqlite3_stmt_scanstatus_v2().
FossilOrigin-Name: 009462f2344b1f468cf9440343a47fec68d783a2bfb4fa6168bb227ec910b918
2022-12-05 18:52:12 +00:00
dan
77e171e8fa Merge latest trunk changes.
FossilOrigin-Name: 1a72777b1279f74f212fb2f675a4594a238e5d28f048879d7f5ad5287673c3c4
2022-12-05 18:26:37 +00:00
dan
a3d0c158a0 Add loops and rows counters to "USE TEMP B-TREE FOR ORDER BY" records. Also fix the sqliteHwtime() function so that it returns a 64-bit value.
FossilOrigin-Name: 41a0e05e8c0fca3b803fe4bd017a157c172b2ca518356a2a4d4ed4f12d01a1e3
2022-12-05 18:19:56 +00:00
stephan
2582d418d3 Remove two features of jaccwabyt which were fundamentally flawed, along with approx. 250 lines of unit tests which heavily relied on them. Thankfully, none of the sqlite3.js-level code used those bits.
FossilOrigin-Name: a190abc307847174f36421eaa3f47ef349c6f84a2bb35857fa64f64bbe722708
2022-12-05 15:05:46 +00:00
stephan
cfb66014bc Jaccwabyt (JS) doc updates.
FossilOrigin-Name: a329a809b5da135a9c251e4d5f637d45d01d0248110ac05f2ad8f01d9df38c64
2022-12-05 14:32:35 +00:00
dan
49d402684b Add test case that should have been part of previous commit.
FossilOrigin-Name: dc7dd2d3e50e7cc474b22f1b5b219da32bcd7aa1ba56864d1dbcf0d3a6fa06f2
2022-12-05 14:20:54 +00:00
stephan
e1d25177c2 Expose sqlite3_get/set_auxdata() to wasm. Minor test app CSS tweaks.
FossilOrigin-Name: 44659ad32a9fe6363badfc5dbb0bd51d6fb2ee1c8aa47b71e9cf3dbd631fde9e
2022-12-05 14:13:55 +00:00
dan
27ef91b551 Fix a problem in the memdb vfs xLock() function allowing clients to upgrade to EXCLUSIVE locks when other connections are holding SHARED.
FossilOrigin-Name: 15f0be8a640e7bfa4130edd4650a745337bd96083b119a1553f9abf9ff066806
2022-12-05 14:12:14 +00:00
stephan
e0818715b7 Export collation-related APIs and strncmp()/strnicmp() to wasm.
FossilOrigin-Name: c3c56d9b944fd0d806d8dad9f0c7be3d7a5441765310908872cc525d82ab6a33
2022-12-05 13:33:42 +00:00
stephan
9a49a97487 Export sqlite3_vtab_collation() to wasm. Rename 'flexible-string' JS argument adapter to 'string:flexible' for consistency.
FossilOrigin-Name: 15f8042fddaeabab43dd187c463d3ccc56758cbf19bf2ca4837d9087a4850c1a
2022-12-05 13:12:48 +00:00
stephan
8c696375b5 Remove SQLITE_EXPERIMENTAL tag from sqlite3_vtab_collation() and fix a related doc typo.
FossilOrigin-Name: 35d670b3593a46e13ded541ef477fa35dac6bcb9c31e6cf4b90bd7fa550a8ee2
2022-12-05 13:07:06 +00:00
stephan
cf8f0d2046 Rename 'static-string' argument adapter to 'string:static'. Replace JS unit tests which were lost via editing a generated copy of tester1.js instead of the original tester1.c-pp.js input file.
FossilOrigin-Name: 9d81d51d5a255b42f8416da850c992a9e4c8eebc940e0702a9262cfcaa6d7b2f
2022-12-05 11:54:13 +00:00
stephan
0adef09374 Export sqlite3_bind/value/result_pointer() to wasm. Add 'static-string' argument converter to support the lifetime requirements of bind/result_pointer()'s string argument. Correct an endless loop in wasm.cstrlen() when passed a non-C-string argument.
FossilOrigin-Name: a94552434a657376d5ce1831de05c1b15fb153020848cd825fb0df413c3baa70
2022-12-05 11:30:39 +00:00
drh
fe8ecfd696 Remove obsolete "experimental" comments on the virtual-table interface
documentation in sqlite.h.in.

FossilOrigin-Name: 28fc32abdcb1c6af19f0926a3a7317e15930a0ba89645d5ffbf6ce99d8463273
2022-12-05 10:50:06 +00:00
stephan
08fc64ea04 More work on the JS side of the virtual table APIs.
FossilOrigin-Name: cb9881ec001b0e2faf047e57acfd1722d2b546255a54e0f850f568edfe2df1cd
2022-12-05 07:51:25 +00:00
stephan
864c3c029b Remove some dead code. Improve some error checks and comments.
FossilOrigin-Name: 6712fbe46a97867cea309f78a274edbb6bd166a505b41e18a580306da0e063db
2022-12-05 05:45:00 +00:00
stephan
e177447972 Initial infrastructure for adding virtual table/table-valued function support to WASM.
FossilOrigin-Name: c202d7a0398b9aabc2babba5c4c91a313f32bbf37549d419775642bb4aa3936a
2022-12-05 05:30:03 +00:00
drh
95ade3bdb9 Improved query planner cost estimates. Fix for ticket [e8b674241947eb3b].
FossilOrigin-Name: 1b779afa3ed2f35a110e460fc6ed13cba744db85b9924149ab028b100d1e1e12
2022-12-05 02:52:37 +00:00
drh
b542298376 Use the smaller estimated row size for searching IPK tables, but use the
original larger row size estimate for scanning, since the leaves can have large
rows.

FossilOrigin-Name: df3818997b822743ac407dde45c5fd75845ca40f461e31350d86963dffec6cd6
2022-12-05 02:42:30 +00:00
larrybr
8af6d712da Fix safe mode authorizer callback to reject disallowed UDFs. Reported at [forum:/forumpost/07beac8056151b2f|Forum post 07beac8056151b2f].
FossilOrigin-Name: cefc032473ac5ad244c0b6402c541b2f76c0c65a041bda03bfbe7c0e2c11fac2
2022-12-04 23:20:38 +00:00
stephan
a81c5b3a88 Export sqlite3_result_zeroblob/zeroblob64() to wasm.
FossilOrigin-Name: a60e56627fc0ef8831429941d429ee02c6ee51ce5a2c1af581dc5bc5a00d911e
2022-12-04 08:16:33 +00:00
dan
ad23a47acd Enhance SQLITE_SCANSTAT_NCYCLE so that it reports on virtual tables.
FossilOrigin-Name: 622d8eb3724bee617b55d6fb71f1a2d683db6858065adced6bf3ce9525bcd6b5
2022-12-03 21:24:26 +00:00
drh
1d8f4e6ce8 Increase the nominal row size for IPK index lookups slightly, for better
balance.

FossilOrigin-Name: 1a61c500add4a2bfe80c0c691d559cfca166dc5f8262651a58da7ec16a51d430
2022-12-03 19:04:09 +00:00
drh
878b44c128 Add TOTAL rows to the output generated by tool/vdbe_profile.tcl.
FossilOrigin-Name: 9800586393c9d3b82459ef657620d245a7985ef5fa389b8a9ea633d6a29c7299
2022-12-03 18:21:30 +00:00
dan
f6f01f15dd Add CYCLES scanstat measurement to "USE TEMP B-TREE FOR ORDER BY" lines.
FossilOrigin-Name: 365011ae8b7e3fcaa2c4ea9601231a3ef2223e60d7a53ec33013109dca22ad58
2022-12-03 18:16:25 +00:00
drh
fcf4243c36 Add a test case to show that ticket [e8b674241947eb3b] has been fixed.
FossilOrigin-Name: e20de6d450c2b4d5bde737f625de16ff53262c22ce7aa6917b64f1665170d33f
2022-12-03 17:23:29 +00:00
drh
e4fa4794be Further improvements to the estimated cost of sorting. Take into account
the number of columns to be sorted.

FossilOrigin-Name: f3290cf83b7c02d17d85d8942954f052b486c370cd5ec732969da9061dc1d19a
2022-12-03 17:09:15 +00:00
larrybr
30cbcc0004 Cause CLI .sha3sum to warn of text fields that do not survive CAST(CAST(t as BLOB) AS TEXT) due to invalid UTF encoding.
FossilOrigin-Name: 123f2a0785790addf9c60a0fd09077dda9cb84d33a2594901a2b22bb555be491
2022-12-03 16:09:32 +00:00
stephan
9baafdabf7 Correct a memory leak in tester1.js.
FossilOrigin-Name: e42b052dd754e577b8429e2430821c5f88096170ffa58b4e5e3cb7ee19b6c37d
2022-12-03 15:41:29 +00:00
stephan
cbcc08ddc4 sqlite3.wasm.allocFromTypedArray() now optionally accepts an ArrayBuffer as its argument.
FossilOrigin-Name: 75a1a796f86d289c7275666fab19013934775dcccaed44a1a61d1749a6cb99c9
2022-12-03 14:58:45 +00:00
stephan
09c27a59db Rename wasm.xWrap.resultAdapter() X:free entries to X:dealloc for consistency with wasm.dealloc(). Add an undocumented feature to replace wasm.alloc/dealloc/realloc() with the C-standard allocators (after an allocator misuse led down a several-hour rabbit hole trying to discover a mis-free() violation). Related test updates.
FossilOrigin-Name: d9807656f8a7c2a893d3f68ee5592f44826b8e999ae66f7d9000674b5c1b0207
2022-12-03 13:10:58 +00:00
stephan
54ac04c831 Doc typo fix for SQLITE_MAX_ALLOCATION_SIZE in malloc.c. No code changes.
FossilOrigin-Name: ed1ed21221b048ac5a5275cdfc4d9b2a406acdc7d4b648c3b61bcc822d88d955
2022-12-03 13:05:33 +00:00
stephan
fed255d794 Move kvvfs xRead()/xWrite() buffer from function-local stack memory to heap memory to accommodate changes in emsdk 3.1.27.
FossilOrigin-Name: f1da32410ca7b808b3bef5f5a59766e7281e9e6ea343c8b979599bf1fc1060f5
2022-12-03 11:51:29 +00:00
stephan
85ef4e4344 JavaScript: add sqlite3.wasm.realloc(), sqlite3.capi.SQLITE_MAX_ALLOCATION_SIZE, and related tests.
FossilOrigin-Name: eeb84ba5de1152ef0f42105b8b285fdee9f5ad58281e60a4e0c8b1d6de1dead8
2022-12-03 11:16:55 +00:00
stephan
2564ca7d15 wasm build: rename the path to the wasm docs checkout, for clarity and consistency.
FossilOrigin-Name: b820db32365b2ca8e2397fd6ea85883e4555ffd82948e248a0f98415b7328349
2022-12-03 03:06:16 +00:00
stephan
1369d6be02 wasm snapshot and doc-related build automation tweaks.
FossilOrigin-Name: 13eb1abd06f55fb88fc7f7be6149fd94b12057d9c38cc6b97bec3940e7e01f04
2022-12-03 02:42:21 +00:00
stephan
a37fed0f62 Rework the oo1.DB's distinct-per-VFS post-open() step to accept either a batch of SQL or a callback function. Increase OPFS's busy timeout to 10s.
FossilOrigin-Name: 9feefe253ac487cb52be6bdf91bdd305963266716baa08f2bf9505954ee76321
2022-12-03 01:59:03 +00:00
drh
1edd0a089c Tuning the query planner by adjusting the weights that predict the relative
performance of sorting and index lookup.

FossilOrigin-Name: 9f2806da4d88beceac2e81e05421f00481dd3dd100b096cd2ae6c828adb42ca7
2022-12-03 00:52:21 +00:00
dan
231ff4b027 Enhance the sqlite3_stmt_scanstatus() API and add sqlite3_stmt_scanstatus_v2(). For creation of easier to read query performance reports.
FossilOrigin-Name: 55800833645739efeddcacef464c623931cb6aeb43f4219b4e4faf473c25c8bb
2022-12-02 20:32:22 +00:00
stephan
bb4e4a4840 Minor internal tweaks to the OPFS VFS. Resolve a missing result code which lead to a null deref in xFileSize().
FossilOrigin-Name: 57dd593ef0efa17dfb3a9f4eac36d5b8b879e271de817d8cd94a8c8b56d31870
2022-12-02 18:56:37 +00:00
stephan
95bc4d67bb OPFS VFS: translate createSyncAccessHandle() exceptions which appear to be locking violations to SQLITE_BUSY. This seems to improve concurrency considerably even with a reduced retry count of 5 (was 6).
FossilOrigin-Name: 0d36021d107d3afca190ad61c3380536ad0cc2d493d345d48f9f9c1191741128
2022-12-02 18:06:26 +00:00
drh
d2603adf46 For the sqlite3_bind and sqlite3_result interfaces for UTF16 strings, round
the number of bytes down to the next even number, to avoid creating a UTF16
string that is an odd number of bytes.
[forum:/forumpost/411199488d065f83|Forum post 411199488d065f83].

FossilOrigin-Name: b57e3c3db00a6bc6db20c82530479f9eba7e37b731f0da6fe81682e84c7ac916
2022-12-02 17:52:52 +00:00
drh
8b5d7fda59 Use sqlite3_result_int64() instead of sqlite3_result_int() when returning
potentially large values from the DBSTAT virtual table, to avoid integer
overflows in the result.
[forum:/forumpost/ada2ab044f|Forum post ada2ab044f].

FossilOrigin-Name: 5652154a8c93cf3b1ff6c2e55e94abbe995b0bb625f733461df20e006c2f13f8
2022-12-02 15:31:47 +00:00
stephan
80ea1f406a Minor touchups to the JS test index page and test server push rules.
FossilOrigin-Name: 0881f3e92364b3dc81443220451e853c0763efaf97653a6348bc39bd9bdb23ad
2022-12-02 11:35:21 +00:00
stephan
5ad4e89659 wasm builds: explicitly set a default stack size because emsdk 3.1.27 reduced it from 4MB to only 64kb, leading to memory corruption when kvvfs is used (it requires at least twice that for I/O).
FossilOrigin-Name: 758112460fb624198a144ed7d8d2324497fa72a2eee80010bd22b621e064b389
2022-12-02 10:43:14 +00:00
stephan
d09414e623 wasm: after building snapshot zip file, emit instructions for pushing it to the test server.
FossilOrigin-Name: 9615c77919fee60d708d72729c741b373a89900aabc318e0ceb4154638cdf339
2022-12-02 09:23:38 +00:00
stephan
1078ee0959 Correct the problem which triggered the rollback in [7eec635562f6]: an incorrect default db page size (not a multiple of 512 bytes).
FossilOrigin-Name: e06e490c240aa56b616e6f0380b5d08abf06f35f9e683e5150c5ac464eae9e55
2022-12-02 08:51:22 +00:00
stephan
20f0128acc Roll back the SQLITE_DEFAULT_PAGE_SIZE part of [c260895faacb34] because kvvfs does not work at all with a page size of 8kb.
FossilOrigin-Name: 7eec635562f65592121d7ff0a31a7b4ff6cdfe38e657f326302ef851b3b37c3f
2022-12-02 08:38:04 +00:00
stephan
f3409db2d1 sqlite3-wasm.c: code legibility and coding style tweaks. Increase SQLITE_DEFAULT_PAGE_SIZE from 4k to 8k, as that improves OPFS speedtest1 performance by roughly 12%.
FossilOrigin-Name: c260895faacb3458c557778630756d02a8520c0f1864bddcf86cdd27ef4a42bd
2022-12-02 08:29:03 +00:00
stephan
cc70dfe679 Expand JS tests for db export/import and document reason it cannot currently work with kvvfs. Fix a minor JS build dependencies bug. Update page title with PASS/FAIL prefix for tester1.js to improve overview when launching multiple test tabs. Add ability of tester1 should-run-test predicates to report why a given test is disabled.
FossilOrigin-Name: 75f610d3a4cf3d972220f9abc27cdf5990451e3835ceb9cf66973934004dfc5c
2022-12-02 07:14:56 +00:00
stephan
31892c2820 Remove extraneous/unused sqlite3.oo1.version object. Add httpd makefile target.
FossilOrigin-Name: 8e4d30ac033a6d9019a7eeedfe788dc0120f565cef2ae8f09d2bf32eb94d8a33
2022-12-02 03:37:49 +00:00
stephan
919dbc846a sqlite3_js_create_file() now accepts an ArrayBuffer data source. Add test for OPFS-based export/re-import. The (sqlite3*) argument converter now optionally accepts sqlite3.oo1.DB instances.
FossilOrigin-Name: 14a84b67fb17e16a5691ea4bf7f374123ac73a361a5d3d0efca53788d2001e3a
2022-12-01 15:22:03 +00:00
stephan
9ec1a7a7a0 Reformulate and simplify some JS tests related to the previous checkin.
FossilOrigin-Name: 9ea2d3dcf798393a7fd231e199c0e2c6302949fe2a7f2573178fb0e50c78a2f4
2022-12-01 04:45:51 +00:00
stephan
2b2199570d Expand "sqlite3_vfs*" JS-to-WASM function argument conversions to accept VFS names (JS strings) and capi.sqlite3_vfs instances. Implement sqlite3_js_vfs_create_file() to facilitate creation of file-upload features which store the file in VFS-specific storage (where possible, e.g. "unix" and "opfs" VFSes). Correct an argument type check in the SQLite3Error and WasmAllocError constructors.
FossilOrigin-Name: e1009b16d351b23676ad7bffab0c91b373a92132eb855c9af61991b50cd237ed
2022-12-01 03:55:28 +00:00
drh
85ec20ac66 Add a testcase() macro to verify that the case of a NOT NULL error message
hitting the string length limit.

FossilOrigin-Name: 91f50964c10fb12d889bda7d597d8edf475d97d2d8b534b4400e0fed1d753c6a
2022-11-30 21:18:23 +00:00
drh
75fba2fd28 Fix an over-zealous assert() reported by Yong Heng.
FossilOrigin-Name: 6ee61f8cede4998f0c838d6506b058c6b09f34b3d7f30ed296100785c93f8d00
2022-11-30 20:22:31 +00:00
drh
2a757658a0 Attempt to rationalize the bits associated with ".wheretrace". Provide
a decoder key in sqliteInt.h for what each bit is intended to do.

FossilOrigin-Name: 8ec361695a107a94f2cf6a7fe509656a99d85d49bd7c74133c69903f059a2675
2022-11-30 19:11:31 +00:00
stephan
ec192e0659 Rename some JS files from X.js to X.c-pp.js to keep the maintainer, and downstream build customizers, aware that those files contain constructs specific to the c-pp preprocessor and will not run as-is in JS.
FossilOrigin-Name: 2eade7c7b17a186735c72974c11a34798a08364861d0f307e897ba765c0a93c7
2022-11-30 18:21:01 +00:00
drh
a42281a312 Always use nanosleep() (instead of usleep() or sleep) if the
_POSIX_C_SOURCE macro says it should be available.

FossilOrigin-Name: 6620c57b9d3eae7226a412318b43393196df069b5b90aae0cf1743fdd2d102dd
2022-11-30 13:44:31 +00:00
stephan
8ae9545577 Install sqlite3_malloc/sqlite3_free() as the JS-side WASM allocator (as opposed to replacing C-level's malloc()/free() with them). All tests work and this eliminates the potential for allocator discrepancies when using the (de)serialize APIs.
FossilOrigin-Name: 95c78f6b46e0d8efa4313061f47677479f48610b7a7261dc8d0fb1859aca2ad9
2022-11-30 11:50:16 +00:00
stephan
c5141c9efa Simplify how the OPFS VFS async proxy copies initial state sent to it from the synchronous side of the connection. Make the lock-wait time a multiple of the wait-loop timeout interval.
FossilOrigin-Name: eddafafffa634a42ceeed70aa3fc58be130527612157a4bf4ff9e65c7f6dc26c
2022-11-30 08:37:17 +00:00
stephan
e7f5118bd3 OPFS VFS: remove an invalid TODO and fix a property name typo which caused xCheckReservedLock() to always report false.
FossilOrigin-Name: 3b037caa2fa07b6c44c485574e9e5dc71f4a8e82bc902c1321bb0b918b139c74
2022-11-30 07:48:35 +00:00
stephan
36a0163e40 Rename some OPFS JS files. Prevent JS bindings of sqlite3_uri_...() from performing JS-to-C-string argument conversion on their first argument, as doing so is specifically illegal.
FossilOrigin-Name: 79832808de2cbdba140ed9e0558f1502b51d131ab4315265315922cda7b748cb
2022-11-30 07:17:29 +00:00
stephan
ad4f782815 Refactor a significant chunk of the OPFS sqlite3_vfs init code into sqlite3.VfsHelper, and internal-use-only API encapsulating code relevant to creating new VFSes in JS. Intended to assist in pending experimentation with an alternative OPFS VFS.
FossilOrigin-Name: e25d7b080a807e35b32cb885ea75b384130e5c6e936dfef783c5b45d9bfe77d8
2022-11-30 05:27:36 +00:00
stephan
d0945f4638 Doc and logging text tweaks in the OPFS async proxy and test app.
FossilOrigin-Name: 7ce8608e221924d2c7067687eb6eef0f3cab181d5b4132e55a67d8514b6ce94b
2022-11-30 03:08:50 +00:00
stephan
72ee096775 sqlite3.oo1.OpfsDb: default to journal_mode=persist, as current tests show it to be marginally faster than truncate/delete in Chrome v109. Also increase default busy_timeout from 2 seconds to 3, admittedly on a whim.
FossilOrigin-Name: d0c8fa30a31c691bc1be5e98d806eeb1e23a8fc6cd54d87e5c1b720aa936e707
2022-11-29 18:28:40 +00:00
stephan
6e86d5569d OPFS speedtest1: hide a currently-broken/to-fix WASMFS-build link.
FossilOrigin-Name: cde95d382f8debcbca27c4aaf08470ffda35ab10d723a887786669367590ad3c
2022-11-29 18:00:01 +00:00
drh
7741f3457a Change the handling of hwtime.h to make it easier to compile performance
measurement builds that make use of hwtime.h.  This should not affect
productions builds.

FossilOrigin-Name: f64a224244743ab121371abd516fccbfc93c110e0952211764bd1b217e792c1b
2022-11-29 17:52:04 +00:00
dan
3c3896c9d6 Fix legacy build system main.mk to include basexx.c in testfixture builds.
FossilOrigin-Name: 8c9200b7e156206c4270ff60631c57d5898e2769f7f68294ce652bfec4cfa7c2
2022-11-29 11:28:45 +00:00
stephan
a302e68476 Rename one instance of opfs.OpfsDb to oo1.OpfsDb, as per [0c5c51f4fb04].
FossilOrigin-Name: 75b04c9b302ec66749d8f072a49e61de9640b868bec99eadeb5b4bdef354c336
2022-11-29 06:56:09 +00:00
stephan
ceedef888f Minor internal cleanups and docs in the OPFS sqlite3_vfs.
FossilOrigin-Name: 61799b05ff232c2ac349169c27bfe7f8d9277366093b0c9dd2739828993b3066
2022-11-29 06:09:32 +00:00
stephan
04184761de Internal restructuring of the OPFS sqlite3_vfs in order to facilitate certain experimentation and improve error reporting/hints if it cannot be activated. Deprecate the name sqlite3.opfs.OpfsDb, preferring sqlite3.oo1.OpfsDb for consistency with JsStorageDb and any future DB subclasses.
FossilOrigin-Name: 0c5c51f4fb04a4b90c50ec9704cfea9a3fb7d7d0ee55c1b0d4476129188217a6
2022-11-29 05:25:08 +00:00
stephan
e6b0154138 Add an explicit warning about the current API-instability of the sqlite3.opfs namespace, which may need to be eliminated based on re-thinking of how the OPFS sqlite3_vfs is registered. Comment changes only - no code.
FossilOrigin-Name: 0cb2fd14179397051a25d066256a553fc198656d5668c7010c016f2b8f495bf4
2022-11-29 02:23:12 +00:00
drh
d3fc2e63aa Check-in [8d5b76593d82b3a5] contained an error that was causing some obscure
error codes to be lost.  Fixed here.

FossilOrigin-Name: 46cdd3637d6a206ad2bcf8653cc6f2c7a886a16cc7685c45967938609941a755
2022-11-28 21:17:30 +00:00
larrybr
0b0070f1bd Get ext/misc/basexx.c into the testfixture.exe build for MSC.
FossilOrigin-Name: bb2c5d088e4784f6763eb0ea2a8542ad2129529f181fa92963c7231d7a68f25c
2022-11-28 21:09:49 +00:00
drh
5b046dadfc Fix harmless compiler warnings.
FossilOrigin-Name: 8d5b76593d82b3a57bc904ced33c24cd49369868b5dd2fe7f2c7b114f5aee2f6
2022-11-28 20:08:15 +00:00
drh
57ba01de4a Implementation of enhancement request [695a1a53dea6b240]: The query planner
has improved awareness of when indexes on expressions are covering and adjusts
their costs accordingly.

FossilOrigin-Name: e3474d79b27298e96e7686e5a6f9a8e736b8a6568a0a08fb1abe5bcca038ca63
2022-11-28 19:42:48 +00:00
dan
1b3d13e65e Add the SQLITE_FCNTL_RESET_CACHE verb. Use it to ensure that the page cache is purged before and after a the recovery extension is run.
FossilOrigin-Name: 6db0bc4bc0d272b610bef2aeeae43f539ed6e7cc0a9cc767d5af85ecb0019d5f
2022-11-28 18:41:41 +00:00
drh
cbb9585805 Test cases added derived from the enhancment ticket.
FossilOrigin-Name: c022c0152ad61a4f56e36f4062609073e2273fbf6f826c20652159be229c2d46
2022-11-28 18:17:42 +00:00
drh
8ffa77f3a9 Merge trunk changes into covering-index-expr branch.
FossilOrigin-Name: 89d775ada39aed4dc532374ace02156d07dc06e8ae54a194608af0c5a582d20f
2022-11-28 16:11:10 +00:00
drh
84606c9737 Rework the covering index checking routine, whereIsCoveringIndex(), so that
it can return a "maybe" result for aggregate queries where we are not exactly
sure.  The index is scored as if it is covering, but the main table is
still opened.

FossilOrigin-Name: b8eec4214363192e6f3e12b3faa5810d8269a5fdaecab3ec09b02e5002cf798a
2022-11-28 15:23:53 +00:00
larrybr
e862b5fe1d Add (optional) base64 and base85 UDF extensions.
FossilOrigin-Name: b44ab10c49bc2895483a9d40813be3798710ee713cc4bf04e449dce55a68452a
2022-11-28 14:51:50 +00:00
larrybr
d8d68a5b8e Sync w/trunk, zap surplus space.
FossilOrigin-Name: b8345630a2a322234bda49ee4b996f6ba20e2b080621e229a2ec5e820892a663
2022-11-28 14:11:48 +00:00
dan
abbfa7aa17 Ensure the RETURNING clause is honoured when a row of a temp table is updated by an ON CONFLICT clause.
FossilOrigin-Name: a2449bcc2c71d0f4c3289621fbf1cb97f0f407c9f7b5bf18245b7854a07c6cfa
2022-11-28 13:47:27 +00:00
larrybr
c1ca183abf Conform CLI .trace arg handling to its help.
FossilOrigin-Name: 31546ea320e8daa020f8a9f491718ffc3dde0e32954018afed88e8494a6aff6c
2022-11-28 02:28:44 +00:00
stephan
ca9309cc56 Document an OPFS API change in Chrome v108 which does not break our code but does change several formerly async methods to synchronous. No code changes.
FossilOrigin-Name: e9dd87e28a96eb6560943b9a2cb3cb0ff14698c96fe63865944dcfed73b67bd3
2022-11-27 00:57:56 +00:00
drh
9d34152bcf Better reporting of when the WHERE clause analysis thinks that an index
is covering.

FossilOrigin-Name: 17ebcf316b91042c823eea7bb6f1309325023cb5c70538cdb2ce932caee2ef05
2022-11-26 20:52:38 +00:00
drh
217e77d240 Show which AggInfo.aCol an Expr node represents in the tree trace debugging
logic.  Does not affect production builds.

FossilOrigin-Name: b8076f4dc55810855f668dfd4221bdb555cc78c61df200cf0cb87eb137e22850
2022-11-26 20:48:56 +00:00
drh
8beb7f56f5 Merge trunk fixes into the covering-indexed-expr branch.
FossilOrigin-Name: 9ac67ff968e874cf955e46e3993e3215c766feec3d5bdd38d77884eedd86b59e
2022-11-26 20:13:54 +00:00
drh
743c9ec4a5 Fix an incorrect assertion-fault in the "TREETRACE" debugging logic on
select.c.  The problem does not affect production builds.

FossilOrigin-Name: f11bb42292d94e7b7687bd2134f72afe1353182238cb4837fc0a6d78a021dd7e
2022-11-26 20:12:02 +00:00
stephan
4245667e35 OPFS VFS: add the opfs-unlock-asap=1 URI flag which tells the VFS to release implicit locks ASAP instead of during VFS idle time. This improves concurrency notably in the test app but brings a significant performance penalty in speedtest1 (roughly 4x slowdown). This is not the final word in OPFS concurrency, but gets us a step further.
FossilOrigin-Name: 9542f9ce9e023b489e2d93661f719fb0751c1e28f72fded9d3c2156d5777e7b1
2022-11-26 15:24:58 +00:00
drh
6e71186904 Experimental changes to help the query planner detect when an expression
index is coverting.  Works somewhat, but there are tests that fail.

FossilOrigin-Name: 968c189bcf29a9b25305251a58d09b7d52ab9dd08f5057dc3ab1f7ad1a5316a0
2022-11-26 14:19:47 +00:00
drh
902ea83925 Relax restriction (8) on the push-down optimization so that it only applies
if one or more columns uses a collating sequence other than BINARY.
See [forum:/forumpost/3824ced748baa808|forum post 3824ced748baa808] and
check-in [346a3b12b861ce7b].

FossilOrigin-Name: adbca3448e2099f0d6149a073978f230ed9a92a2f384779879ef89e672231bcf
2022-11-25 17:05:55 +00:00
drh
49d400b091 Fix #ifdefs so that restrictions (8) and (9) of the push-down optimization
are still enforced even if compiled with SQLITE_OMIT_WINDOWFUNC.  This
fixes a bug introduced by check-in [346a3b12b861ce7b].

FossilOrigin-Name: 09e1e42e0ff26f9a71cbd128169f060a66425828d637bf8f781490ca38d99103
2022-11-25 16:32:59 +00:00
drh
ae5cfda656 Immprove the query planner such that it is able to make use of indexed
expressions within an aggregate query with GROUP BY.  This implements
enhancement request [99378177930f87bd].

FossilOrigin-Name: b9190d3da70c41717eb188474fd225ee43d0b46646e1b03de5967bd332553870
2022-11-25 16:10:48 +00:00
drh
23f61a4ba8 Add restriction (9) to the push-down optimization: If the subquery is
a compound then all arms of the compound must have the same affinity.
dbsqlfuzz 3a548de406a50e896c1bf7142692d35d339d697f.

FossilOrigin-Name: 1ad41840c5e0fa702ba2c0df77a3ea126bd695b910b5d1271fa3129c38c58f5f
2022-11-25 15:52:00 +00:00
drh
bedbb1bfab Remove a redundant assert() statement.
FossilOrigin-Name: e3e1b453dc47884ddc9e51c4302fa2f4d40bca3d69ac7c13d8e2ae1adc81ac56
2022-11-25 13:26:51 +00:00
drh
f5d0656f16 Improve the robustness of the updateAccumulator() routine against OOM.
FossilOrigin-Name: d2844f577b69fdc16a0a2568c0958fc3d8aff33e9a0ef80e0f58e92f01097432
2022-11-25 13:15:48 +00:00
drh
7960da0346 Improved comments. Add assert()s to verify that the AggInfo structure
is unchanged after registers have been assigned.

FossilOrigin-Name: 5200b84195ee1ccaa387f7032eae3d463724c48cb53ba0251bbc79e927dd9752
2022-11-25 13:08:20 +00:00
drh
8683c09281 Correctly deal with IF-NULL-ROW operators when dealing with
indexed expressions in aggregates.

FossilOrigin-Name: 939cb47025354e2df047de7654c0b06f791957cfe4e904abe8892207cea90215
2022-11-24 23:35:27 +00:00
larrybr
472de149ae Speed up base85() conversions and sync w/trunk.
FossilOrigin-Name: 17b823500a2ed135c1f40aa7f4d87ba5b2eab35c0abd9e0856041cf0f510cbee
2022-11-24 20:11:34 +00:00
drh
e644f7c24b Take care not to try to add comments to a TK_AGG_COLUMN opcode that does
not have an associated Table object because it is a reference to an indexed
expression.

FossilOrigin-Name: 5fc23863e4a6388884ce061cd69546757b4c39d731bbb58a8121b92fd5144f7b
2022-11-24 19:02:40 +00:00
drh
594357f2e1 Change a NEVER() into an assert().
FossilOrigin-Name: a0fd44f4e5a0ec83465203a0009f307ca50223833575895a3ebf8a289515714f
2022-11-24 18:45:56 +00:00
dan
eb84c81c53 Fix a test case in fts3expr4.test to account for different locales.
FossilOrigin-Name: a2b6883ac2ef878f525ee847b170beb9f9ab9d1fa67557101be2cdae1e7f7a57
2022-11-24 17:58:55 +00:00
stephan
df5d06d03e More work on the OPFS concurrency testing app.
FossilOrigin-Name: c0458caca3508d5d252f9b5198bda4f51a5c1874540f014b17e409f2daab1706
2022-11-24 17:53:09 +00:00
stephan
6b86b33793 JS documentation cleanups. No code changes.
FossilOrigin-Name: 18e89a436daa18a8c972caf06b298da43c97a6ea3e2e5229dccb6920c27bfdb9
2022-11-24 16:03:49 +00:00
dan
647b0dd12d Update multiplex3.test to account for the fact that the multiplexor xDelete method may return an error even if it manages to delete the first chunk of a file.
FossilOrigin-Name: 1a7f3254735054ed8ca32d5ec7c8cde9195a64702638bdc50392007e396fead2
2022-11-24 15:32:00 +00:00
drh
c25f5ea6e8 Add NEVER() and ALWAYS() macros on branches that are believed to be
unreachable.

FossilOrigin-Name: 3a901e88c87fc76c7fe42e47a976a5706830f0dbd6027605663e4d55f4f33590
2022-11-24 15:04:23 +00:00
drh
b669bb5e2b New test cases. Fix the logic so that it works for GROUP BY aggregates
that do not require sorting.

FossilOrigin-Name: ef6ebe7922f56c1584a005deedc85ca1070b4fe5082ada8bbf8d06df54f1c9ef
2022-11-24 13:19:25 +00:00
larrybr
9b9017def4 Speed up base64 conversions, and add test with more data for the baseNN conversion to grind.
FossilOrigin-Name: 6c84ae4ba83713c751fddff8be41686bbcb525ac8135e1520436c62d0bc23d2c
2022-11-24 02:59:33 +00:00
stephan
f46091d73f Add sqlite3.oo1.DB.prototype.checkRc() and tests for both that method and its class-level counterpart.
FossilOrigin-Name: f7eaa6ba2147bfd6dbdc2444d0f919d846aa7f9b68cccab17ef585ffdacf3d60
2022-11-24 02:35:03 +00:00
drh
4b1555a9fc Merge the latest trunk changes into the agg-with-indexed-expr branch to
simplify diffs.

FossilOrigin-Name: 38c3d3f1ed0fd2bb62aa8a7e5a27f2b247123e094e2fdb0a2475d788c3dfbc04
2022-11-24 01:41:44 +00:00
drh
9b80cb5f39 Add explanatory comment to the new optimization. And add a test case.
FossilOrigin-Name: e6c20f61de7d048eee65c8e74a3eb36760ab9747ebd1ab50e49642b777c10306
2022-11-24 01:40:20 +00:00
stephan
f1ce4f40c7 Minor JS doc updates.
FossilOrigin-Name: 27efd63ad7fb3bf8d0d07f2c9f48652c8cacc4e697c229c8085120a8e6b50a39
2022-11-23 21:09:51 +00:00
stephan
875db41afc Add optional zSchema argument to sqlite3_js_db_export().
FossilOrigin-Name: 9c23644b1e5bf44bfb431a35fd1674c11ccb99e9eb0989f10175b0cb2a858eaa
2022-11-23 21:03:22 +00:00
stephan
056a71562f OPFS concurrency test: add a URL flag to enable/disable unlock-asap mode.
FossilOrigin-Name: 1c1bf22eadae2a5a7d4358e7cdd22641c2efb9296f42e7376749293b3a58b114
2022-11-23 20:49:08 +00:00
stephan
e79cb67c35 Add an experimental OPFS VFS-specific URI flag, opfs-unlock-asap, which tells the VFS to release implicit locks ASAP. This permits higher concurrency but hurts performance considerably. This may or may not be obsoleted by other concurrency-related experimentation.
FossilOrigin-Name: d23c917013485ec2793125221f3936b05c39d6eca941629fb819b6b4aa714520
2022-11-23 19:03:22 +00:00
drh
2e30d95fb6 Aggregates with GROUP BY now make use of expressions on indexes. This code
works and gets the correct answer for the test case in the ticket.  Lots more
testing and documentation is needed, however.

FossilOrigin-Name: 8dcf9f2031c16f296d187fe876d4204c71fc96fec120984ff11b6d8b03d58a5f
2022-11-23 18:51:04 +00:00
drh
590f013a87 This attempt at modifying AggInfo to make use of indexed expressions does not
work.  It gets an incorrect answer for the test case shown in the ticket.

FossilOrigin-Name: 84c06023f4a1606664fdb9811312603b31f7c94a43d0e443ba7dde7fdba029e3
2022-11-23 17:56:00 +00:00
stephan
ad1285c5c0 Initial infrastructure for adding a mode to the OPFS VFS which causes implicit locks to be released ASAP, which increases concurrency at the cost of performance.
FossilOrigin-Name: c5b7a9715a13b696ab3ee965aa0a310f59b65f07cecd72faa2e3504bfd8eb632
2022-11-23 16:39:07 +00:00
dan
c32e16643d Update Makefile.in to include new target "sqlite3r.c". For generating "sqlite3r.c" and "sqlite3r.h", versions of the amalgamation that include the recover extension. To build the shell tool against these files, add -DSQLITE_HAVE_SQLITE3R.
FossilOrigin-Name: 5f135575b923cb59947667071c6af9ff14063c933cedf37d6c2a0a1b86c85032
2022-11-23 16:08:49 +00:00
stephan
91a81316b9 Remove a bit of over-cleverness which breaks loading of sqlite3.js in some main-thread cases.
FossilOrigin-Name: 220cc4c6399b772b4ece03305a41b437ef0654d586a8a1c3dc5e7606fd36d655
2022-11-23 15:52:52 +00:00
stephan
3eaaec945c OPFS concurrency tester: ensure that the work interval timer does not overlap with the work time.
FossilOrigin-Name: 8f2076553bc486ea6a17934695ecc02217461af2082d891697b62aab89bd1b43
2022-11-23 15:33:49 +00:00
drh
c6138e970e Further foundation prep work prior to starting to flesh-out the
optimizeAggregateUseOfIndexedExpr() routine.

FossilOrigin-Name: 23145fe999ff74d787a3999baedd4ffe755c5f1f1275082ed0338ba637ecc56e
2022-11-23 14:13:39 +00:00
larrybr
809be56218 Add more baseNN tests, get oversize error trapping working, and sync w/trunk
FossilOrigin-Name: 03819e9368fd9f78f351147a1dc865743f9634893e43a9d1e3d7cbaf4c966069
2022-11-22 22:46:41 +00:00
drh
58c0652923 Merge enhancements and fixes from trunk.
FossilOrigin-Name: f8932e04d4d18eb9d71edda15aa08af2eb139ff14d77ca147ea6e9b173e0f5e0
2022-11-22 20:58:18 +00:00
drh
b23f1572ab Add the stub function: optimizeAggregateUsingIndexedExpr(). The hope is that
we can fill this in with a routine that does useful optimizations.

FossilOrigin-Name: d85bb724fdd6fbad2b88ed7f60e4174e3f65182356f404d04620c5cf6b17f77e
2022-11-22 20:37:41 +00:00
mistachkin
c620522175 Avoid naming collision between the sha1 and shathree extensions.
FossilOrigin-Name: 9ec923b5dc24d6082da8d42bc0ee8ab1c418912625c0c56de9627be2c818ef98
2022-11-22 20:04:00 +00:00
drh
c7c5b8a508 Include the treetrace bitmap comment accidentally omitted from the previous
check-in.

FossilOrigin-Name: db07471c531766a8eec1d5b41c9fd0283b5e64ee13166dc3391f70a1e1946121
2022-11-22 19:56:54 +00:00
drh
cbef156d93 Merge trunk fixes and enhancements into the agg-with-indexed-expr branch.
FossilOrigin-Name: 070634781a5eb41f96b001e48b064e3cd8c82314f576335eb1fcd43792179291
2022-11-22 19:51:16 +00:00
drh
5d7aef16bf Rename the SELECTTRACE macro to TREETRACE, so that is corresponds to the new
CLI command.  Renumber all of the bits in the bitmask used to enable
various kinds of tracing, and add a trace bitmap decoder in sqliteInt.h.
Changes to debugging logic only.  No (intentional) changes to production code.

FossilOrigin-Name: 8036445a36d9d982c1305935e7e37367bdf9e466b923eb6286b52524802e3ccd
2022-11-22 19:49:16 +00:00
larrybr
411929025b Sync w/trunk. Ready for merge to trunk.
FossilOrigin-Name: ff67460e1a3d21c9ca7cbd171fbc5e6cbdb3797de359887f851776b73b732fdf
2022-11-22 19:12:24 +00:00
larrybr
bf82c95e08 Add test/basexx1.test to test is_base85(t), base85(x) and base64(x). Sync w/trunk.
FossilOrigin-Name: 4e4334547795f659b4a5dc5fdaf842535643750a5f1ce1af799c526931a473e4
2022-11-22 19:04:09 +00:00
drh
c9b7d943ad Fix the error message in the CLI for "no such VFS".
[forum:/info/1217fdd6b3|Forum post 1217fdd6b3].

FossilOrigin-Name: 861af465fda8485dfff143dc45c659b884d826aaec2ebaa941566404d1fe427b
2022-11-22 18:24:07 +00:00
dan
63b74e02a7 Add Makefile.in targets for sqlite3r.c and sqlite3r.h, versions of the amalgamation that include the recover extension.
FossilOrigin-Name: 59a837cfc7f9f96509491c8fc45355d2e8892af25246955e22adec1cbf37327b
2022-11-22 16:12:53 +00:00
drh
3c8e438583 Since the memory registers used by the columns and functions of an
AggInfo object are sequential, it is not neecessary to remember each register
separately.  We can simply remember the first one and do the math when
others are needed.

FossilOrigin-Name: dc5bd34963b761c819c565653156d0befbf65cc2cc5dc4113b0ce952450f0352
2022-11-22 15:43:16 +00:00
larrybr
2a072506ca Fix last function pointer in sqlite3Apis init. Reported at https://sqlite.org/forum/info/eba0faa96d
FossilOrigin-Name: 6d5dc9eed54b7d883aa7dbe2eb5ff17d2a703eabdb7d548a27cccc1fe5addb4a
2022-11-22 15:41:32 +00:00
drh
89e5dfac01 Omit the unnecessary AggInfo.mnReg field.
FossilOrigin-Name: d79c58ef08b917bacc0f24d210d8eb23f659f955c219b4757af42eee8f17099b
2022-11-22 14:31:13 +00:00
drh
42b78237cd Factor out the allocation of registers for aggregates into a separate
subroutine.

FossilOrigin-Name: 4475799d5b41e93eabc32fac502ac2de240642b3b64739216e32e9af92ee191d
2022-11-22 14:10:22 +00:00
drh
ff5e4ecced This is the first in what is anticipated to be a long sequence of incremental
changes aimed at improving aggregate query processing, and in particular
helping aggregate queries take better advantage of indexes on expression.
The end goal is to resolve ticket [99378177930f87bd], though it remains to
be seen whether or not I can get there with this approach.

FossilOrigin-Name: cba837eae93f6b842d4e78ef00661a4f09deb99c53f12b3e8f46763749602597
2022-11-22 13:33:58 +00:00
drh
c59b7a8053 Convert an ALWAYS() in sqlite3DbSpanDup() into an assert(), for a performance
increase and size reduction.

FossilOrigin-Name: 21e80a29737c367babcc0cf2533eed61b5d0fcf3cc3c33ab88761899e394eaf3
2022-11-22 12:47:32 +00:00
drh
da217c958e Split out the debugging code that dumps an AggInfo object into a separate
subroutine called printAggInfo() so that it can be invoked interactively
during debugging.  No changes to production code.

FossilOrigin-Name: dc33cfbedef4b444adeadea17f8183b7c4ce5b87432d0c712f986b34c7374ff1
2022-11-21 17:40:23 +00:00
drh
03af6d7157 Change the name of the Parse.pIdxExpr field to pIdxEpr so that the name is
distinct from all other identifiers in the code and thus less confusing.

FossilOrigin-Name: a2962d0187534f3496282b48efbf38dabcd226bf8972be925c8433c55a8853fe
2022-11-21 16:40:12 +00:00
stephan
9f2be5db04 OPFS contention test: give each worker a distinct recognizable name instead of a random one.
FossilOrigin-Name: 5f564bf7de7ce3ad7bedb5f06b3086ceaec55da768a60d74059fa4fba4328567
2022-11-21 16:00:26 +00:00
drh
b53d8fa9f2 Performance optimization and size reduction in insertCell() by omitting
the "pRC" argument and instead returning the result code as an integer.

FossilOrigin-Name: bee94d1bb0daade023cc1e274339daafc249e1978c0765fc45042b5f9060e478
2022-11-21 15:55:57 +00:00
drh
e7d5384418 Performance optimization to sqlite3BtreeInsert().
FossilOrigin-Name: b8976ebfe03fbc1e09a38d598a62493a7f19ff7a2a3acd1ec54d0dee190471e9
2022-11-21 14:13:10 +00:00
drh
d01dee5e6a Small performance improvement in sqlite3BtreeTransferRow().
FossilOrigin-Name: dab959ea3edf99788bfd76352cd46a3e56876b0e7d7008c6927aa14534853c50
2022-11-21 13:35:00 +00:00
stephan
a303392a2c Add new JS tests dir to those pushed to the test server.
FossilOrigin-Name: 07182dca9f2a4ffea1af0684c93e55e105465b2ee9820c70764e3e7bc1c28efc
2022-11-21 06:07:22 +00:00
stephan
b38ac0986e More tweaking of OPFS concurrency measures and the related test app.
FossilOrigin-Name: a8d4da1501d411085ec2fd48c4a056c8b1d97ef3c3203c5b403a854ac2864870
2022-11-21 05:18:24 +00:00
stephan
36d5554c9a Resolve missing SQLITE_LOCKED result code which triggered a new (since last checkin) exception in the OPFS VFS. Improve output of the OPFS contention tester app.
FossilOrigin-Name: 2debbbca33bd4170a1dc4dbb5eb3e68523e51d289b06c551e5560ac4e32e433b
2022-11-21 04:12:38 +00:00
stephan
27c4cd183d Add test app for experimenting with multi-worker OPFS concurrency. Tweak OPFS VFS to significantly improve the otherwise "unfortunate" concurrency situation.
FossilOrigin-Name: 96f76e7616f8157a342b9e1c42f7b1feab200d182268871a2b25f67d4ee2564c
2022-11-21 03:50:52 +00:00
larrybr
b5aaf0f285 Get clean builds for MS tools. Add build examples for extension glommer (basexx.c)
Make sure extensions build for dynamic load and built into shell.

FossilOrigin-Name: da940d507e9e31a84daedede44a56f743198d7258a9e83892511fe8dd4c78d2b
2022-11-21 02:18:12 +00:00
larrybr
423003dca9 Fix a base64 decode bug. Provide for convenient inclusion of extension(s) built into the CLI, to simplify testing and for its own sake. Improve comments. Cure collision between base64.c and base85.c when both are in the same translation unit.
FossilOrigin-Name: 07543d23a98c2a851393a2674e59d3cf1df37c244fb451cb7436f49c95c1423f
2022-11-21 00:11:09 +00:00
stephan
ae276719f0 js dist: account for a file rename in the previous checkin.
FossilOrigin-Name: 469f9011a885e19b99210c5e3e582afa140b8b5f0aa7a720334848df5ab6ae98
2022-11-20 05:47:17 +00:00