]> git.ipfire.org Git - thirdparty/sqlite.git/log
thirdparty/sqlite.git
2 years agoRefactor the internal JS routines for converting UDF results and errors to JS into...
stephan [Sat, 10 Dec 2022 10:24:46 +0000 (10:24 +0000)] 
Refactor the internal JS routines for converting UDF results and errors to JS into public APIs.

FossilOrigin-Name: 35d1d63c7d60119b64341c561294890812837d5432d1d7bed3ed88d6212fbfa0

2 years agoExport sqlite3_result_subtype() and sqlite3_value_dup/free/subtype() to WASM.
stephan [Fri, 9 Dec 2022 15:26:58 +0000 (15:26 +0000)] 
Export sqlite3_result_subtype() and sqlite3_value_dup/free/subtype() to WASM.

FossilOrigin-Name: 4600a7bbdc4cbe14591d48ea19fe5f7de3a0c10a14cdd97fd51e263a13163d10

2 years agoExpose sqlite3_value_frombind/nochange/numeric_type() to WASM. Add a flag to sqlite3_...
stephan [Fri, 9 Dec 2022 15:12:07 +0000 (15:12 +0000)] 
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

2 years agoRefactor the sqlite3_value-to-JS conversion from an internal detail to sqlite3.capi...
stephan [Fri, 9 Dec 2022 14:46:24 +0000 (14:46 +0000)] 
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

2 years agoFix typo in the SQLITE_DBCONFIG_LOOKASIDE documentation.
drh [Fri, 9 Dec 2022 13:49:44 +0000 (13:49 +0000)] 
Fix typo in the SQLITE_DBCONFIG_LOOKASIDE documentation.

FossilOrigin-Name: c6e7582aea4ebcc4563afb4367fded1e8a74f6ef522a569460023c340ca24b30

2 years agoRemove some unused sqlite3_status() codes from the JS API. Add custom JS wrappers...
stephan [Fri, 9 Dec 2022 12:12:49 +0000 (12:12 +0000)] 
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

2 years agoRename the oft-used, verbose sqlite3.wasm.get/setMemValue() and get/setPtrValue(...
stephan [Fri, 9 Dec 2022 09:23:27 +0000 (09:23 +0000)] 
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

2 years agoMicro-optimization in the oft-activated JS-to-WASM arguments conversion step.
stephan [Fri, 9 Dec 2022 08:44:22 +0000 (08:44 +0000)] 
Micro-optimization in the oft-activated JS-to-WASM arguments conversion step.

FossilOrigin-Name: ee47e9b83ca668b37dc1d8e519048a635693cf33d9967a2d81ff0824b7eea4ba

2 years agoCorrect a test bug which broke the previous checkin's wasm tests in higher optimizati...
stephan [Fri, 9 Dec 2022 07:17:54 +0000 (07:17 +0000)] 
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

2 years agoExport sqlite3_status() and sqlite3_stmt_status() to wasm. Expand the arg/return...
stephan [Fri, 9 Dec 2022 05:47:42 +0000 (05:47 +0000)] 
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

2 years agoJS API doc updates.
stephan [Fri, 9 Dec 2022 02:23:15 +0000 (02:23 +0000)] 
JS API doc updates.

FossilOrigin-Name: 4f80fd3b8d4c85894664093d8310d6f5299faac4eb879edc608b3ffcd8558e9a

2 years agoExpose sqlite3_table_column_metadata() to wasm.
stephan [Fri, 9 Dec 2022 02:12:43 +0000 (02:12 +0000)] 
Expose sqlite3_table_column_metadata() to wasm.

FossilOrigin-Name: c31eb509e5cb1025de058132ee9a45d70c84ee47a6abe18811a65ce339f062a0

2 years agoExpose sqlite3_db_status() and sqlite3_db_config() to wasm, noting that the latter...
stephan [Fri, 9 Dec 2022 01:49:17 +0000 (01:49 +0000)] 
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

2 years agoReorganization and renaming in the new VFS/vtab JS pieces.
stephan [Fri, 9 Dec 2022 00:50:39 +0000 (00:50 +0000)] 
Reorganization and renaming in the new VFS/vtab JS pieces.

FossilOrigin-Name: 1c2dda177a11fcc5b66e5554507c23ba4b9948a710b3bccfb26963b9851d40a4

2 years agoSupport ".scanstats est" to enable including planner estimates in query profiles.
dan [Thu, 8 Dec 2022 21:05:33 +0000 (21:05 +0000)] 
Support ".scanstats est" to enable including planner estimates in query profiles.

FossilOrigin-Name: 0fe71287c953bd813a34ba383f5debd4d1fc8bf3c74e1e27adacec0d6e207ded

2 years agoFurther docs and minor cleanups in the JS virtual table helper.
stephan [Thu, 8 Dec 2022 18:18:37 +0000 (18:18 +0000)] 
Further docs and minor cleanups in the JS virtual table helper.

FossilOrigin-Name: c31e7488ac1a6b957782b72bd026b1f0590637b631e44a1fdf1dedeb5c587819

2 years agoEase-of-use/legibility improvements in the virtual table JS helpers.
stephan [Thu, 8 Dec 2022 17:07:27 +0000 (17:07 +0000)] 
Ease-of-use/legibility improvements in the virtual table JS helpers.

FossilOrigin-Name: 54c7ad7e08bdb87579398ade366605bfa2e2538a94aabcc6e4cda8e173649760

2 years agoInitial support for virtual tables implemented in JavaScript.
stephan [Thu, 8 Dec 2022 15:00:53 +0000 (15:00 +0000)] 
Initial support for virtual tables implemented in JavaScript.

FossilOrigin-Name: a1454744c770a30a32a6d7b7fc59ef7be48cf67348b238540592850d7c2c7757

2 years agoDescribe the SQLITE_DBCONFIG_RESET_DATABASE flag's policy regarding virtual tables...
stephan [Thu, 8 Dec 2022 12:51:11 +0000 (12:51 +0000)] 
Describe the SQLITE_DBCONFIG_RESET_DATABASE flag's policy regarding virtual tables, per /chat discussion.

FossilOrigin-Name: 53dcb81b029e4422bdc0b5cf694183854b997195427d437b6154ed4dad7ad0ba

2 years agoMore work on the JS vtable tests. wasm-vtab
stephan [Thu, 8 Dec 2022 10:06:07 +0000 (10:06 +0000)] 
More work on the JS vtable tests.

FossilOrigin-Name: 51e3c3b569dce2097063d39dc484f44b2f98cad0a902ef66765ca4cdc3e06f47

2 years agoGot JS non-eponymous vtable working thanks to a hint from Dan.
stephan [Thu, 8 Dec 2022 09:06:20 +0000 (09:06 +0000)] 
Got JS non-eponymous vtable working thanks to a hint from Dan.

FossilOrigin-Name: 750719b4981df62fa2ff3665e6f559ec760609ad2493495628295ad9ae6024fc

2 years agoRemove some dead JS code and tweak some docs.
stephan [Thu, 8 Dec 2022 04:19:38 +0000 (04:19 +0000)] 
Remove some dead JS code and tweak some docs.

FossilOrigin-Name: 0ee495452c014680697aa9035c245024df127a52d1820ab0e02580a015d96ecb

2 years agoReduce the overhead of SQLITE_ENABLE_STMT_SCANSTATUS some.
dan [Wed, 7 Dec 2022 20:09:54 +0000 (20:09 +0000)] 
Reduce the overhead of SQLITE_ENABLE_STMT_SCANSTATUS some.

FossilOrigin-Name: 212927e97e7be7d237de08359dce0dfb9211ac406b32009a6e15afd79c006475

2 years agoFix harmless compiler warning in the dynamic continuation prompt of the CLI.
drh [Wed, 7 Dec 2022 19:51:48 +0000 (19:51 +0000)] 
Fix harmless compiler warning in the dynamic continuation prompt of the CLI.

FossilOrigin-Name: 68947b0a1147365a29e335d5e4dc55fe5d9afe3562a0709b111067d6017c5a42

2 years agoOmit CLI use of pragma_table_xinfo when it is not defined in the build.
larrybr [Wed, 7 Dec 2022 19:29:13 +0000 (19:29 +0000)] 
Omit CLI use of pragma_table_xinfo when it is not defined in the build.

FossilOrigin-Name: 976c23520fa64b39aa54047f2fd12445e65940206768ce51c0d690d0d0d570ab

2 years agoHave sqlite3_stmt_scanstatus() report cycle, loop and row counts separately for creat...
dan [Wed, 7 Dec 2022 17:29:17 +0000 (17:29 +0000)] 
Have sqlite3_stmt_scanstatus() report cycle, loop and row counts separately for creating an automatic index and using that automatic index.

FossilOrigin-Name: 3bc9df82ea5b0fb085c56a326a65e19c9baf98d48d8fa6344c0d7004747594ba

2 years agoStreamline and improve testing of the locking in the memdb VFS.
drh [Wed, 7 Dec 2022 16:58:04 +0000 (16:58 +0000)] 
Streamline and improve testing of the locking in the memdb VFS.
Follow-on to [15f0be8a640e7bfa].

FossilOrigin-Name: d71a08375aeb525c10037c373b8eeb7e29f7dfaf7c4bfc02f4d99616c5940405

2 years agoWork on an alternate (slightly simpler) approach to binding JS vtabs. Non-eponymous...
stephan [Wed, 7 Dec 2022 07:22:34 +0000 (07:22 +0000)] 
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

2 years agoAdd addOnDispose() method to Jaccwabyt and code-adjacent minor internal cleanups.
stephan [Wed, 7 Dec 2022 03:42:39 +0000 (03:42 +0000)] 
Add addOnDispose() method to Jaccwabyt and code-adjacent minor internal cleanups.

FossilOrigin-Name: 6a2723fe3f28dd94328d901e64e1e9ee9a1b2e9eeaed6c54038a5b83c914db78

2 years agoFix a (harmless) off-by-one error in code generation that comes up when
drh [Wed, 7 Dec 2022 00:14:25 +0000 (00:14 +0000)] 
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

2 years agoEnhance CLI .sha3sum to warn of text fields that are not to-blob-to-text reversible.
larrybr [Tue, 6 Dec 2022 19:32:07 +0000 (19:32 +0000)] 
Enhance CLI .sha3sum to warn of text fields that are not to-blob-to-text reversible.

FossilOrigin-Name: bbde0f36d03cdbbc749427fe7d2dafd5c5031c9e655ebd772857b521f53eb18f

2 years agoMerge from trunk prepratory to branch end. sha3sum_text_validation
larrybr [Tue, 6 Dec 2022 19:25:07 +0000 (19:25 +0000)] 
Merge from trunk prepratory to branch end.

FossilOrigin-Name: 1d01f8483af7b6a4e93a49fd8bbb6a2b9300e969b574efeb96d56081a33055c4

2 years agoAvoid several -Wall warnings in textfixture build.
larrybr [Tue, 6 Dec 2022 19:20:49 +0000 (19:20 +0000)] 
Avoid several -Wall warnings in textfixture build.

FossilOrigin-Name: 03ae8680e430c6d2c39ca26fa2cb6eed46e3c3e52b53f7a8bf548560446c6d3d

2 years agoFor CLI .sha3sum, emit warning to stderr for any invalidly encoded text fields.
larrybr [Tue, 6 Dec 2022 18:48:37 +0000 (18:48 +0000)] 
For CLI .sha3sum, emit warning to stderr for any invalidly encoded text fields.

FossilOrigin-Name: 8e833ecc81367658e81acd1d3a0242ab954a62d6f719af56f1d185656d0b73e6

2 years agoHave sqlite3_stmt_scanstatus_v2() return an NCYCLE value for all loops, not just...
dan [Tue, 6 Dec 2022 18:48:06 +0000 (18:48 +0000)] 
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

2 years agoClear a few more -Wall warnings and simplify dynaprompt feature keep/omit macros.
larrybr [Tue, 6 Dec 2022 17:59:05 +0000 (17:59 +0000)] 
Clear a few more -Wall warnings and simplify dynaprompt feature keep/omit macros.

FossilOrigin-Name: 540e895d877fab1ea138786e56923a202018f68c78199a89adfc296c75735b30

2 years agoFix compiler warnings in the new dynamic continuation prompt logic of
drh [Tue, 6 Dec 2022 15:11:13 +0000 (15:11 +0000)] 
Fix compiler warnings in the new dynamic continuation prompt logic of
the CLI.

FossilOrigin-Name: 0d80500d358fa1c9b5867c2c8250d278ba813bf2ad81bb0bc3f820a71489b374

2 years agoIn the unix backend, when implementing the defenses against small file
drh [Tue, 6 Dec 2022 13:12:33 +0000 (13:12 +0000)] 
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

2 years agoSupport an SQLITE_SCANSTAT_NCYCLE statistic for "CO-ROUTINE" elements.
dan [Tue, 6 Dec 2022 11:41:05 +0000 (11:41 +0000)] 
Support an SQLITE_SCANSTAT_NCYCLE statistic for "CO-ROUTINE" elements.

FossilOrigin-Name: d3f6a207fd1b3f53688fa1ff35eb71e1c5bcc4115c0c35bb187d22ccf7100b71

2 years agoJS vtables: add infrastructure related to accessing and modifying sqlite3_index_info.
stephan [Tue, 6 Dec 2022 11:21:46 +0000 (11:21 +0000)] 
JS vtables: add infrastructure related to accessing and modifying sqlite3_index_info.

FossilOrigin-Name: 0d77c348039926c24e0fb50a7dc7e4b62895cd201c021f8e29832917e4b8b09f

2 years agoRemove deprecated symbol sqlite3.opfs.OpfsDb, which was renamed to sqlite3.oo1.OpfsDb...
stephan [Tue, 6 Dec 2022 09:49:04 +0000 (09:49 +0000)] 
Remove deprecated symbol sqlite3.opfs.OpfsDb, which was renamed to sqlite3.oo1.OpfsDb on 2022-11-29.

FossilOrigin-Name: 0ce51bed65d5e430364f74bf959fb76c42ac5eec0769490231d8c8110a1f388c

2 years agoRename wasm.cstringToJs() to wasm.cstrToJs() for consistency with other wasm.cstr...
stephan [Tue, 6 Dec 2022 08:46:39 +0000 (08:46 +0000)] 
Rename wasm.cstringToJs() to wasm.cstrToJs() for consistency with other wasm.cstr... APIs.

FossilOrigin-Name: cbf483ea0ba3e6dc08ad7ed654380f818544b4c3cedfdb8aa848a83298268ceb

2 years agoAdd wasm.cArgvToJs() to support sqlite3_module::xConnect().
stephan [Tue, 6 Dec 2022 08:39:17 +0000 (08:39 +0000)] 
Add wasm.cArgvToJs() to support sqlite3_module::xConnect().

FossilOrigin-Name: c3ebdccf94d5e63c229bf91056c08052d78732e663334070ef3b0ef6fb4bfb8f

2 years agoMinor internal JS code/docs cleanups.
stephan [Tue, 6 Dec 2022 08:21:23 +0000 (08:21 +0000)] 
Minor internal JS code/docs cleanups.

FossilOrigin-Name: 21331bdd36a91b07a687ffadce392dcf2ccd0fd824b35d9dd027d4289a40fc96

2 years agoMerge trunk into wasm-vtab branch.
stephan [Tue, 6 Dec 2022 06:21:02 +0000 (06:21 +0000)] 
Merge trunk into wasm-vtab branch.

FossilOrigin-Name: d106edb956bbe22bddc2c6e5bcdf4fb8f797794c725c2e359e3fa4b31d881843

2 years agoMinor test tweaks.
stephan [Tue, 6 Dec 2022 06:16:11 +0000 (06:16 +0000)] 
Minor test tweaks.

FossilOrigin-Name: f902f3b2c79d6c699ead1efeb1426e1e0f4ac709afdff88be1de62f34f3d5ccc

2 years agoAdd a demonstration sqlite3_vtab/module implemented in JS, based on ext/misc/template...
stephan [Tue, 6 Dec 2022 06:09:03 +0000 (06:09 +0000)] 
Add a demonstration sqlite3_vtab/module implemented in JS, based on ext/misc/templatevtab.c. Add oo1.selectArrays() and selectObjects().

FossilOrigin-Name: 60482c97e02bc4cafefef281be0cf0bc8c5c53232162829c137f3f7a80cdc534

2 years agoAdd optional feature: A CLI continuation prompt which reflects open lexemes and paren...
larrybr [Tue, 6 Dec 2022 05:31:20 +0000 (05:31 +0000)] 
Add optional feature: A CLI continuation prompt which reflects open lexemes and parens, similarly to PG shell.

FossilOrigin-Name: f41f18b1c3c950565ee3c237aebb51cfc3241813c6425813a8217e07aa0153a6

2 years agoAdd optional feature: A CLI continuation prompt which reflects open lexemes and paren... dynamic_prompt
larrybr [Tue, 6 Dec 2022 05:09:51 +0000 (05:09 +0000)] 
Add optional feature: A CLI continuation prompt which reflects open lexemes and parens, similarly to PG shell.

FossilOrigin-Name: dac2ddc287db7a68d0cd49b785060f62290868fbb1aa2ee09e54d3b1acfbf55f

2 years agoEnhance the sqlite3_stmt_scanstatus() API and add sqlite3_stmt_scanstatus_v2(). For...
dan [Mon, 5 Dec 2022 19:16:23 +0000 (19:16 +0000)] 
Enhance the sqlite3_stmt_scanstatus() API and add sqlite3_stmt_scanstatus_v2(). For creation of enhanced query performance reports.

FossilOrigin-Name: 4893b4e3eafc7c9c22b24717f90a585862203f987cf108b079ce6e946093e675

2 years agoUpdate comments in sqlite.h.in to account for sqlite3_stmt_scanstatus_v2(). scanstatus_v2
dan [Mon, 5 Dec 2022 18:52:12 +0000 (18:52 +0000)] 
Update comments in sqlite.h.in to account for sqlite3_stmt_scanstatus_v2().

FossilOrigin-Name: 009462f2344b1f468cf9440343a47fec68d783a2bfb4fa6168bb227ec910b918

2 years agoMerge latest trunk changes.
dan [Mon, 5 Dec 2022 18:26:37 +0000 (18:26 +0000)] 
Merge latest trunk changes.

FossilOrigin-Name: 1a72777b1279f74f212fb2f675a4594a238e5d28f048879d7f5ad5287673c3c4

2 years agoAdd loops and rows counters to "USE TEMP B-TREE FOR ORDER BY" records. Also fix the...
dan [Mon, 5 Dec 2022 18:19:56 +0000 (18:19 +0000)] 
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

2 years agoRemove two features of jaccwabyt which were fundamentally flawed, along with approx...
stephan [Mon, 5 Dec 2022 15:05:46 +0000 (15:05 +0000)] 
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

2 years agoJaccwabyt (JS) doc updates.
stephan [Mon, 5 Dec 2022 14:32:35 +0000 (14:32 +0000)] 
Jaccwabyt (JS) doc updates.

FossilOrigin-Name: a329a809b5da135a9c251e4d5f637d45d01d0248110ac05f2ad8f01d9df38c64

2 years agoAdd test case that should have been part of previous commit.
dan [Mon, 5 Dec 2022 14:20:54 +0000 (14:20 +0000)] 
Add test case that should have been part of previous commit.

FossilOrigin-Name: dc7dd2d3e50e7cc474b22f1b5b219da32bcd7aa1ba56864d1dbcf0d3a6fa06f2

2 years agoExpose sqlite3_get/set_auxdata() to wasm. Minor test app CSS tweaks.
stephan [Mon, 5 Dec 2022 14:13:55 +0000 (14:13 +0000)] 
Expose sqlite3_get/set_auxdata() to wasm. Minor test app CSS tweaks.

FossilOrigin-Name: 44659ad32a9fe6363badfc5dbb0bd51d6fb2ee1c8aa47b71e9cf3dbd631fde9e

2 years agoFix a problem in the memdb vfs xLock() function allowing clients to upgrade to EXCLUS...
dan [Mon, 5 Dec 2022 14:12:14 +0000 (14:12 +0000)] 
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

2 years agoExport collation-related APIs and strncmp()/strnicmp() to wasm.
stephan [Mon, 5 Dec 2022 13:33:42 +0000 (13:33 +0000)] 
Export collation-related APIs and strncmp()/strnicmp() to wasm.

FossilOrigin-Name: c3c56d9b944fd0d806d8dad9f0c7be3d7a5441765310908872cc525d82ab6a33

2 years agoExport sqlite3_vtab_collation() to wasm. Rename 'flexible-string' JS argument adapter...
stephan [Mon, 5 Dec 2022 13:12:48 +0000 (13:12 +0000)] 
Export sqlite3_vtab_collation() to wasm. Rename 'flexible-string' JS argument adapter to 'string:flexible' for consistency.

FossilOrigin-Name: 15f8042fddaeabab43dd187c463d3ccc56758cbf19bf2ca4837d9087a4850c1a

2 years agoRemove SQLITE_EXPERIMENTAL tag from sqlite3_vtab_collation() and fix a related doc...
stephan [Mon, 5 Dec 2022 13:07:06 +0000 (13:07 +0000)] 
Remove SQLITE_EXPERIMENTAL tag from sqlite3_vtab_collation() and fix a related doc typo.

FossilOrigin-Name: 35d670b3593a46e13ded541ef477fa35dac6bcb9c31e6cf4b90bd7fa550a8ee2

2 years agoRename 'static-string' argument adapter to 'string:static'. Replace JS unit tests...
stephan [Mon, 5 Dec 2022 11:54:13 +0000 (11:54 +0000)] 
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

2 years agoExport sqlite3_bind/value/result_pointer() to wasm. Add 'static-string' argument...
stephan [Mon, 5 Dec 2022 11:30:39 +0000 (11:30 +0000)] 
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

2 years agoRemove obsolete "experimental" comments on the virtual-table interface
drh [Mon, 5 Dec 2022 10:50:06 +0000 (10:50 +0000)] 
Remove obsolete "experimental" comments on the virtual-table interface
documentation in sqlite.h.in.

FossilOrigin-Name: 28fc32abdcb1c6af19f0926a3a7317e15930a0ba89645d5ffbf6ce99d8463273

2 years agoMore work on the JS side of the virtual table APIs.
stephan [Mon, 5 Dec 2022 07:51:25 +0000 (07:51 +0000)] 
More work on the JS side of the virtual table APIs.

FossilOrigin-Name: cb9881ec001b0e2faf047e57acfd1722d2b546255a54e0f850f568edfe2df1cd

2 years agoRemove some dead code. Improve some error checks and comments.
stephan [Mon, 5 Dec 2022 05:45:00 +0000 (05:45 +0000)] 
Remove some dead code. Improve some error checks and comments.

FossilOrigin-Name: 6712fbe46a97867cea309f78a274edbb6bd166a505b41e18a580306da0e063db

2 years agoInitial infrastructure for adding virtual table/table-valued function support to...
stephan [Mon, 5 Dec 2022 05:30:03 +0000 (05:30 +0000)] 
Initial infrastructure for adding virtual table/table-valued function support to WASM.

FossilOrigin-Name: c202d7a0398b9aabc2babba5c4c91a313f32bbf37549d419775642bb4aa3936a

2 years agoImproved query planner cost estimates. Fix for ticket [e8b674241947eb3b].
drh [Mon, 5 Dec 2022 02:52:37 +0000 (02:52 +0000)] 
Improved query planner cost estimates.  Fix for ticket [e8b674241947eb3b].

FossilOrigin-Name: 1b779afa3ed2f35a110e460fc6ed13cba744db85b9924149ab028b100d1e1e12

2 years agoUse the smaller estimated row size for searching IPK tables, but use the qp-tuning
drh [Mon, 5 Dec 2022 02:42:30 +0000 (02:42 +0000)] 
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

2 years agoFix safe mode authorizer callback to reject disallowed UDFs. Reported at [forum:...
larrybr [Sun, 4 Dec 2022 23:20:38 +0000 (23:20 +0000)] 
Fix safe mode authorizer callback to reject disallowed UDFs. Reported at [forum:/forumpost/07beac8056151b2f|Forum post 07beac8056151b2f].

FossilOrigin-Name: cefc032473ac5ad244c0b6402c541b2f76c0c65a041bda03bfbe7c0e2c11fac2

2 years agoExport sqlite3_result_zeroblob/zeroblob64() to wasm.
stephan [Sun, 4 Dec 2022 08:16:33 +0000 (08:16 +0000)] 
Export sqlite3_result_zeroblob/zeroblob64() to wasm.

FossilOrigin-Name: a60e56627fc0ef8831429941d429ee02c6ee51ce5a2c1af581dc5bc5a00d911e

2 years agoEnhance SQLITE_SCANSTAT_NCYCLE so that it reports on virtual tables.
dan [Sat, 3 Dec 2022 21:24:26 +0000 (21:24 +0000)] 
Enhance SQLITE_SCANSTAT_NCYCLE so that it reports on virtual tables.

FossilOrigin-Name: 622d8eb3724bee617b55d6fb71f1a2d683db6858065adced6bf3ce9525bcd6b5

2 years agoIncrease the nominal row size for IPK index lookups slightly, for better
drh [Sat, 3 Dec 2022 19:04:09 +0000 (19:04 +0000)] 
Increase the nominal row size for IPK index lookups slightly, for better
balance.

FossilOrigin-Name: 1a61c500add4a2bfe80c0c691d559cfca166dc5f8262651a58da7ec16a51d430

2 years agoAdd TOTAL rows to the output generated by tool/vdbe_profile.tcl.
drh [Sat, 3 Dec 2022 18:21:30 +0000 (18:21 +0000)] 
Add TOTAL rows to the output generated by tool/vdbe_profile.tcl.

FossilOrigin-Name: 9800586393c9d3b82459ef657620d245a7985ef5fa389b8a9ea633d6a29c7299

2 years agoAdd CYCLES scanstat measurement to "USE TEMP B-TREE FOR ORDER BY" lines.
dan [Sat, 3 Dec 2022 18:16:25 +0000 (18:16 +0000)] 
Add CYCLES scanstat measurement to "USE TEMP B-TREE FOR ORDER BY" lines.

FossilOrigin-Name: 365011ae8b7e3fcaa2c4ea9601231a3ef2223e60d7a53ec33013109dca22ad58

2 years agoAdd a test case to show that ticket [e8b674241947eb3b] has been fixed.
drh [Sat, 3 Dec 2022 17:23:29 +0000 (17:23 +0000)] 
Add a test case to show that ticket [e8b674241947eb3b] has been fixed.

FossilOrigin-Name: e20de6d450c2b4d5bde737f625de16ff53262c22ce7aa6917b64f1665170d33f

2 years agoFurther improvements to the estimated cost of sorting. Take into account
drh [Sat, 3 Dec 2022 17:09:15 +0000 (17:09 +0000)] 
Further improvements to the estimated cost of sorting.  Take into account
the number of columns to be sorted.

FossilOrigin-Name: f3290cf83b7c02d17d85d8942954f052b486c370cd5ec732969da9061dc1d19a

2 years agoCause CLI .sha3sum to warn of text fields that do not survive CAST(CAST(t as BLOB...
larrybr [Sat, 3 Dec 2022 16:09:32 +0000 (16:09 +0000)] 
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

2 years agoCorrect a memory leak in tester1.js.
stephan [Sat, 3 Dec 2022 15:41:29 +0000 (15:41 +0000)] 
Correct a memory leak in tester1.js.

FossilOrigin-Name: e42b052dd754e577b8429e2430821c5f88096170ffa58b4e5e3cb7ee19b6c37d

2 years agosqlite3.wasm.allocFromTypedArray() now optionally accepts an ArrayBuffer as its argument.
stephan [Sat, 3 Dec 2022 14:58:45 +0000 (14:58 +0000)] 
sqlite3.wasm.allocFromTypedArray() now optionally accepts an ArrayBuffer as its argument.

FossilOrigin-Name: 75a1a796f86d289c7275666fab19013934775dcccaed44a1a61d1749a6cb99c9

2 years agoRename wasm.xWrap.resultAdapter() X:free entries to X:dealloc for consistency with...
stephan [Sat, 3 Dec 2022 13:10:58 +0000 (13:10 +0000)] 
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

2 years agoDoc typo fix for SQLITE_MAX_ALLOCATION_SIZE in malloc.c. No code changes.
stephan [Sat, 3 Dec 2022 13:05:33 +0000 (13:05 +0000)] 
Doc typo fix for SQLITE_MAX_ALLOCATION_SIZE in malloc.c. No code changes.

FossilOrigin-Name: ed1ed21221b048ac5a5275cdfc4d9b2a406acdc7d4b648c3b61bcc822d88d955

2 years agoMove kvvfs xRead()/xWrite() buffer from function-local stack memory to heap memory...
stephan [Sat, 3 Dec 2022 11:51:29 +0000 (11:51 +0000)] 
Move kvvfs xRead()/xWrite() buffer from function-local stack memory to heap memory to accommodate changes in emsdk 3.1.27.

FossilOrigin-Name: f1da32410ca7b808b3bef5f5a59766e7281e9e6ea343c8b979599bf1fc1060f5

2 years agoJavaScript: add sqlite3.wasm.realloc(), sqlite3.capi.SQLITE_MAX_ALLOCATION_SIZE,...
stephan [Sat, 3 Dec 2022 11:16:55 +0000 (11:16 +0000)] 
JavaScript: add sqlite3.wasm.realloc(), sqlite3.capi.SQLITE_MAX_ALLOCATION_SIZE, and related tests.

FossilOrigin-Name: eeb84ba5de1152ef0f42105b8b285fdee9f5ad58281e60a4e0c8b1d6de1dead8

2 years agowasm build: rename the path to the wasm docs checkout, for clarity and consistency.
stephan [Sat, 3 Dec 2022 03:06:16 +0000 (03:06 +0000)] 
wasm build: rename the path to the wasm docs checkout, for clarity and consistency.

FossilOrigin-Name: b820db32365b2ca8e2397fd6ea85883e4555ffd82948e248a0f98415b7328349

2 years agowasm snapshot and doc-related build automation tweaks.
stephan [Sat, 3 Dec 2022 02:42:21 +0000 (02:42 +0000)] 
wasm snapshot and doc-related build automation tweaks.

FossilOrigin-Name: 13eb1abd06f55fb88fc7f7be6149fd94b12057d9c38cc6b97bec3940e7e01f04

2 years agoRework the oo1.DB's distinct-per-VFS post-open() step to accept either a batch of...
stephan [Sat, 3 Dec 2022 01:59:03 +0000 (01:59 +0000)] 
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

2 years agoTuning the query planner by adjusting the weights that predict the relative
drh [Sat, 3 Dec 2022 00:52:21 +0000 (00:52 +0000)] 
Tuning the query planner by adjusting the weights that predict the relative
performance of sorting and index lookup.

FossilOrigin-Name: 9f2806da4d88beceac2e81e05421f00481dd3dd100b096cd2ae6c828adb42ca7

2 years agoEnhance the sqlite3_stmt_scanstatus() API and add sqlite3_stmt_scanstatus_v2(). For...
dan [Fri, 2 Dec 2022 20:32:22 +0000 (20:32 +0000)] 
Enhance the sqlite3_stmt_scanstatus() API and add sqlite3_stmt_scanstatus_v2(). For creation of easier to read query performance reports.

FossilOrigin-Name: 55800833645739efeddcacef464c623931cb6aeb43f4219b4e4faf473c25c8bb

2 years agoMinor internal tweaks to the OPFS VFS. Resolve a missing result code which lead to...
stephan [Fri, 2 Dec 2022 18:56:37 +0000 (18:56 +0000)] 
Minor internal tweaks to the OPFS VFS. Resolve a missing result code which lead to a null deref in xFileSize().

FossilOrigin-Name: 57dd593ef0efa17dfb3a9f4eac36d5b8b879e271de817d8cd94a8c8b56d31870

2 years agoOPFS VFS: translate createSyncAccessHandle() exceptions which appear to be locking...
stephan [Fri, 2 Dec 2022 18:06:26 +0000 (18:06 +0000)] 
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

2 years agoFor the sqlite3_bind and sqlite3_result interfaces for UTF16 strings, round
drh [Fri, 2 Dec 2022 17:52:52 +0000 (17:52 +0000)] 
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

2 years agoUse sqlite3_result_int64() instead of sqlite3_result_int() when returning
drh [Fri, 2 Dec 2022 15:31:47 +0000 (15:31 +0000)] 
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

2 years agoMinor touchups to the JS test index page and test server push rules.
stephan [Fri, 2 Dec 2022 11:35:21 +0000 (11:35 +0000)] 
Minor touchups to the JS test index page and test server push rules.

FossilOrigin-Name: 0881f3e92364b3dc81443220451e853c0763efaf97653a6348bc39bd9bdb23ad

2 years agowasm builds: explicitly set a default stack size because emsdk 3.1.27 reduced it...
stephan [Fri, 2 Dec 2022 10:43:14 +0000 (10:43 +0000)] 
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

2 years agowasm: after building snapshot zip file, emit instructions for pushing it to the test...
stephan [Fri, 2 Dec 2022 09:23:38 +0000 (09:23 +0000)] 
wasm: after building snapshot zip file, emit instructions for pushing it to the test server.

FossilOrigin-Name: 9615c77919fee60d708d72729c741b373a89900aabc318e0ceb4154638cdf339

2 years agoCorrect the problem which triggered the rollback in [7eec635562f6]: an incorrect...
stephan [Fri, 2 Dec 2022 08:51:22 +0000 (08:51 +0000)] 
Correct the problem which triggered the rollback in [7eec635562f6]: an incorrect default db page size (not a multiple of 512 bytes).

FossilOrigin-Name: e06e490c240aa56b616e6f0380b5d08abf06f35f9e683e5150c5ac464eae9e55

2 years agoRoll back the SQLITE_DEFAULT_PAGE_SIZE part of [c260895faacb34] because kvvfs does...
stephan [Fri, 2 Dec 2022 08:38:04 +0000 (08:38 +0000)] 
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

2 years agosqlite3-wasm.c: code legibility and coding style tweaks. Increase SQLITE_DEFAULT_PAGE...
stephan [Fri, 2 Dec 2022 08:29:03 +0000 (08:29 +0000)] 
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

2 years agoExpand JS tests for db export/import and document reason it cannot currently work...
stephan [Fri, 2 Dec 2022 07:14:56 +0000 (07:14 +0000)] 
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