1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-04-26 11:28:58 +03:00

29833 Commits

Author SHA1 Message Date
drh
49906e8e4b The reuse-subroutine optimization [c9a3498113074bbc] might have generated
byte-code that loops forever.  This check-in fixes the problem.

FossilOrigin-Name: 0cc4ed8c6e53aca1f5e94c132bedbc7f561c04a77f1a30b965ffe7560634bfeb
2025-01-30 21:12:58 +00:00
dan
df54ecb1bf Fix a problem causing the write-lock to be held when it should not be in some circumstances following a SEH exception.
FossilOrigin-Name: 7eb5accb7cf937fc967dcd86da0af813fb18a2697348bd231fbefd3c09b930ab
2025-01-30 17:04:28 +00:00
drh
8bffd498ea Remove an unused parameter from an internal-use subroutine in the TCL interface.
FossilOrigin-Name: a700692b39e24f5ca9ea6f879d413e20c2ad2b85f62c867407dafe111f13d931
2025-01-30 16:07:51 +00:00
drh
000e39e9a8 Improvements to the TCL interface for Tcl9 as suggested by Jan Nijtmans.
FossilOrigin-Name: d76c5db866de2732b68401a4c3e39acddc7a99bed965160c1796477c062b478a
2025-01-30 16:00:28 +00:00
dan
462888819e Have sqlite3_enable_setlk(-1) configure indefinite blocking locks where they are supported.
FossilOrigin-Name: 62009565d2f2a2c4d347e1da0d5b4ad43056742df47fd6ddb92e62f53a2b57f1
2025-01-30 15:26:16 +00:00
drh
8dacf71043 Updates to the compile-for-windows.md document.
FossilOrigin-Name: bcd22ed686954657ba820d53dec255d33797924f76e57b931016813581e04e06
2025-01-30 13:54:32 +00:00
stephan
73dcf45a3d Minor code de-duplication across the top-level auto.def and autoconf/auto.def.
FossilOrigin-Name: 3c990d77cb83ab371d92c97e0528f790ab6126c60f48ff77e48bd166d7834cf0
2025-01-30 12:19:30 +00:00
drh
1392ff5533 Disable a test case that (intentionally) does use-after-free, as it does
occasionally cause problems even for non-sanitizer builds.

FossilOrigin-Name: 23c7d5bea351c04785153ddb30e19c1236db9d11054ab8229893531026b53655
2025-01-30 12:01:24 +00:00
stephan
00d6b7abfc Fix build regression, introduced in [d2fe6b05f38d9d] (3.48.0), in which SQLITE_OMIT and SQLITE_ENABLE flags passed to configure via CFLAGS were not propagated to the OPT_FEATURE_FLAGS list. Reported in [forum:9801e54665afd728|forum post 9801e54665afd728].
FossilOrigin-Name: ec71d9dcd582188d7fb4ab945187de1023eaaecffeeb2903a6fcc49650bd21e9
2025-01-30 11:19:16 +00:00
dan
4f8f1965f7 Fix bug in sessions handling of FK constraints introduced by [e09a0c02] (released in 3.48.0). Bug was preventing a changeset containing FK violations from being applied even when the xConflict(CHANGESET_FOREIGN_KEY) returned OMIT.
FossilOrigin-Name: d7c07581203a0a88456588e49e51b40a8341b0e7121809f75be0ee882d91650f
2025-01-29 18:53:19 +00:00
stephan
cb46f1bb95 Simplify how OpfsSAHPoolUtil.unpauseVfs()'s returned promise is handled.
FossilOrigin-Name: d651b8da5a84cd54d71f15bd34e4db685674ef73f26f5cc26b7af5321a2ec05e
2025-01-29 11:28:18 +00:00
stephan
8883deb30e Add experimental support to pause/unpause an SAHPool OPFS VFS, as discussed in [forum:fe8cdb8431c32455|forum post fe8cdb8431c32455], the intent being enable a page to relinquish, perhaps temporarily, the VFS such that the VFS's storage can be accessed by another page/tab.
FossilOrigin-Name: 1d2683fe9e4be01c3137e750900f54d287e7d96185e66924d24b50f4647e7ef1
2025-01-29 11:08:11 +00:00
drh
36279c256b Enhance the if() and iif() SQL functions so that they support any
number of arguments greater than or equal to two.
Suggested by [forum:/forumpost/40f7867f75f80|forum post 40f7867f75f80].

FossilOrigin-Name: fb76d184ee5afc41009c4023bb68b3ddd42c9235a79ec9695c26f5bbe9a1aa25
2025-01-28 20:32:48 +00:00
dan
9dcf3d08c9 Fix sessions module handling of tables with generated columns.
FossilOrigin-Name: 437fb316389bc3c24c5cdb4d01edfc81e2c2e9f2b399fc2a95b05d279361d8ec
2025-01-28 19:03:37 +00:00
drh
0424f255ef Fix a copy/paste typo in the output of vfstrace for xDlClose().
FossilOrigin-Name: 1d57b57c85bb8cb9b8a1808b771bb91eeb8150efd14f9064a390e533e715bab7
2025-01-28 18:03:22 +00:00
drh
8b62a82ae3 Simplifh the IdList object to remove unnecessary fields. Performance
increases by about 0.8%.

FossilOrigin-Name: a4625bb995dd5582d1f3cf0c2e54eb3f01f1cc1405811dda86ebd38b2b858994
2025-01-28 12:50:17 +00:00
drh
b0c8b08874 Fix typo in speedtest.md.
FossilOrigin-Name: 984a9cc22c7c8492bf4fae482749663899b0e33a25c32e6ae5c5e98fc12bb83e
2025-01-28 10:56:22 +00:00
drh
50637ca5c5 Apparently I got the logic of [abfe488ed67e2e35] confused, even backwards.
Change it so that the SQLITE_USE_W32_FOR_CONSOLE_IO macro causes Win32 APIs
to be used for console I/O and for stdio to be used otherwise.  This is
reported to be necessary for builds that use a C-language runtime other than
the one provided by Microsoft.  This changes if for Windows only.  It is a
bug fix, though we don't have a test case that will demonstrate a malfunction.

FossilOrigin-Name: 925e97e6f4238f02259a0c95b1fc668ae32a95329242f8eeae236ef207aca112
2025-01-28 01:10:45 +00:00
drh
d8c37bbc54 Remove an ALWAYS() in the star-query heuristic that is sometimes false if you
have a corrupt database.  dbsqlfuzz c37ba7728d79859b79c8341b59297e88fba017d3.
Test case in TH3.

FossilOrigin-Name: 6b9a339628eb8bfb6dfbee02000a6ac91cc8a9ae16bd990e62c4142b9f912c36
2025-01-28 00:48:01 +00:00
drh
44980e8169 Use hashing to accelerate column matching on INSERT statements. Code is
smaller and about 1.8% faster overall according to test/speedtest.tcl.

FossilOrigin-Name: 8be956383e0344fb613ec2e56fce7b518f439ae34bf9ddb424de2bd9b31c9889
2025-01-27 21:18:13 +00:00
drh
5dcf5890ae Enhance ./configure to issue an unambiguious error if the pathname to either
the source tree or the build directory contains any space characters.

FossilOrigin-Name: 614ae5c74f3b534f50432c875681d7a1e6135be883508939c9c57822cc1e9361
2025-01-27 17:48:51 +00:00
drh
7c727bb61b Avoid splitting a hyperlink across lines in the documentation comment for
sqlite3_serialize().

FossilOrigin-Name: 74b770bd445d98ff883000ab2e31603d729e415e4e4f640646eef30825634f48
2025-01-27 14:12:14 +00:00
dan
43aad25b1b Add the sqlite3_setlk_timeout() API. For setting the timeout used by SQLITE_ENABLE_SETLK_TIMEOUT blocking locks without also setting the regular retry-based busy-timeout.
FossilOrigin-Name: 4a7eb492797abb47b18b7dfc557aeae43a0dea5b861efc203398d5059b10d131
2025-01-27 11:50:03 +00:00
drh
e097db7210 Make two private routines in FTS "static" so that they are not callable from
outside of SQLite itself.

FossilOrigin-Name: 9b11bed0448b95319206b413c35f23bb80f3f4c0a4394d40f2e64066400a01ed
2025-01-26 23:34:49 +00:00
drh
2228567ad3 Further comment improvements in the star-query heuristic. Add an ALWAYS()
on an unreachable branch to achieve MC/DC.

FossilOrigin-Name: 5e18ce68fbc5e73e6694936f3ba71f5b5e3758cf380951805ca6ea6a3f0943aa
2025-01-26 20:09:57 +00:00
drh
fe54b7a1f4 Small size and complexity reduction on the star-query heuristic. Improved
comments for the star-query heuristic.

FossilOrigin-Name: a7ecb2f4b7eee78b88f1b2e026dffed2007ca4ffeb152632624ab2582839b250
2025-01-26 17:29:33 +00:00
drh
fb9e8e48fd Revise the strategy used by the star-query heuristic: Instead of decreasing
the cost of all fact-table WhereLoops, increase the run-cost of WhereLoops that
are SCANs of dimension tables.

FossilOrigin-Name: 1bc09c9e8bd77ac41ecbe510c7e003757fc11d0f586da6cdf3584315aa9d6407
2025-01-25 23:04:05 +00:00
drh
0186ee1cd7 Improvments to debug output on the star-query heuristic.
FossilOrigin-Name: b3ebeb0682a2c837987acf4ed92f06cf91aea235830c5a0f9dd1ce64afe16e84
2025-01-25 14:30:36 +00:00
drh
dea434ea65 Avoid calling computeMxChoice() after an OOM as some assert()s can fail
in that routine if a prior OOM occurred while building the WhereLoop array.

FossilOrigin-Name: 8b9e621dbf599d7e75e07d75d4c400247d693ea76e00eba0919f4e33e3e10bdd
2025-01-25 00:07:14 +00:00
drh
bc7e41c03c Remove an incorrect ALWAYS() added in check-in [7cfbe14d199bb631].
FossilOrigin-Name: 431a1a29f93dc642779dc21c3a0edad5fcda1d175e9d1e3b216fa02c234fe774
2025-01-24 20:59:12 +00:00
stephan
77731d5ec0 Clarify handling of a NULL for the 2nd argument to sqlite3_serialize(), as pointed out in [forum:3df7168b90|forum post 3df7168b90].
FossilOrigin-Name: 340edbe5540762656b648c18a359ab7039b4a0af15db199fc86317a415e2bafa
2025-01-24 18:37:55 +00:00
drh
079f840e47 Improve the star-query heuristic so that it does a better job of identifying
actual star queries.  Also includes improved diagnostic output from the
query planner.

FossilOrigin-Name: 7cfbe14d199bb631abd4d009698eeaee9b8450d5061ded612095ee4738ac6a1f
2025-01-24 16:37:31 +00:00
drh
d37412b80c The debugging output for WhereLoop objects now shows cost
estimate changes due to the star-query heuristic.

FossilOrigin-Name: a280f5f5480e560fc2b80e8947d8062e8b3487d930e71cb60fc9ba90d87977c1
2025-01-24 16:27:18 +00:00
drh
f1c5830311 Minor tweaks to the star-query detection and processing.
FossilOrigin-Name: 61f76a45ac7aa454419fd7539a3d8e60f0733fb5a2abd034d795328f3c1b6e9b
2025-01-24 15:55:20 +00:00
dan
2539fb2bc5 Fix a race condition causing SQLite to use a busy-handler for an operation that should not.
FossilOrigin-Name: 6ab9ed8eef77781898375038ab05fc6e5f46b745e4906691393b8b1d90570eb6
2025-01-24 15:49:47 +00:00
stephan
7ae051df2a Correct a version number in autosetup/README.md.
FossilOrigin-Name: c338caf0fd4adc7baacf20f6d4274b1776b9487a5a976b8d85e490791be82b11
2025-01-24 15:41:33 +00:00
drh
299fe02393 When looking for star-queries, do not count a table as a dimension table
if that table is separated from the fact table by an OUTER or CROSS join
or if the table is a self-join.

FossilOrigin-Name: 5aebd7df0d577e98b3affd22b84b42dfe84a9f37fa29187505cc245b95460ba4
2025-01-24 14:51:15 +00:00
stephan
7a16413a84 Update autosetup/README.md to reflect recent refactoring.
FossilOrigin-Name: 601636829b79888deda7d4dc5786f82b4f0b302d84663ee96b4d47fcb429abcf
2025-01-24 14:13:20 +00:00
stephan
8bfb186728 Replace a handful of hard tabs in string literals with \t in mkwasmbuilds.c.
FossilOrigin-Name: e8e4d497a7b6aae450cb93927c7583fcce3fe971cd3691f9d9cad605de3cfb1f
2025-01-24 12:54:59 +00:00
stephan
4331e6bd1d Minor additions to ext/wasm/README.md.
FossilOrigin-Name: 85747ea1654c74d330614aa174ede4a989b6456eb1fc5eb0fc9f2d1418b6ef99
2025-01-24 09:21:39 +00:00
stephan
dfb5f32758 Update ext/wasm/README.md to reflect simplifications permitted by the current configure script behavior.
FossilOrigin-Name: 9abb56c6acb1c84c2df8534ca3ebb2894afd68bc7b8331d4d12611896c576749
2025-01-24 09:18:19 +00:00
stephan
c70631623c Remove extraneous are-we-making-clean guards from the generated wasm build rules, as that guard is set at a higher level. Rename a makefile call()able for consistency.
FossilOrigin-Name: 7f9074e2a7ff62bdcf343895e80a51224de62a22afbbf82068ec5fea7eeda0bb
2025-01-24 08:58:54 +00:00
stephan
07a2e5d1ed wasm: de-list demo-worker1-promiser-esm.html from the test pages because (per Chrome 131) "Module scripts don't support importScripts()", where "don't" means "they used to but no longer do".
FossilOrigin-Name: 4aa025a943a4024094b91f13abfb8945bbbb8334e3ec904dee5315852845bfe1
2025-01-23 22:23:31 +00:00
drh
1519675a1a Fix a possible infinity loop in debugging-printf logic in the query planner.
No changes to production code.

FossilOrigin-Name: 9a20b94080f5379867530772e081b737ae4cf6b416469dcabb85b8dd819f491f
2025-01-23 21:06:59 +00:00
stephan
02e81f72a0 When running wasm-opt, ignore any failure because it will fail for unknown flags and the set of legal flags will change from version to version. Document the size-reduction effect (or non-effect) of a dozen-odd wasm-opt flags and retain those which demonstrate a wasm file size reduction in -Oz builds (our production build mode). Total size savings: roughly 13kb.
FossilOrigin-Name: c9dc581e0287e3462ac55f80ca76e7e98d31157022052c892517363c45287a7b
2025-01-23 19:44:09 +00:00
stephan
726a047a47 Remove some now-dead makefile code, rename a var for consistency, and fix a recipe bug introduced in the previous checkin in the bundler-friendly build.
FossilOrigin-Name: 0acd4ef3addb311476f4a670be0c4c4a0f3f88b0420886d4c1c3c3027dd51d73
2025-01-23 16:11:24 +00:00
stephan
efafde5eb4 Initial support for post-processing wasm files with wasm-opt (if it's available). This currently shaves 12kb off of the release-mode build of sqlite3.wasm but there are many dozens of wasm-opt flags left to try.
FossilOrigin-Name: 5d16e3f28364de2d6b6456a6fc56bf604b9106c3ae15719f2862192ae3020cc1
2025-01-23 15:58:01 +00:00
stephan
72543206e5 Move small parts of ext/wasm/GNUmakefile into ext/wasm/config.make.in and have the configure script populate that, rather than dynamically determining those values on each 'make' invocation. Add a configure-time check for the optional wasm-opt binary in prep for pending experimentation with using it to reduce the wasm file sizes.
FossilOrigin-Name: 0a426a549577b883e2de7cd0605041cc97b57f53ee6657bc318b0bfde7b62677
2025-01-23 14:09:02 +00:00
stephan
c9bf7ed9ad Remove unnecessary --minify 0 emcc flag from the wasm build, as -g3 implies that capability along with other anti-minification features we rely on.
FossilOrigin-Name: 10c91f9cd074e8d35af1c7f8251ac18e5dd91fa14df3fe4e1fb44441c4f08c7a
2025-01-23 11:21:29 +00:00
stephan
83baa239e7 Do not strip binaries during 'make install', for consistency with the legacy build and per request from package maintainers.
FossilOrigin-Name: cd3fed5c2082c250c32c4d99eecd49a1ab840583fc343bcfd27fb536715d0ce9
2025-01-23 06:10:54 +00:00