Commit Graph

25303 Commits

Author SHA1 Message Date
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
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