31310 Commits

Author SHA1 Message Date
drh
adbb756155 Avoid the big power-of-ten lookup table.
FossilOrigin-Name: 245ac7d9ec61e14fcef13a731e290fc5e8979efef6f4345f875eab9b882b0713
2026-02-15 18:41:29 +00:00
drh
658908a32f Fix to [9d3a12d3926d55ef] to force the static const string literal to
have two-byte alignment.  Necessary to get that patch to work in Mac-ARM.

FossilOrigin-Name: a80c847169f307a4d2e524b6732ea557bf7f312f1a319d6c6c2e81adb0907596
2026-02-14 22:04:53 +00:00
drh
b3b2695d4b Add the "LLU" suffix to 64-bit integer constants, for portability to older
compilers.

FossilOrigin-Name: 4bf08110662c4b8db9ee90ce34271890a62a469166ea292f7f782b84236531d4
2026-02-14 21:47:08 +00:00
drh
775e4b7073 Fix to the generic version of the 128-bit multiple subroutine.
FossilOrigin-Name: 9c3d09ee75beb26447161c0bf5ea252520a6ec051774f1a4e9f18204281d504f
2026-02-14 21:31:31 +00:00
drh
4bee65dcb9 Another minor performance refinement.
FossilOrigin-Name: 9d3a12d3926d55efffdc84bff342bd1dbccd08426104aeb2d339b064bf6f02f4
2026-02-14 20:48:58 +00:00
drh
4d0611c1eb Minor corrections.
FossilOrigin-Name: 93fdee20021b8cc2a113ea042fedbccd8b53b6aceeeb34c0810e6d3a5f106f07
2026-02-14 19:42:55 +00:00
drh
10fb1e3077 Improved comment. No code changes.
FossilOrigin-Name: c5a4da1bf7af8f8ec4b3273f88b09c01ce90986c8a5ce3d03319bd094706c411
2026-02-14 19:36:41 +00:00
drh
db84cdb747 Use a precomputed table of 696 powers of 10 to improve the performance
of floating-point to decimal and decimal to floating-point conversions.

FossilOrigin-Name: 64d9b7becf2da8927024adda278e837a46837e46af3cff51bd54a183d1716750
2026-02-14 17:58:46 +00:00
drh
643fb6cf4b Minor performance enhancement to floating-point rendering.
FossilOrigin-Name: 38d8c0d8a0b0e9990ba7bdcce979f2824ffee22a083cb788a75917628b1eb559
2026-02-11 19:42:46 +00:00
drh
c652e34317 Correction to date/time computations associated with the timestamp-vfs.
FossilOrigin-Name: b67889e4f17c3280f839ee7045256cc47d6ce3ed60d880925e3d30f9ebbcf3ff
2026-02-10 19:33:11 +00:00
drh
c94f97fac7 Minor tweaks to the star-query optimization in the query planner.
FossilOrigin-Name: 5021e114b251467fee6a39749c88ec581ee1f7d50093b02a44dc300db0c0a1c5
2026-02-10 18:28:41 +00:00
drh
1f9ae1f780 Immediately reset all pending prepared statements on any call to
sqlite3_set_authorizer(), even if the authorizer is being disabled.

FossilOrigin-Name: 5c0468acd1a12f7fd01b9974250fb42c5811939dc2319729a1ef93c073dc0071
2026-02-09 19:58:04 +00:00
dan
612bee531f Do not allow table-function argument expressions on the RHS of an OUTER join to refer to FROM clause elements to their right.
FossilOrigin-Name: 021e48e28931afd781e76db6293e60fd2ffb8377cb1051e8b802f2743a10fa5d
2026-02-09 14:45:17 +00:00
stephan
de702aebb9 Fix a method name typo in test-only code which could hide the triggering error condition.
FossilOrigin-Name: b2c1a4184c3de5a26524906ba04ce6c9c80b27f8d89c40fde7bbc8f5a9f99e34
2026-02-08 12:13:19 +00:00
stephan
e45418c5f5 JS doc touchups.
FossilOrigin-Name: dcd22fd6d135892852358c8cfb5049dce4a1410dbc0f28cafc8b340f69350165
2026-02-08 05:08:30 +00:00
drh
a0857f321c Improved output from calls to sqlite3ShowSrcList() made from a symbolic debugger.
FossilOrigin-Name: 241d23f8d36a0d4d0bcf058c5c1ff6144cfe7dd33460e8d94de5f0daf56aaf50
2026-02-07 13:41:05 +00:00
drh
450a90097f Do a better job of not generating unnecessary Bloom filters associated
with IN operators.

FossilOrigin-Name: 3861df5c127f82becea80c48c547de8ed0d01eebcf6a6a9d7f234dde31f50394
2026-02-05 21:14:34 +00:00
drh
e58c1a987c Fix harmless compiler warning when the CLI is compiled with
SQLITE_OMIT_PROGRESS_CALLBACK.

FossilOrigin-Name: d6150c813ce43e15285a07d24135b10a7c254b3c175dee4f61c3b6a6ce91c29f
2026-02-05 13:03:04 +00:00
drh
d0c4a5853b Display scanstatus results in neat columns.
FossilOrigin-Name: c476d956d0bd3065cf894de6f9d393b999ff7d2268a35f01a6d88804789ab58f
2026-02-04 20:51:27 +00:00
drh
b55d6f3754 Improved output for ".scanstatus est" in the CLI.
FossilOrigin-Name: e6902937ecdbeb449986469859b46631272fb0a9e7e1c31adea14cff072b6d67
2026-02-04 18:10:49 +00:00
drh
c9ccd27045 Improved display of scan-status estimates.
FossilOrigin-Name: 70ef095740c62081090147bb1900c843cb31864e93a8af518ff48855f1175717
2026-02-04 17:52:50 +00:00
drh
5e842d0ece Render scan-status values with 3 or 4 significant digits only, for
improved readability.

FossilOrigin-Name: d9102ff0c43a496e782b0a3ec86ba7cd45f8118a07f15a4f3d58b399466d6cf2
2026-02-04 13:35:32 +00:00
drh
3fab5d2a40 Fix scanstatus output in QRF so that it shows the total number of cycles
on the "QUERY PLAN" line.

FossilOrigin-Name: 611cef0ec281ae06eac97df8048d617fd445c348c2fc1673202b9cc081a365db
2026-02-04 11:51:20 +00:00
drh
761118497a Improve the query planner by reducing the estimated number of output rows
for each stage of a join if there are LIKE, GLOB, REGEXP, or MATCH
constraints on the table where the pattern string is a constant.  The
reduction in the output row estimate is proportional to the length of
the pattern string.

FossilOrigin-Name: 6852843e6aa23051de0884593ce64b96a16f16c4d63b222bd324297581f7cf75
2026-02-03 17:21:59 +00:00
drh
e54142009c Minor change to test/dotcmd01.test so that it works with STAT4.
FossilOrigin-Name: 8aaf5b6b6c3d71789eebd2b8f440dd2fdaad2ef2adc9c7b2b019f08853d0b195
2026-02-03 17:07:28 +00:00
drh
1131eddbf9 Improved comments on this enhancement. No code changes.
FossilOrigin-Name: 510a6738e5d186a74a45fa7385f4722f4e090d85562f259b02c49393ca56860b
2026-02-03 16:29:14 +00:00
drh
3212ab33d4 Refactor the implementation of this enhancement to keep all the code inside
the query planner, not leaking out into SQL function implementations.
Expand the enhancement to cover MATCH and REGEXP operators and overloads
of LIKE and GLOB.

FossilOrigin-Name: 96f8ce225ee863c6dfe0df2d10da27a35407128d7c4691ddb927401465047a6e
2026-02-03 14:00:28 +00:00
drh
49c70b88bc When reducing the truth probability of a LIKE/GLOB constraint, only consider
non-wildcard characters in the pattern.

FossilOrigin-Name: 2ba8fc290dbc80d159a217d745d8bd62371c305443d5aed10bfcf34cc98d3985
2026-02-02 20:54:28 +00:00
drh
77c5456d7f Do not reduce the estimated truth probability of LIKE and GLOB operators
by quite so much.  Fix a single test case whose output changed.

FossilOrigin-Name: fdebbedbd9a99165359761106cdc76d327f74043b22806b7bd96402fbed36f14
2026-02-02 16:03:24 +00:00
drh
5b23d027cf Merge the latest trunk enhancements into the prune-by-like-glob branch.
FossilOrigin-Name: d9d3d3a807710957f35b023ddc89cb80eea529f654ce3aa0f9aafe6c15b3ce88
2026-02-02 14:24:47 +00:00
dan
71848d362d Update session module test code to correctly use Tcl_Size instead of int.
FossilOrigin-Name: 619060c2267a889089bf5328ba83640806688164a096df8582a5cf91b173741d
2026-02-02 11:42:19 +00:00
drh
1ac0d9bbf9 Add the "--timeout SECONDS" option to the ".progress" command in the CLI.
FossilOrigin-Name: 8eb5c88aeb37279f68f5bb0b268339a8f6fb0b927b1e398ac4c83bf42c281273
2026-02-01 21:10:04 +00:00
drh
213262fa53 Enhance the ".timer" command in the CLI to accept the "once" argument, and
so that it leaves its last real-time result in the $TIMER variable.  Also
fix a harmless warning from an earlier check-in.

FossilOrigin-Name: 8ad7dffc261cbb3f7c9b4d38b04282c805c1c047fb431076f85e577c81f21574
2026-02-01 15:58:37 +00:00
drh
5c8cd31246 An experimental query-planner change that reduces the estimated number
of output rows for FROM clause terms that are restricted by a LIKE or
GLOB operator, based on the number of bytes in the pattern.  The idea is
that longer patterns will match fewer records and hence should reduce the
estimated output count.  The implementation is not workable as it stands
now.  This is just a crazy idea, saved for future reference.

FossilOrigin-Name: 97bcb56a208af0687750a6438981bbfe36a8d516d996178e62551d302ef811ee
2026-02-01 00:37:04 +00:00
drh
1d8eb1d9b6 Fix a missed optimization opportunity due to a typo in check-in [898bfa1afd8260ea].
Reported by [forum:/forumpost/2026-01-31T00:49:53z|forum post 2026-01-31T00:49:53z].

FossilOrigin-Name: 3a4f9a323da90611d7eda51b90cb058175ddde0a128e1ff00ce58cc83af0f376
2026-01-31 02:17:55 +00:00
drh
4fd4e8f066 Make CROSS JOIN a join reorder barrier again, as the SQLite documentation says it is. It
mistakenly stopped being a join barrier with check-in [c1ea064948ba08c4].

FossilOrigin-Name: d294106ecb78d765305ab740007f4a678e28baa13ae403fe57ea9cbfc259620f
2026-01-30 17:10:22 +00:00
drh
c79b1f7d6c Fix the new CLI so that the ".eqp" setting does not affect the output of other dot
commands such as .schema or .tables.

FossilOrigin-Name: a5a1b69b3feedb507ecfe2e9ddc039d7c01e1bb54e3e881df5010481886cdef9
2026-01-30 16:03:22 +00:00
drh
4b4df2ee1e Change the new escape-character mechanism for CSV import so that there are
separate options for an escape character for quoted and unquoted fields of
the CSV.

FossilOrigin-Name: 293ec20e29e46d822a98302f8a0ba52ad6f74a7e93f780536d393730c2edbf61
2026-01-30 13:11:20 +00:00
drh
1d1cd36428 Undo the previous check-in. In its place, add the --escape option to
the ".import" command.

FossilOrigin-Name: f11a05d52a1eb933f394d48c0d4ee0353f07ad725b7378c40afd01632e67f72d
2026-01-30 12:27:13 +00:00
drh
a5cc01681e Enhance the CSV import capability in the CLI so that it understands
backslash-escaped double-quotes.

FossilOrigin-Name: 7ba0594d3c24531bc014dd029093b0503118a29cfdd13af2a2ebdd456855ce94
2026-01-30 12:15:25 +00:00
stephan
561e28b75b kvvfs fix for [https://github.com/sqlite/sqlite-wasm/issues/146|npm ticket #146]: use of a test-mode-only symbol in non-test runs leads to a null deref in xFileControl().
FossilOrigin-Name: 407724c4e80efdf93d885e95b5209a100a3f470fe0298138be57201f65f9817e
2026-01-30 06:37:34 +00:00
stephan
bfb33d476b Capture sqlite3_rsync's remote-end result code so the local side can exit with non-0 if, e.g., the remote sqlite3_rsync binary is found but fails to start. [forum:43eb1cd1c3979817|Confirmation received] that it resolves the motivating problem report.
FossilOrigin-Name: 971d51374e3bf0d0e0b106750dc1e499d1fdbd3233cf8264a534138b27f8d0a1
2026-01-28 17:25:18 +00:00
drh
fabd481c76 Improved (faster) bytecode for the merge algorithm.
FossilOrigin-Name: 0b7f4b97e68f17ae2fec86017cdb170f3b318a71cda34b5c82ec2d9df780564f
2026-01-28 16:59:34 +00:00
dan
2c49785000 Add a comment to sqlite3Stat4Value() explaining that it read a few bytes past the end of the specified buffer.
FossilOrigin-Name: b95644eafdd42293096a3760af8b2110f3c7d83feecdeff5ff9f008d9748e874
2026-01-28 10:52:53 +00:00
drh
60229c2971 Avoid unsigned integer overflow when evaluating an array index in a
JSON path expression.
[forum:/forumpost/2026-01-27T14:18:49z|Forum post 2026-01-27T14:18:49z].

FossilOrigin-Name: 631c8d44cd1624ddc45babd3f0d810908c2a368784744262042c63506ff2e333
2026-01-27 23:33:42 +00:00
drh
836231691e Improved byte-code coverage testing verification in the merge algorithm.
FossilOrigin-Name: e49ec0e24b4765a6a819f3e980b680b9604f6db21aa8112ec4e9b54d82220c00
2026-01-27 22:27:14 +00:00
drh
c4e7964fd6 The tmstmpvfs.c extension should not modify the content of pages going into
the WAL file, as that would corrupt the page checksum used for recovery.
Instead, only insert timestamp information as content is written into the
database file.

FossilOrigin-Name: dabaeeb1dab82eaea2449658b9c4c74af0058e5a64a076dab046902c6efac292
2026-01-27 16:18:35 +00:00
stephan
f5d29d6424 Teach sqlite3_rsync to increment its error count when a child process fails, based on [forum:8fe404e547faa42e|forum post 8fe404e547faa42e]. This passes basic sanity tests but requires more testing and needs a review of the final 'else' block in the new code.
FossilOrigin-Name: 8be55d405f4ce424760150a2b59b5f663041fdcb377d1b9893b4f4e8e1940246
2026-01-27 16:15:22 +00:00
drh
b4142c491e For CSV import in the CLI, when the table is created automatically
because it does not previously exist, make the column types "ANY"
instead of "TEXT" so that they will automatically adjust to different
datatypes in the input text.

FossilOrigin-Name: aff74e71ea734e1ad8fa893652885fd8c6c432fb60e92913a799e6df5e980b47
2026-01-27 14:59:08 +00:00
drh
a943c0e973 Add the --csv option to the showtmlog utility program.
FossilOrigin-Name: 2e96e8efa9a331b0f7d928c55e7d85be64e7c60c85032c1e972f77fe790bdec4
2026-01-27 14:27:19 +00:00