Commit Graph

30734 Commits

Author SHA1 Message Date
drh
9e91a1fe89 Modify the "%realloc" and "%free" commands in Lemon so that the functions
they specify take an extra parameter at the end, the %extra_context pointer.
This allows the implementation to distinguish between OOM errors and
failures to increase the stack size because of the stack size limit.

FossilOrigin-Name: 9862c945d9a8531f9bef123aee9ed1fd3f64542250a57beb3a150227bc3c1a12
2025-11-18 15:40:02 +00:00
drh
9432655038 Lower the default stack size for the parse to 50.
FossilOrigin-Name: 41fe19ab054acda912bc32dd6f9c6412416ab1af6cf55515e96c89fb55b46424
2025-11-18 15:20:22 +00:00
drh
fef2233090 Add the SQLITE_LIMIT_PARSER_DEPTH value for sqlite3_limit(). This isn't
something that many applications will need, but it is useful for testing.

FossilOrigin-Name: 8f0b07f36159225c476f756f8f9b35c75783bc8bed43b578f4d1055fa800ecc9
2025-11-18 14:48:33 +00:00
drh
d26ac414c8 Yet another attempt at controlling the parser stack size.
FossilOrigin-Name: cb19986dc6bc483df21e082e54a14cb6d7540b1734259e6d326d676908ac0172
2025-11-18 13:03:08 +00:00
drh
ef4abc0a63 Fix incorrect "#line" generation in Lemon.
FossilOrigin-Name: 5c0214df2c0a7470ac2edca0c483a3edd3c39ef0739688ab9a06e23882200360
2025-11-18 10:38:41 +00:00
stephan
847d2ed685 Add api.oo1=0 flag to ext/wasm/GNUmakefile to strip out the sqlite3.oo1 pieces from the build. Part of the ongoing response to [forum:4b7d45433731d2e0|forum post 4b7d45433731d2e0].
FossilOrigin-Name: ea48567ac54e4949a8b68977a58a5de7946e074ae8737133071d02f40ac97f34
2025-11-17 23:55:41 +00:00
drh
18a9bdd90a Fix a harmless compiler warning.
FossilOrigin-Name: 6621737cc05cbf8ff5f576775a8a3c64f666b56d42939968ebb55d72a835646b
2025-11-17 19:19:58 +00:00
stephan
3e2ecc390b Remove an unused struct.
FossilOrigin-Name: 93dd0e62b74a0d99803f680f23953e9fa2429074505ba402ca5ed4610ddef8fb
2025-11-15 16:06:03 +00:00
stephan
a1dede1e58 JNI: when validing the eTextRep argument in sqlite3_create_function(), only validate the lower four bits (the high bits are for other flags). Add flags to test functions to ensure this case is triggered.
FossilOrigin-Name: aab640be7bc5829fe16d2582b13f942b7debb271c150ca2471561de6b2d70dc7
2025-11-15 15:30:45 +00:00
stephan
982274b8e9 Replace the JNI binding's internal use of sqlite3ErrorWithMsg() with sqlite3_set_errmsg() and have it handle OOM in a way consistent with the rest of the JNI bindings.
FossilOrigin-Name: 0899a9eb3af727f310372f3441573ab506ffec31dca4774e850b2b59a4001ee0
2025-11-15 15:09:04 +00:00
stephan
e83ffd5c87 Random JS build cleanups and parallel build mkdir race fixes. Reinstate the recently-removed [a65bd978cbc646ec] after finding a reformulation which works on Emscripten 4.0.19 (and saves about 85kb on the JS deliverables).
FossilOrigin-Name: acb1525a49463de67716638626406ccde9a282907d0de218ab88bf474ba830ee
2025-11-15 13:30:13 +00:00
stephan
393a4d8ac5 Reorder initialization of sqlite3ApiBootstrap()'s bownstrapped config object so that it's possible to inject the wasm memory and exports via that, to simplify plugging-in of sqlite3-api.js in other builds. Previously the build-provided wasm exports/memory overrode any which a client might want to use.
FossilOrigin-Name: 2bd0addb6068cd2b34f6151a824c578e2253f541a8c55b578219b09c42afd82b
2025-11-15 11:53:30 +00:00
stephan
987870a6a0 Generic internal JS cleanups towards improving portability of sqlite3-api.js to other build systems.
FossilOrigin-Name: 5bc37e5c2fcd83fd0bc40234144072363f1cbf7d811a15b74a0991e397a35eb8
2025-11-15 11:30:45 +00:00
stephan
a804a65617 Move sqlite3-api-cleanup.js into post-js-footer.js to remove the final direct Emscripten dependency from the intermediary build product sqlite3-api.js (the whole library, waiting to be bootstrapped). This is partly in response to [forum:4b7d45433731d2e0|forum post 4b7d45433731d2e0], which demonstrates a potential use case for a standalone sqlite3-api.js. This is a build/doc change, not a functional one.
FossilOrigin-Name: 2fcbd8e17d8f1dd7e9d45168805dba718777e46803d9375a4212296d3d0cd89c
2025-11-15 09:19:03 +00:00
stephan
5279cbd353 API doc typo fix.
FossilOrigin-Name: c1e9791fbf9e4c2ca6f9f031ea2c26d8b4bfb4d54850a53853f2b2d9620792ef
2025-11-15 08:05:12 +00:00
drh
c14ae9cd3b New interfaces sqlite3_str_truncate() and sqlite3_str_free(). Version number
increases to 3.52.0.

FossilOrigin-Name: fa85534ed927851dc37a4943e83259bff4509f141449226ffb506f9acc7b2cc5
2025-11-14 20:09:01 +00:00
dan
ed7981ea3e If SQLITE_EXPERIMENTAL_PRAGMA_20251114 is defined at build-time, send an experimental pragma file-control to the VFS if a call to take a SHARED lock is to be immediately followed by one to take a RESERVED.
FossilOrigin-Name: e2b3f1a9480a9be3e06c2d79abcf39f399b5adf2ca882841b3b3fa199c239dd8
2025-11-14 17:27:20 +00:00
stephan
e1f7ec65fd Slight restructure of the previous checkin.
FossilOrigin-Name: 8ff98747c072c8c333b1b37cf4ec9344e84f081bd4e6d3b5e75f37b1e1ce9e84
2025-11-14 17:23:24 +00:00
stephan
505d8a43db In sqlite3-api-cleanup.js, if no Emscripten module is detected then simply return, rather than throw. This should enable the generated sqliet3-api.js (normally an intermediary file) to be used as-is, with the caveat that the caller has to bootstrap the library themselves.
FossilOrigin-Name: d64c9cd4c7a1ffe04de6c75126563d7bbb24266e13d41406f6d55720b8199037
2025-11-14 16:56:51 +00:00
stephan
408c991017 Remove a harmless duplicated makefile var assignment from mkwasmbuilds.c.
FossilOrigin-Name: 4b4a6fbe20d51689e0abc65beed078bbb9418383e69eb8ec13f0657e2cf13bfd
2025-11-14 15:03:55 +00:00
stephan
09cc9b5184 Fix a makefile ordering bug which caused certain builds to fail unless others had already been built. Remove the superfluous sqlite3-node.wasm from the final deliverables dir (sqlite3-node.mjs uses sqlite3.wasm instead).
FossilOrigin-Name: fd70088284946b9d4315781b3f68133cc0abd4244247f2fce04044feab8a97c0
2025-11-14 14:42:00 +00:00
drh
9bafbd122b Fix a harmless compiler warning in testing code.
FossilOrigin-Name: 5252a2e629e1adb61169d32ca6458c6decd1ec562f358bb9d0b448a2f0243c56
2025-11-14 11:02:49 +00:00
dan
7a796b702f A better fix for the issue with RETURNING triggers on eponymous virtual tables and SQLITE_SCHEMA errors first addressed by [45d820ca22].
FossilOrigin-Name: bf399992cb98e5d5f002a90b521328d5c2f113ebab8601653452d78222077bde
2025-11-13 20:37:09 +00:00
dan
8b34ce7d61 Add an OOM test case for the issue with dropping RETURNING triggers when the schema is reset while preparing a statement that uses an eponymous vtab.
FossilOrigin-Name: dc569288dd63754269e14be7a9937c882531685a3e9caec25f86ec8c01eb9583
2025-11-13 18:02:22 +00:00
dan
826bebdb31 Add better test case for the issue with dropping RETURNING triggers when the schema is reset while preparing a statement.
FossilOrigin-Name: 6a9fdde109865b23888f099d066721404e8b853f3dacd55ce08c8bbda2491ec3
2025-11-13 17:42:55 +00:00
stephan
388c1da56e Generic makefile cleanups and doc updates.
FossilOrigin-Name: e8b34b4178be621102dac165b716283055fad90b3edc2394f56a24f9f0149448
2025-11-13 17:37:40 +00:00
stephan
9e6474c5a8 Internal doc fix (renamed file).
FossilOrigin-Name: cb8fb01fe19ba3af536a662aed894b2b0eb2463c8d34c644c498234fd82122f3
2025-11-13 16:38:45 +00:00
stephan
319870836c JS code reformatting and doc updates. No functional changes.
FossilOrigin-Name: c566c653e4f55afa0660e819ed5b1fd96cb9b24bc78c333adcd8825331a9dd26
2025-11-13 15:33:44 +00:00
stephan
a9025a5f1a Add the #include -raw flag to ext/wasm/c-pp-lite.c to support a pending feature.
FossilOrigin-Name: 42c30c314969c0f2573bbe36615683ac19a7ba4e30004c7080873459096caaf5
2025-11-13 14:47:41 +00:00
drh
237778289b Fix a problem in the EXISTS-to-JOIN optimization ([e33da6d5dc964db8]) so
that it works with nested WHERE and EXISTS statements.
[forum:/forumpost/0704c3c41e49631b|Forum post 0704c3c41e4]

FossilOrigin-Name: d1e901eddc25175174d0706238ae0c33bfa5569e0c2ba4f1164b7a9600203442
2025-11-13 11:36:48 +00:00
stephan
57a533a7c3 mkwasmbuilds.c doc updates. Merge in the parts of [8611cf643b] which are not contentious.
FossilOrigin-Name: cb0f0e22241aae65938b4bc7a1b809088466a17cee80344f66ee889a76c422c1
2025-11-13 09:03:48 +00:00
stephan
f47095a5a0 Teach c-pp to export its argv as a #define list so that we can embed it in the generates files.
FossilOrigin-Name: 42f95ea71e5e7e927685de3a6da2ede38abe7cabdd1fc71b9a14bebe9f54a65e
2025-11-13 08:26:11 +00:00
stephan
791b767b26 Doc typo fix reported in [forum:00e49e9aa1|forum post 00e49e9aa1].
FossilOrigin-Name: 36cd33f634a45900f6e52ba07aa20242a5f2b29c7cbe19be968c52ffef34fcde
2025-11-13 07:07:28 +00:00
stephan
ce53b80819 Minor doc correction and a JS error message tweak.
FossilOrigin-Name: c4ae21c89e5fd40eefd4916df6c6a6c4e27075a434a9d47576d3fcfbc7720588
2025-11-13 06:49:12 +00:00
stephan
b867030b1a Clarify that 'pikchr' is not a typo.
FossilOrigin-Name: d7bb2ee6ec23c266c887fb2aeb77b0b17cd8f1429564d341537f57c5478410e2
2025-11-12 17:25:17 +00:00
drh
7efded5edc Improved concurrency for "make devtest" by splitting fuzzdata1.db and
fuzzdata2.db into slices for asan and ubsan testing.

FossilOrigin-Name: 2c31176607f02a73cf2626cda2dd0711ae74bdf0b4520d4c84ff299c860e419e
2025-11-10 20:01:39 +00:00
dan
f07576429e Avoid dropping RETURNING triggers when the schema is reset while preparing a statement.
FossilOrigin-Name: 45d820ca227eb1ade4dda498b0f94b2c5df4bab3fc5fcdd517ee125a43d16f4d
2025-11-10 19:11:15 +00:00
dan
14fcb8252a Avoid dropping RETURNING triggers when the schema is reset while preparing a statement.
FossilOrigin-Name: e26bcef7522a6f6ee8d55fa30e7fe06419566cf4e8c2df0c33c92a4c89f58c05
2025-11-10 17:37:59 +00:00
drh
a79f685533 Fix a missing va_end() call in the intckMprintf() function of the
incremental integrity-check extension.

FossilOrigin-Name: 62ad2350e368dc337ba2d0fb6847d07c40a6f79520dd6414d22b5b54983b0b12
2025-11-10 11:05:36 +00:00
dan
240397bb03 A more compact fix for the problem first fixed by [5f5a736f88].
FossilOrigin-Name: 7a644178c8d289ca18631844b2d73b32fddc72afcc80906633dd38c14eba2ca9
2025-11-10 11:00:41 +00:00
dan
4ac766cc05 Have sqlite3_set_errmsg() return SQLITE_MISUSE if a NULL db handle is passed to it, as documented.
FossilOrigin-Name: 5f5a736f88bc9bc6c9c83d2cbfd74c0b5357d7417d9993d34a78f0b7317ff796
2025-11-10 10:47:29 +00:00
stephan
73caea1764 Reworking of JS internals to support binding of nested C structs (like sqlite3_index_constraint and friends) and allow some of the automated JS/C conversions to be plugged in at the struct-binding level, simplifying how struct members, in particular function pointers, can be used from JS.
FossilOrigin-Name: bb4fd5b789cebf2b224c29023fea3e620a86fb36730c36c0d85d9f35880bf643
2025-11-10 07:41:54 +00:00
drh
998ebf1de7 Fix the ".www" command of the CLI so that it works on unix systems with
newer web browsers that do not allow access to files in /tmp.

FossilOrigin-Name: 2f918c14bac28c567cc854b3d41dcdd59191a118bb5fdea9373945fe860161f5
2025-11-10 01:46:06 +00:00
stephan
051e942f5d Minor doc typo fix reported in [forum:939d5864df|forum post 939d5864df].
FossilOrigin-Name: a1f9c977b83fab11c54710070dbedfaea47195050946db74075bdd3ade97a4c8
2025-11-09 07:11:15 +00:00
stephan
4182294987 CLI shell: ensure that .dump propagates its error code on error. Problem reported in [forum:a4f3873b0a8503cc|forum post a4f3873b0a].
FossilOrigin-Name: 850b92b6347187d702736bf5a574b9b4a49854a33799875f24fc75c50a6bf908
2025-11-09 06:51:32 +00:00
stephan
c55d8262cf In sqlite3.wasm.allocFromTypedArray(), swap the order of the allocation and the access to the heap view object to work around an obscure issue when allocating huge blobs. The heap view object could previously become stale via the following allocation if the underlying WebAssembly.Memory object needed to grow. Essentially a realloc()-moves-the-pointer situation but it only comes up with huge allocations under the right circumstances and would trigger a JS exception (as opposed to corrupting the WASM heap). Problem reported in [forum:05b77273be104532|forum post 05b77273be104532].
FossilOrigin-Name: 0f712b6b0516dc151d3bcbb63497661c82e11eae368e639bbdf197e1b3467195
2025-11-09 06:32:10 +00:00
stephan
66b37e991b Add some UNUSED_PARAMATER()s for the sake of -pedantic -DSQLITE_OMIT_WAL.
FossilOrigin-Name: 620434a4a276ecaf2ee56d325815ac4e33c95e1190b420a341e376e54ef60278
2025-11-07 11:46:56 +00:00
drh
0aca0ccf2c Fix a harmless static-analyzer warning.
FossilOrigin-Name: 9819fc5aa7706fda9d4ec67835ae87eed64d321672873c9d864788b8cf5d27d8
2025-11-07 11:22:47 +00:00
drh
748c0adb62 Get the sqlite3Hwtime() function working on ARM. Enable scanstatus by
default on Windows CLI builds.

FossilOrigin-Name: 305bb022368bac9fafd7c2794762299324796903aaea270923d07f2127d8926c
2025-11-06 13:19:50 +00:00
drh
e77530050e Improvements to documentation for stmt_scanstatus interfaces.
FossilOrigin-Name: 5f3e883d180d6fb7a1909df284713170f5431ea7afcc1a3eb5912c4620df42b2
2025-11-06 12:25:26 +00:00