Commit Graph

5801 Commits

Author SHA1 Message Date
drh
c8d866294b Add the .dbstat command to the CLI.
FossilOrigin-Name: fdba76df2b3a5b4d56ba79f80fd8b16d5faebca1fb07a266262be2ea635e6f94
2026-04-15 11:41:50 +00:00
drh
9efde40a5d Compute the average fanout for b-trees of depth 2 or more.
FossilOrigin-Name: 2f8598bb09f32100f22dd1d9465f3fa0f7f8d81f5d67c34de9919708345f090b
2026-04-15 10:49:14 +00:00
drh
09f37099a7 Code simplifications. Return NULL is the specified SCHEMA does not exist.
FossilOrigin-Name: 953969c88149ea2f589942b98a0a96d907956319e5aa09e2d5a3ae76d3e7d70a
2026-04-14 23:19:02 +00:00
drh
526acc1834 Merge trunk enhancements and fixes into the analyze-sql-func branch.
FossilOrigin-Name: bb4a9beac87796b4186efce416bf03f840041bc588be6702c5a444d643df684e
2026-04-14 20:17:03 +00:00
drh
d962afef2d Various minor tweaks and refinements to the analyze() function.
FossilOrigin-Name: 48d94e72eaec443011dd1f7a7264e5222c05bb515c84deaf20ed4195b74d45ff
2026-04-14 20:07:29 +00:00
drh
395ac6c1bc Implementation of the analyze() SQL function is now mostly complete.
FossilOrigin-Name: 1ca0386ab2df0d88ed52941469d459114f483ecf6b7e4691bcc32e909636cb7d
2026-04-14 19:36:33 +00:00
drh
e9d0bc6b68 Much, but not all, of the report generation is added. An incremental check-in.
FossilOrigin-Name: 289fefc3edfeecb06dc11897d3ff24763fd9e25db44e369eeec29b9ed3de5ccc
2026-04-14 19:02:40 +00:00
dan
ab6a63ec67 In RBU vacuum commands, do as SQLite does and ignore any trailing SQL statements in the sql column of the sqlite_schema table.
FossilOrigin-Name: cf7dad1b105ab35cd7180efec735b7cbeaf42b8d53dfec5582b63cd121c3425c
2026-04-14 18:08:30 +00:00
drh
34c2c8dc47 Further fixes and clarifications. Now ready to start generating the
actual report.

FossilOrigin-Name: 037a0e586c4aa81a53aea164080e739f9d5b87197d04fdd68feb0ab5eb01020b
2026-04-14 13:18:04 +00:00
drh
3f9df1f5fb Further improvements to error messages and robustness.
FossilOrigin-Name: 45917c1124310fd77daca47865959d3261154f7b0c6771d3689e6d345a3fd153
2026-04-14 12:46:12 +00:00
drh
2eeac123c8 Improved error messages and robustness.
FossilOrigin-Name: c09ed9eb914bde96cdc5157e29b6384ce488262a2dadc7321c44941a1d08a187
2026-04-14 12:23:11 +00:00
drh
64a123a216 Initial prototype implementation of a new run-time loadable SQL function
to do approximately the same work as sqlite3_analyze.

FossilOrigin-Name: 03934b5a6c88a97117a4743a68ee36d30bcbdcebcf11342d30ac42daf9f10874
2026-04-14 11:25:22 +00:00
stephan
6142310e08 When fiddle terminal mode is enabled, add a link to the jquery.terminal project in the About box.
FossilOrigin-Name: d64f0c8845104008d6c251f9a1406c6ff717a916c13b64014aa1d154501d5fab
2026-04-11 20:43:49 +00:00
stephan
57cf5c2dfc fiddle: disable jquery.terminal's pre-processing of user input, as discussed in [forum:c6665017c0dbba1f|forum post c6665017c0dbba1f], with many thanks to the jquery.terminal team for this workaround.
FossilOrigin-Name: ea7e121ab2a7b2fee5372ca12a2a53c7e98ffa1b49d85944f7ce4a7251a777c8
2026-04-11 20:31:03 +00:00
drh
a212476ad2 Improvements to the interactive prompt in the CLI:
(1) CLI honors SQLITE_PS1 and SQLITE_PS2 envvars as prompt strings,
(2) CLI prompt strings expand various backslash escapes,
(3) No arbitrary length limits on CLI prompt strings,
(4) New default prompt shows the database filename using the \f
escape,
(5) SQLite core adds the sqlite3_incomplate() API, used by
the \H escape in prompt string rendering,
(6) Enhancements to the ".prompt" dot-command.

FossilOrigin-Name: 55af98054e073d6eee3e85fd7564c83eca935ae205da68f5e8f1b561e7f08c00
2026-04-11 18:38:54 +00:00
stephan
7a0a0a22e7 Ensure that sqlite3-opfs-async-proxy.js is copied into the fiddle target dirs.
FossilOrigin-Name: 149200861e4690dab5f2e690b62f355b13a8370dccaab5546caa6842b4ff963a
2026-04-10 23:31:29 +00:00
stephan
504cfd5ec7 Ensure that sqlite3-opfs-async-proxy.js is copied into the fiddle target dirs.
FossilOrigin-Name: 7c9998de1b839cfbe12c4328ac5176f5fae981e139c5f8888b100752f5e4756b
2026-04-10 23:25:57 +00:00
stephan
9d950aa13b A protype of .prompt support in fiddle but its utility there is in doubt because .open does not work there, so there's very little dynamic info worth showing in a prompt. Also, ANSI colorization can't work there, nor can we colorize the prompts using HTML because of limitations in jquery.terminal.
FossilOrigin-Name: 3b17500dc6338df23d1ed0572cd71593da5a9b048731f73242e27b9a76553a27
2026-04-10 23:05:41 +00:00
stephan
b709ba8108 Expose the main /fiddle object to the browser dev console as globalThis.fiddle for experimenting with a dynamic prompt.
FossilOrigin-Name: 8574e5c9da3b167384faafb8ec0d01953578676cc42536bb6f7d0e73408ced36
2026-04-10 21:58:13 +00:00
drh
92c435cda7 Improve defenses in QRF against trying to run the same prepared statement
twice, concurrently.

FossilOrigin-Name: 6ab6f622be3e1ad93166d139b5fccf9628c86d1c14c6dfb4464cb8cf52c94785
2026-04-10 18:14:33 +00:00
stephan
35f8abcfd0 API doc correction for sqlite3_js_retry_busy(). No code changes.
FossilOrigin-Name: 749c537812b907164b7e7ad1fddc1aee8106c59875d2686fe83d602cd0e07611
2026-04-10 17:55:31 +00:00
dan
535b1f2875 Fix some buffer overreads that might occur in the session module when handling corrupt changesets.
FossilOrigin-Name: 8fcf92e15d87487703afc1129f3a89a8d4d72cb30d30a1a9151a5596473069bd
2026-04-09 05:33:19 +00:00
stephan
0d979c217f Fix a few doc typos and inconsistencies. No code changes.
FossilOrigin-Name: 025abd4cf409fb9938e116289f23dc5bcd6d14feb46066221e691b146ee9b354
2026-04-07 15:54:35 +00:00
drh
606c64a543 Fix redundant typedef in qrf.c when that file is amalgamated into
tclsqlite3.c.

FossilOrigin-Name: b8f0c71b48953cb6d5a8b3d33d004a31b63c59d59d455f285bf8fa91c3b07129
2026-04-07 11:31:41 +00:00
stephan
eefe3aa9ad Replace a doc reference to a renamed file, as reported by [forum:5d9d70c618|forum post 5d9d70c618]. No code changes.
FossilOrigin-Name: c8121593fa455cd43b3878f8b65ebac47c07dab4b8ce081aa34b14fc9440afbc
2026-04-07 09:15:21 +00:00
stephan
d4b74b9fac Add some comments to the OPFS async proxy about potential future experimentation. No code changes.
FossilOrigin-Name: 9c14ee74305a5db3be95dbd9ae8d1db0abf39b323001be4e2f02b7226e6ca0d3
2026-04-04 08:07:25 +00:00
drh
217c590688 Fix Tcl9 compatibility issues in test_session.c.
FossilOrigin-Name: 1387b5819085146cafb0e8740410faaa48bfb5aefc78ff763aaa8e85744d48b3
2026-04-03 11:48:00 +00:00
dan
62f3150204 Fix a potential 4-byte overread in the sessions module when processing a corrupt changeset.
FossilOrigin-Name: c1c7e024c34da8eb0258ce552f3f81921280ccf0f1fea59374f381c0c7b43b74
2026-04-01 17:43:22 +00:00
drh
34e139d3a3 Always use sqlite3_malloc64() in extensions, where possible.
FossilOrigin-Name: 6194f3b5314ef98b5d73060450de8e3497272494b47e6f96992453418894ded1
2026-04-01 16:56:48 +00:00
dan
6e6598c8ff Fix a problem in the sessions module allowing a NULL pointer to be passed to memcpy().
FossilOrigin-Name: 91ead3c62dd7b1db3fdfd318e3c35a42fb33e8fa2e347b682eecbff2f4e8677b
2026-04-01 16:11:47 +00:00
stephan
eb8edc0bac Doc cleanups in opfs-wl. No code changes.
FossilOrigin-Name: 009b576dcd5fccaaa52459dbfaa1b2a6fcf6d372e4b8d63553dfa88aab9a759c
2026-04-01 11:39:13 +00:00
drh
d6226a9c27 Add appropriate headers to ext/session/sqlite3session.h so that the
documentation generator will pick up the API documentation for the
new one-at-a-time changegroup APIs.

FossilOrigin-Name: da514f10b7804fd0affaf0fd4b8089012288ba99c165ef4ab78ab28edd331211
2026-03-31 18:49:23 +00:00
dan
5e4fb95edf Update this branch with changes from trunk.
FossilOrigin-Name: 716e62e3d1d6ff96f6e4906175818439103e9534e89bec4a86776265a04954b9
2026-03-31 10:52:00 +00:00
stephan
a217a4af09 Require a button click to start the OPFS concurrency tester, rather than simply launching all N workers immediately on page load.
FossilOrigin-Name: 3342d6786e07d3d8dd4b1f2291edea9f8354d384ff21242cc513c218ce6f1630
2026-03-23 13:17:13 +00:00
drh
3c1f727603 Because version 3.52.0 was withdrawn, that means QRF has never been
officially released.  Hence the new nMultiInsert field of the spec
can be moved out of the extensions area and into the main part of the
spec, and the version number can drop back from 2 to 1.

FossilOrigin-Name: cf19982241afb17e3db4148b8257f6737141935a291c340ab085c42ed946af1a
2026-03-21 19:49:38 +00:00
drh
f62cff6a9e Fix harmless compiler warnings in the csv.c.
FossilOrigin-Name: 6ac701f89e2ac8dfd18d041eb8c36a0c2b9fedc5618d3a95be794aecce5c59cf
2026-03-20 20:35:21 +00:00
dan
0cb7603d4c Update fts5 scan costs to take into account that a prefix query combined with a rowid equality constraint is still quite expensive.
FossilOrigin-Name: 539769b63e4044018be2993894b1962df6a6ae58636682b7fb7a2dd5aaf4075c
2026-03-19 17:56:10 +00:00
drh
08eb5e9e51 Continue enforcing the legacy declaration-before-statement C-language rule,
since some downstream still uses it.

FossilOrigin-Name: 5c237f1f863a32cf229010d2024d0d1e76a07a4d8b9492b26503b959f1c32485
2026-03-18 22:31:56 +00:00
drh
ccf2babd42 Fix an assertion fault that could occur in RTree when given a corrupt
database.

FossilOrigin-Name: ed29fe973e6cbf291eff6fc582aeb34556ea4f8df105ec61b361e4cdda017e62
2026-03-17 12:07:49 +00:00
stephan
9e572064f3 Replace several comment-based switch-fall-through notices with attribute based ones, as suggested in [forum:b6ab8dc547|forum post b6ab8dc547].
FossilOrigin-Name: 2b0209a3bd3fb19af424386dcd13ff49a0c86edfd5d283fd5e5c42c266872100
2026-03-11 15:17:14 +00:00
drh
169f68ed88 Improved defenses against mischief.
FossilOrigin-Name: 8bdc0d485e3ad0c7a1e818da66f106951d496b05cbe61d12c2c448f2f24b6d5d
2026-03-11 14:43:29 +00:00
drh
c739d13217 Fix harmless compiler warnings.
FossilOrigin-Name: d7b4a4a3d3d6296a012cc14fc2d95fe810b5bdb625209a2d28bf2c7a026749bf
2026-03-10 22:43:39 +00:00
drh
abc82c49c2 Revamp the QRF insert-mode optimization of [659ff6ab55802507]. The
control value is now nMultiInsert.  Multiple rows are added to each INSERT
statement until the number of bytes in that statement exceeds the
nMultiInsert value.  The CLI uses a default value of 3000, which provides
a good balance between speed and prepare-statement size.  The output
from ".dump" now loads nearly 2x faster in some cases.

FossilOrigin-Name: 55b0ce9f93d68b17a18423f0f751b778573127743a2bac67abfea074ac32d41a
2026-03-10 18:13:13 +00:00
drh
efa8633fd8 Enhance QRF with the mxTuple field, which if greater than 1 causes the
QRF_STYLE_Insert style to group as many as mxTuple adjacent rows into
a single INSERT statement.  The field is accessible using the -mxtuple
option in the TCL interface, and the --mxtuple option in ".mode".  The
output of the ".dump" and ".fullschema" commands responds to the current
--mxtuple setting.

FossilOrigin-Name: 659ff6ab5580250707908af003ecd093bd5313f03f21f0efd000a7aff6638b3c
2026-03-10 14:02:03 +00:00
drh
140cbff0d2 Remove an obsolete pragraph from the header comment on the fileio.c extension.
FossilOrigin-Name: 17613b72f34162ce22864621c519e883930c9f51a0a86afbf30ce664f95d7be1
2026-03-09 14:04:34 +00:00
drh
e795890d7e In QRF, fix line-wrap indentation for "line" mode when using a
non-standard column separator.

FossilOrigin-Name: 00c96cca3de709e40207feb9c10a94e38e7857c9bc01938849c6c5daee7148c7
2026-03-09 13:53:58 +00:00
drh
016a0ebedc Fix the completion.c TVF so that the xNext method reports errors it encounters
while running queries.

FossilOrigin-Name: eebcdcceef8a436e5fb1397cad6eb5bcf0722060fe1cd6acb26cdf1e86f07293
2026-03-08 19:31:40 +00:00
drh
456c7ea715 In the decimal.c extension, set a default MAX_DIGITS to 100 million.
Do not allow integer overflow of the N parameter to the internal
decimal_round() function.

FossilOrigin-Name: d0e23423d1bdd0482db4b74ef0fde2fbc2bbad02a7b92ba45a27ca57f4740e16
2026-03-08 18:50:35 +00:00
stephan
5236bad923 Consolidate the opfs and opfs-wl tester1 tests using the preprocessor.
FossilOrigin-Name: 77846c8c7aa4625729a5e113c12e7d16efc88c1306c01ba36f47240aac450b0f
2026-03-08 17:07:01 +00:00
stephan
46a692c08b Upgrade ext/wasm/c-pp-lite.c to its newer sibling because we've reached the older one's limits. This renames c-pp-lite.c to libcmpp.c to maintain both the SCM- and code lineage but that may end up looking a bit weird because the diff between the two is vast.
FossilOrigin-Name: 2e2339bd9e4293bad04ece7673a3048b99c2143cf9573ade2ec082d95744b981
2026-03-08 16:03:08 +00:00