Commit Graph

31319 Commits

Author SHA1 Message Date
drh
7e21205a93 The sqlite3Atoi64() function runs a little faster here, but probably
not enough to justify the extra complication.

FossilOrigin-Name: ae5616ca9791c47538e41b1148e215f2e38fb5f71a821c828c0cb150bcda123e
2026-02-16 20:41:13 +00:00
drh
6315919ba8 Fix a bad assert() in the previous check-in.
FossilOrigin-Name: a4540582b5b704af13b570b3dc609dbacada719302372a038cf74eee3688d5e7
2026-02-16 17:22:17 +00:00
drh
5c977eaa0a Refactor the sqlite3AtoF() routine so that it requires a zero-terminated
UTF-8 input.  When the need arises to convert UTF16 or non-terminated
strings, wrapper functions are used.  Together, this makes the code slightly
smaller and faster.

FossilOrigin-Name: 67c7c72e9bdf04c920d77006538a202c923fa74b47c81dc3014c2929dac7277d
2026-02-16 16:56:59 +00:00
dan
7b93f1a387 Fix a problem with identifying ON clauses attached to RIGHT or FULL JOINs (which is an error) if the join appeared in a flattened sub-query.
FossilOrigin-Name: cf2dc6dfad275dad8fef763a57baaaf6301b0d3bf1916be90f22200cbe0115d0
2026-02-16 11:59:14 +00:00
drh
c47bc0ffca Performance improvement in floating-point conversions.
FossilOrigin-Name: b5ebbd004183f81902fa79a143222204b33dbe1cacb918194556b8dac67bd567
2026-02-16 11:14:59 +00:00
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
990d861038 Add new assert() statements to demonstrate that the complaint given in
[forum:/forumpost/56ad8b632c|forum post 56ad8b632c] is not a real bug.

FossilOrigin-Name: d62999907d5f5987fe0030e1a4a7144c898e55595ac116eec966741a5099322b
2026-02-13 16:02:27 +00:00
drh
23e57bc7cd Use only a single bit, rather than a whole byte, to store infrequently
accessed boolean values in the Parse object.

FossilOrigin-Name: e1bcd7e1cf6d6b1add49deac65e1b64bcae52fbbad094e561846bb92959db76a
2026-02-13 12:20:57 +00:00
drh
7d49eb1dff Add a "const" to avoid a harmless false-positive compiler warning.
FossilOrigin-Name: d44af6cc093ab6b5a196249a84681148bbae3f624abf4bc8cc42c88f3f7320b2
2026-02-13 11:40:28 +00:00
drh
df59c5da78 Respect "const" strings in the sqlite3ShadowTableName() function.
Patch moved to trunk, where it was intended.

FossilOrigin-Name: 51b5afdfac401cbf74af6383d4559439cb6defe2ce23ebcf7ed9a5b526a07b51
2026-02-12 18:15:26 +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