Commit Graph

28270 Commits

Author SHA1 Message Date
drh 0cf237c5b0 Be more aggressive about reusing subqueries that appear on the RHS of IN
operators that have been replicated due to the predicate push-down optimization.

FossilOrigin-Name: 2accf32b6e45a396503c29eecc14a103bcc7b4c313cde921b26b489704060177
2024-07-04 16:57:11 +00:00
drh 6357d35da9 Add comment using the name "predicate push-down optimization" to what we have
also called "WHERE-clause push down".  No changes to code.

FossilOrigin-Name: be77fe701c7b7d3407800e1ed6a4c8be14035831790419cc99362bff41c65b60
2024-07-04 11:15:32 +00:00
stephan 9e278d7ec0 For shell completion, use pragma_table_xinfo instead of pragma_table_info, so that generated columns are handled, as reported in [forum:f0735e05d8d7e857|forum post f0735e05d8d7e857].
FossilOrigin-Name: a204ffc06b468c2edf8f11ccf3de639edd4f8282e69a44ceeb68a4d3a43e77ea
2024-07-04 09:45:23 +00:00
drh ba384470c4 When constructing an ephermeral table to use as the right-hand side of
an IN operator, also construct a Bloom filter to speed membership testing.

FossilOrigin-Name: baa83b460c677c210c7fa3f20314d7e05f305aed8a69026bc5fa106a3de4ea38
2024-07-03 20:19:33 +00:00
drh 5b070cfa0f Show the creation of IN-operator Bloom filters in the EXPLAIN QUERY PLAN output.
FossilOrigin-Name: c10a1b99d47a4c93bdb16e646f6a21add570d6dbb34fd91a32f8abacdb28712b
2024-07-03 20:10:42 +00:00
drh c4c2589ff0 Add a new sqlite3FaultSim() call to OP_NotFound to use for testing purposes.
FossilOrigin-Name: 84fd275bfd8afada50d3a5ac491d2b866671f8f0d2496bd240cf4bfdd74e7399
2024-07-03 18:56:56 +00:00
drh 6172e4355f Use a Bloom filter to improve performance of IN operators when the RHS of
the IN operator is a subquery.

FossilOrigin-Name: 1933496539c19cbf429a39d6b0b1c6b1b2af50733a3c4aea4920990ced652f6a
2024-07-03 17:51:48 +00:00
drh 3d24637325 Add assert() statements to FTS5 to hush-up warnings from scan-build.
FossilOrigin-Name: 77a76654e64c05f2c67be120f579fc60924ff51a9d0fa2cf9eb158f40171b5f5
2024-07-02 13:54:46 +00:00
drh 8960c02b91 Reword the deliberate_fall_through macro along the lines suggested by
[forum:/forumpost/7ec11023dd|forum post 7ec11023dd] so that it works better
with LLVM, while preserving compatibility with MSVC and older GCCs.

FossilOrigin-Name: fc248a4a0a232a95a79e24e57faedb5d824c3bf0aa62054b72339257dc9c18b3
2024-07-02 12:16:29 +00:00
drh 2143714d9f In the CLI, if the XDG_CONFIG_HOME environment variable is not set, then also
search in ~/.config/sqlite3/sqliterc for the initialization file.
See [forum:/forumpost/5cc6d059e9e092ed|forum thread 5cc6d059e9e092ed].

FossilOrigin-Name: 33841c9c3cb57beeb3884d4b0715d26199926b7d3e4d3dd1ab6f5603b5a62591
2024-07-02 11:30:10 +00:00
drh f1bf103e4e Fix a typo in a comment in a test case. No changes to code.
FossilOrigin-Name: f501166de4f967b7e2e895f180308630e3c88b12bc51823a0a124ee5089eae4f
2024-06-29 15:57:55 +00:00
drh 6adbdac676 Add a NEVER() around a branch in sqlite3ExprAffinity() that is designed to
prevent an infinite loop, but which can now never be reached due to recent
changes.

FossilOrigin-Name: da0b794852f8ccba5bd30395892044ec71b148075608406867785395e1f50b31
2024-06-29 12:22:32 +00:00
dan 75bdf00e89 Update fts5 comment/docs to include the order matches are visited in by the xPhraseFirst/xPhraseNext API.
FossilOrigin-Name: e41930ef5b883c0f2a6b7eb9606021d14a3df145bc94cb0d508af22b4db7f168
2024-06-28 18:21:30 +00:00
drh f13e2d22fe Additional steps to make sure calls to sqlite3ExprToRegister() are sane.
FossilOrigin-Name: 1c42d7176b228791f99bc9971d92a9ab67b1e2956ca4f8d934bd1a3e596d6c80
2024-06-28 18:07:10 +00:00
drh 076bd5758b Do not convert an expression node that is already TK_REGISTER into a
new TK_REGISTER.  This is a follow-up to [663f5dd32d9db832] that fixes a
bug discovered by dbsqlfuzz.

FossilOrigin-Name: fcb669cfaa8a59ca710504d5aaa1936f65a6da8ff13473ad84458f97a6fd1f49
2024-06-28 17:14:00 +00:00
dan 105c20648e Fix an incorrect tcl comment that appeared in many fts5 test files.
FossilOrigin-Name: d07085e2035b52a7edd27980523225e59c5bf851fb4a6de975f03e653b937c9c
2024-06-24 18:06:15 +00:00
dan fdda1cbe0c Fix some problems with calling fts5 api functions from within non-full-text queries.
FossilOrigin-Name: 56d265f956fe6433b625c6d732e55f387af3f643e705316f5a6f709d63731669
2024-06-24 16:08:01 +00:00
dan 1d8cde9d56 Enhance the output of ".scanstats vm" to include the absolute number of ticks for each VM instruction, instead of just the percentage of the total.
FossilOrigin-Name: 1535828335d2b0eccebae952ed2bc70cc0cd893bd4b079d26b80deff9b5f752b
2024-06-24 14:53:14 +00:00
drh 51b3b402c4 Revert Lemon so that it only shows -D options that are actually used. Though
the change to display the options in sorted order is retained.

FossilOrigin-Name: e54eb217c9508c19aee085b111a1323c9009f014ba4db6019918e27002c4ca8c
2024-06-19 18:54:04 +00:00
drh 8cf7bd5448 In lemon, show all the -D options in the generated header, even if none of them
are used.

FossilOrigin-Name: 2aa009c38bb207ac59b9bbd6f8e0d7315697b3fd6a01f9431f29a3c7ccad53e7
2024-06-19 18:46:44 +00:00
drh 199f091a95 Enhance lemon.c so that when it shows the compile-time options in the header
comment of the generated output file, it shows all options, even those not
used, and it shows them in sorted order.

FossilOrigin-Name: eed76e6698eabe47c6bf9696599ce1c2f7aa428cf60f39d0566fbd0d1f6c4c62
2024-06-19 16:38:17 +00:00
stephan d8295c8674 Remove some extraneous flags from the fiddle-debug build. Internal doc tweaks in the main wasm makefile.
FossilOrigin-Name: afae2c9e6fba0820c9be8d06a2e301a74167e4457bada45fe57b5fd9287d2e8b
2024-06-19 11:08:58 +00:00
stephan 68ba3980d5 Minor cleanups in the new fiddle build code.
FossilOrigin-Name: d356aebdd450bedc1ecbbdd266effe53c7badbd74ed7e6db8d0c31318d99a35f
2024-06-18 22:03:28 +00:00
stephan e042988dc0 Rework the fiddle build to build separate debug and non-debug bundles, with the latter in ./fiddle-debug.
FossilOrigin-Name: a9f1758f1cbe7b7d0c87dfb060f52d03c6ea0e066c079891a8ff354073997f9e
2024-06-18 21:50:30 +00:00
stephan 98526f906e Remove an extraneous CSS file and import its CSS into the one HTML file which uses it.
FossilOrigin-Name: 66085ca42388e8de741712150541a3e0afb06b3e23e738aa9ff687e9fc494c50
2024-06-18 20:47:05 +00:00
stephan bb6d32ae71 Add fiddle-debug make target to ext/wasm. It builds the same target files as a non-debug build, as opposed to a new copy, but adds various debug-related flags.
FossilOrigin-Name: 993143c5c39fb6ee15b0661cec8fed436ff04543b528a3796534f5e3a44799f5
2024-06-18 20:40:11 +00:00
drh c98d42e802 Add instructions for how to do debugging builds of the CLI on Windows.
FossilOrigin-Name: abe81c18614b41c78cf3edeaaf8d85d5d2dbdcf331b580f1c98f80d3726d8189
2024-06-18 19:36:04 +00:00
drh 99623a83aa Update sqlite3_analyzer to report on the number of WITHOUT ROWID tables and
to provide separate aggregate statistics for WITHOUT and WITH ROWID tables.

FossilOrigin-Name: 4152894433c3a292d983b1c196664a0c46e406eccd7e644a64fa443fdb204825
2024-06-18 12:19:13 +00:00
stephan e9540e2881 Internal doc typo fixes, as reported in the forum. No code changes.
FossilOrigin-Name: ea16b286b4344c1833ca3d17b6d315fb4ddcb99bcc232ff6444debeb634881f2
2024-06-18 09:58:39 +00:00
stephan c7cbcfbbbd Remove some dead JS code.
FossilOrigin-Name: 754e6e059b740435475c1869feeaca39585b262d5c27210e0fbddbbcc202c4d5
2024-06-16 17:06:50 +00:00
drh 9175b18226 Do not omit the ORDER BY clause from a recursive CTE just because the
query that contains the CTE also contains an ORDER BY clause.  Plus
other changes imported from the recursive-cte-orderby-fix branch.

FossilOrigin-Name: 13242289c5d412b706f50fc7e1553032ea3a52d41a3e34e155432adaf0551481
2024-06-14 23:13:54 +00:00
stephan 709cb313cf Remove some dead JS code. Improve the exception-to-C-result-code conversion to account for the case of a file disappearing while the OPFS VFS is waiting to acquire a lock on it.
FossilOrigin-Name: 5bd9fd5f61e7cd1ed3b44c5cabc759c154c98eb40ad10d29e61f142aaa062ddf
2024-06-12 22:15:25 +00:00
stephan 063a2b338c Remove some JS docs which no longer apply. No code changes.
FossilOrigin-Name: f253cab3359270045a3ae9f5e9eadc1cfc8844181db127165bfdf49d5f99efb1
2024-06-12 21:01:44 +00:00
dan 718c5ff551 Fix a problem with rolling back hot journals using the unix-dotfile VFS.
FossilOrigin-Name: a44703135e8dd3cc67e548e1aa3c42e71df127fb7b593ccfc06025ec42a501fd
2024-06-12 15:50:35 +00:00
dan 9e72ea5ddc Omit tests that depend on sqlite3_release_memory() in lock5.test when running the memsubsys1 or memsubsys2 permutations.
FossilOrigin-Name: 9d63033bf46ddf0f4d9d4ef06d56357fe6165f2370cd19cf81c2f7f61ce224fc
2024-06-12 15:29:37 +00:00
stephan fd70ca40cc OPFS VFS: change the xCheckReservedLock() impl to always return false, as discussed in [forum:a2f573b00cda1372|forum thread a2f573b00cda1372]. This does not impact any current tests, and may have no direct impact at all because of how that VFS handles locking, but is hypothetically a more correct solution than the previous one.
FossilOrigin-Name: c298b8ba2dcd01fa28b79a78bb4986fa0282755a0a36b7f38b93096ac31f521e
2024-06-12 12:36:02 +00:00
stephan 01f07a61e4 Doc updates in JS code. No functional changes.
FossilOrigin-Name: 587ed3a5d283898ad0e67ccee86a0a4ccc432fa292c0a3534e9e6ec70a7b7780
2024-06-12 12:17:03 +00:00
dan f8ed7db472 Do not attempt to run hot journal rollback tests in lock5.test with the "inmemory_journal" permutation, which cannot generate hot journals.
FossilOrigin-Name: 1e6fa95b88cace9e6cac476863d57cfd8de483f83c922ff964b77cbaee6e9ae4
2024-06-12 11:41:18 +00:00
stephan 6975fc56f7 Slight API doc tweak for xCheckReservedLock(), based on forum feedback. No code changes.
FossilOrigin-Name: 2af7a96f6868a4529d689702926b350a4c00082f14da0ded5a8eaea295682d17
2024-06-12 11:39:29 +00:00
dan 41caf1cdfa Handle the case where unix-dotfile is used with URI parameter nolock=1.
FossilOrigin-Name: 3925a5b904e159d54455cfc73fe837a9c6ea3a6d60da63afde3242b4d6f67c90
2024-06-11 20:28:56 +00:00
dan f6ec2b5946 Fix a problem with rolling back hot journals using the unix-dotfile VFS.
FossilOrigin-Name: 4ae3300b79e03381fd7f1033bb7978bb6367369790f17c3bdacac51e205edaf9
2024-06-11 20:03:32 +00:00
stephan e15d5de0a6 Remove some dead JS code and update some JS docs.
FossilOrigin-Name: 6935ac71bad3d36cc519f0325ae4447a674f257309d020cdc0741160fcce0580
2024-06-11 17:04:43 +00:00
stephan cf2710e0b6 When compiling shell.c in SQLITE_SHELL_FIDDLE mode, ensure that the shell_main_exit goto label is reachable.
FossilOrigin-Name: 06e6f64533563ab9c059b773e5f0d78085df716f2624e547b7259f6789c3ffe0
2024-06-11 17:04:02 +00:00
drh 941602ae4f Change constant expressions to pre-computed constants, because apparently
MSVC on ARM requires that.
[forum:/forumpost/4feb1685cced0a8e|Forum thread 4feb1685cced0a8e].

FossilOrigin-Name: 6c103aee6f146869a3e0c48694592f2e4c6b57ecdb4450f46e762c38b4e686f1
2024-06-11 14:36:56 +00:00
drh 34e4c6f732 Improved header comment on the sqlite3FpDecode() implementation.
For the fpdecode() SQL function (available in debug builds only) limit
the value of the third parameter (mxRound) to be positive.

FossilOrigin-Name: 56af06fa12104a1fe119d7087746011183af053834eac72d0fb69f60d98054c6
2024-06-10 12:43:03 +00:00
drh 2fbb3fb532 Disable the omit-noop-join optimization when there are 64 or more terms in
the ORDER BY clause.

FossilOrigin-Name: 40de3939792e17df25598b3e60d1cebcecde2b00832acd55604f14b21398a9a7
2024-06-09 17:34:03 +00:00
drh df9471b1b5 Allow the query planner access to the argument of LIMIT even if that
argument is a bound parameter.

FossilOrigin-Name: c4a9dda2809c6e0e3d928e11e5553ead82cd9df551bcd35b11a7d869ef80ab8e
2024-06-06 23:56:36 +00:00
drh bd1402487b Omit bogus tests accidentally added by the privious commit.
FossilOrigin-Name: e94dfe9928750dd98145d4d9920b298f7b0868703b487f86e0db77a41d53ccf9
2024-06-06 23:22:32 +00:00
drh 4703b7d092 Better optimize queries that use parameters in the LIMIT clause.
FossilOrigin-Name: e58cb304d1e0ec6e30260a165aaccc2cf096ce6c999efb06683c4ef600ee12ef
2024-06-06 15:03:16 +00:00
stephan 404ddadbd4 Re-enable [dcc2bb2c562e97e090174], as [296eeb26c816bc73] corrects the wasi-sdk build problem the former check-in triggered. Reported in [forum:143e40d7f4e79c66|forum post 143e40d7f4e79c66].
FossilOrigin-Name: f66608bd356efe492d1003663c2e1ccd7cfbf2d40393d256f8720149904ad2d5
2024-06-06 12:22:19 +00:00