5522 Commits

Author SHA1 Message Date
drh
a0a63a0408 New test cases for QRF
FossilOrigin-Name: e49c63e31888c6787ab13f736d58ff985a24c3f98b475e05c30e8b244afffb80
2025-12-02 18:37:49 +00:00
drh
9fb597aed1 Add developer note on how to measure coverage of QRF.
FossilOrigin-Name: 0fdd453c03addb8f5c1e546f7513e3498bccd61266174ce99a61ceebf04e97cf
2025-12-02 12:23:24 +00:00
stephan
4b6e26c29f Fix a potential UAF in sqlite3.oo1.DB.exec()'s teardown pieces.
FossilOrigin-Name: 7e99e93cddeba555836206a278c5dcfd8565cc2a486a83cffab64dad168e9464
2025-12-01 19:19:06 +00:00
drh
a4f0592c5d Tweaks to the wcwidth() algorithm in QRF, for better agreement with
the Terminal on Ubuntu.  There is no perfect solution, as different
ttys do things differently, but we should try to get as close as we
can.

FossilOrigin-Name: 35f39f7cb1030b1a57f2921f50ab600496fc1e774593717845e87f2e47dc49ba
2025-11-30 23:09:24 +00:00
drh
cee98b4ced Handle empty string values in columnar modes without NULL pointer
dereferences.

FossilOrigin-Name: 7927dbc5ebc76233325e45bd24181dbc5c3636e271f9352cf530f41dad6ba66d
2025-11-29 18:18:15 +00:00
stephan
79837b6ee5 Correct a doc falsehood - jquery.terminal does not require pre-building.
FossilOrigin-Name: 4384c9a108b58a0b8c38c51678aad871f088358b9bff3922299cc7ddb3d247ce
2025-11-28 17:56:22 +00:00
stephan
2c881d45dd Fiddle build: if JQTERM is set to the dir name of a built jquery.terminal checkout then copy the pieces fiddle needs to enable that input mode. By default it looks in ~/src/jquery.terminal.
FossilOrigin-Name: 9dd16f8e3b8e181ff138b4061c9dbc116cbc6f85ee867a97cd8af6e9e874c7d1
2025-11-28 17:50:29 +00:00
stephan
961665682b Minor doc updates.
FossilOrigin-Name: 66b0f28958311204270053ef1d5e66c0ad04e3a52f2570c543b6d319d75798fa
2025-11-28 16:23:24 +00:00
dan
8fa43479b3 Fix a problem in the xFilter() method of the fts5_vocab virtual table causing it to omit some result rows in some cases where a virtual cursor is used more than once by SQLite.
FossilOrigin-Name: 6c99e81e6c49c078f1b00952774a7007c60dc1b4ba8a8fc11357efe9c9233212
2025-11-28 11:52:40 +00:00
stephan
f26c99005a Rename c-pp::ARGV to c-pp::argv and remove its use from the license header (where it doesn't get applied).
FossilOrigin-Name: a2e18d299c8fd7360de246fdc3a2f92025bf321e06c5baf6032ba98854733e60
2025-11-28 02:34:08 +00:00
drh
00bca0b6de Ensure that the split-column transformer in QRF correctly
transforms the abNum[] array.

FossilOrigin-Name: ea67d8b001d1be3b0410ca697ff7ddda71c957c8ecb6d76e75133ba39b754623
2025-11-27 11:29:14 +00:00
drh
e5d4e067d8 Fix two harmless compiler warnings in FTS3.
FossilOrigin-Name: fd9158e6359a85c509e29ddbb333e5ee5d20aae5dc38cd14425286e5f3764b06
2025-11-27 01:32:07 +00:00
drh
9fa8f1d6e0 Improvements to the QRF README.md file to help clarify how to use it.
FossilOrigin-Name: ff589e9e0da99e2248bc7a8bff37e1deb7cbdf8285c18467acd89b65c67401d3
2025-11-26 22:58:26 +00:00
drh
95f643c27d Do not omit the beginning and ending margins when setting bBorder to QRF_Off,
except when the margins need to be squeezed to fit.  Those extra margins give
a more pleasing appearance, and also make the output the same as psql.

FossilOrigin-Name: 2892aaeed9f55ad87791491068493c2e530eeff4194d156f16745d185760797c
2025-11-26 21:56:55 +00:00
drh
9286439c4a In QRF, if the horizontal alignment is QRF_ALIGN_Auto, then use right
alignment for numeric values and left alignment for everything else.

FossilOrigin-Name: 5fdedc69b1ac05bcdc40ee30c1473be75d3afe89e031d750c8fc3dcfa9846d5b
2025-11-26 17:23:11 +00:00
drh
80c1010f88 Add the bBorder option to the QRF spec. Reflect this in the -border
option on the TCL format method, and the --border option to ".mode"
in the CLI.  Also add the "psql" mode to the CLI.

FossilOrigin-Name: 02cbeb69884cd884d9b1b5f59c4168a3dc24b1a5aecc6967586c0be350b10574
2025-11-26 16:21:56 +00:00
dan
d2c7e6925c Fix a buffer overread in fts5 that might occur while processing a corrupt db.
FossilOrigin-Name: 8b0cbc18be3c6f2501b102757af6be98c48044a296104cca7bce822ac2304515
2025-11-26 13:58:53 +00:00
drh
ecd330f59d Fix the sha1() extension function so that it returns actual TEXT instead
of a BLOB containing the UTF-8 TEXT.
[forum:/forumpost/d15eefea7c|Forum post d15eefea7c]

FossilOrigin-Name: 6f806656a3f5ce9a79b18be057d880faca506f66cd4de4b5d77393c266cfb6d2
2025-11-26 11:19:11 +00:00
stephan
6003505a39 Cherry-pick JS fixes/cleanups/docs from [206275292217], [256c1dd2c367], and [dec0c6073cc1] from the kvvfs-v2 branch into trunk.
FossilOrigin-Name: cdd3e700f59e5c30241cd5c6d9ea31f6a5f1c7130c6341b4e0b6dc32b06f3c79
2025-11-25 19:29:23 +00:00
stephan
f37923e723 Guard access to a piece of Emscripten-related scaffolding so that sqlite3-api.js does not hit it when imported into other builds. Reported in [forum:6eacbb9c447a5665|forum post 6eacbb9c447a5665].
FossilOrigin-Name: cb9cf028fcefa8ec51415b5dac886c2443b2ed207fa388dbc3d725dcc85fe092
2025-11-25 19:20:15 +00:00
drh
6ef15842cd Fix subtle inaccuracies in qrfWrapLine(). Omit an unused variable from shell.c.in.
FossilOrigin-Name: 5804ba4874cc41b11e8bb559d5533283c2895d2b13316830955663575567f911
2025-11-25 18:20:33 +00:00
dan
0e2d839f0e Fix a typo in fts3/4 debugging code allowing 'maxpendinXY' to act as a synonym for 'maxpending=' in special INSERT statements.
FossilOrigin-Name: 5af554337af3052a5fd734c05883700dd42d140d99d41154b60e1a0f559e5023
2025-11-25 15:11:34 +00:00
drh
011c261472 Work around an incorrect compiler warning on Mac.
FossilOrigin-Name: d4c1d3e30b774802a7abd5f61807a690fb5be7617459f3dbd7ec1efceb6125d7
2025-11-25 13:58:36 +00:00
drh
b24048ddce Omit the unused bTextNull flag from the QRF spec object.
FossilOrigin-Name: 4bbf176a87b1bedcce0359b70bbf6831a1e458d48c91dcba49f5e00bb38ecaa1
2025-11-25 10:53:39 +00:00
drh
94b621a15a Add the --blob-quote option to the ".mode" command in the CLI.
FossilOrigin-Name: 76a986b10d284b25915a07b7150ef1b85f4ef7d48d4e5315b13e7d1532cb97f1
2025-11-24 18:31:13 +00:00
dan
e77e6bd0a0 Change some 32-bit integers in fts3_write.c to 64-bit to reduce the chances of integer overflow.
FossilOrigin-Name: 8f8a7224c1e0173764757d5022de60abec3babdc3d4131632805e0b04d1a65bf
2025-11-24 17:44:17 +00:00
drh
4aadef3370 Add the QRF_BLOB_Size encoding for BLOBs in QRF.
FossilOrigin-Name: bafff695d34202377b937cb4ca9f8a7611ae286d9ab927e6c71faa3cd99496e5
2025-11-24 16:46:08 +00:00
stephan
9101b90159 Add the long-missing sqlite3_next_stmt() binding to JS/WASM.
FossilOrigin-Name: de27d2d3f2353309227b4d5f77eff76c108c094b61ac59f5a769229a084f2567
2025-11-23 22:18:26 +00:00
drh
58a4e08e3d In QRF in bSplitColumn mode, increase the spacing between columns to be as
wide as five, for improved legibility, if screen width allows.

FossilOrigin-Name: 673648cc812e1549c2b3e7749306e7395d0b7e396a7d5ac432948eb3a6c3713f
2025-11-23 00:45:47 +00:00
drh
d0056d4234 Use the new "split" mode to simplify and improve the implementation of
the ".tables" and ".indexes" commands in the CLI.  Fix a bug in QRF
that this new implementation found.

FossilOrigin-Name: b73df612b621699cd58de6ef327fefdeb8f52eb620f0d2df00d38ff6608a8dd5
2025-11-23 00:10:06 +00:00
drh
946857cfee In QRF, change the name of the bWrapSnglCol flag to bSplitColumn.
Similar changes to the TCL interface.

FossilOrigin-Name: 76512b3b80fdcaae22340cde0b69857e2a4d7e86a63c6759465bd8a0bcbf82bc
2025-11-22 21:34:33 +00:00
stephan
2fcc13f8c9 Cherrypick [0b53be562f1e] into trunk.
FossilOrigin-Name: e86e5723d778721b10c1c908545c56233d4d5549a7ca3b7cf8ca649c70450add
2025-11-22 19:29:23 +00:00
stephan
c7d155aa5d Cherrypick [e0b33b51229a] for the latest wasmutil/jaccwabyt - all tests are happy. Fix a make deps bug which can break parallel builds involving fiddle.
FossilOrigin-Name: 0be777bd6cc6c6b4f52d948cdba7e9c30ad062a35c659512b3f3f89f53aaba25
2025-11-22 15:49:45 +00:00
drh
f4197be567 Implementation of bWrapSnglCol in QRF.
FossilOrigin-Name: 4bbd3f7ead50c0babd7843f58972e2e1762a84866cc4ed88a2a74375b13da11c
2025-11-22 00:38:17 +00:00
drh
081a877211 Add the bWrapSnglCol flag to the QRF spec, though it is not yet documented
and does not yet work.  Fix column output so that it omits trailing space.

FossilOrigin-Name: a858027fc92727c680b7e984303df7f9e0a2d90c860c547176f290b113a69390
2025-11-21 20:10:12 +00:00
drh
a5e454d11c Need a double-underscore prefix on the cplusplus macro
FossilOrigin-Name: 04394387e626cd99ff98df978c4b7f2d32f65760e0c26e53f1ef4f59e4e91a4f
2025-11-21 19:47:13 +00:00
drh
725e6836d0 Fix the qrf.h header so that it is usable from C++
FossilOrigin-Name: 1105b710934cf4a243c64d37dd147bc9378c0f7aa55a99891b7ac6e8f8f17f88
2025-11-21 19:01:26 +00:00
stephan
794a9b48ac Add new file missing from [3c4061428544].
FossilOrigin-Name: 41f94eca01d8317364aa60ddd8e5fe3cd21a215040ef271a157d450a914139d0
2025-11-21 15:03:38 +00:00
drh
ac16642cc4 Fix the QRF so that it omits the closing text from styles "json" and "jobject"
when the result set it empty.

FossilOrigin-Name: e1ba175124be83da4db6d5d4e583b9b3b7dcb82e983c6f185d590469dcdc3139
2025-11-21 11:00:29 +00:00
stephan
40ce52a4e5 Move the JS pieces of kvvfs into their own file to facilitate pending feature experimentation.
FossilOrigin-Name: 3c40614285449df259a3444e36f888cfb5e782ea58287914f97f496ea61e9e9f
2025-11-21 10:49:32 +00:00
stephan
6d62ed4f87 Remove an extraneous loop level from the JS bootstrapping bits.
FossilOrigin-Name: 86817b4e9f011d296fb420be95269fecb54fb48a220bce84020e3af2d2c164a4
2025-11-20 12:14:03 +00:00
stephan
df3fca8da4 Enable the SQLITE_EXPERIMENTAL_PRAGMA_20251114 in the WASM builds for the sake of VFS experimentors. The links in the comments describe what that does.
FossilOrigin-Name: aaa55a3ebf8e725443030be5f31ac7fc0766c1f3c771ce69852f31e7e6f165b9
2025-11-20 12:12:55 +00:00
drh
f639befec8 New subcomponent, the Query Result Formatter (QRF), that formats query
results for display to humans on a fixed-width font terminal.  Rework the
CLI to make use of the QRF.  Renovate the .mode command of the CLI.  Also
incorporate the QRF into the TCL interface as the "format" method.

FossilOrigin-Name: 7e460ffa5aae884807db9e7c8214d6d822d5d38ea406fe3b3eac04ac16f158fa
2025-11-18 17:49:48 +00:00
stephan
847d2ed685 Add api.oo1=0 flag to ext/wasm/GNUmakefile to strip out the sqlite3.oo1 pieces from the build. Part of the ongoing response to [forum:4b7d45433731d2e0|forum post 4b7d45433731d2e0].
FossilOrigin-Name: ea48567ac54e4949a8b68977a58a5de7946e074ae8737133071d02f40ac97f34
2025-11-17 23:55:41 +00:00
drh
53794ab541 The -textjsonb option is on by default in the standard non-batch mode of
the CLI.  New fast screening test for JSONB.

FossilOrigin-Name: fd09f934d64ec07fd56f1b80ab05dafb28b605d5802ff5758eea17d8ad24e3cc
2025-11-17 18:51:55 +00:00
drh
234d2e51ac CLI comes up in legacy "list" mode if neither stdin or stdout are a tty, or
if "--compat 20251114" or earlier is specified, or if "--batch" is used.
New modes "batch" and "tty" select either legacy "list" mode or the newer
"qbox" mode with limits.
Make CVS output compatible with legacy.  Break out ".import" into a separate
subroutine in anticipation of forthcoming improvements.  General code
cleanup.

FossilOrigin-Name: f6bfcea9a01493af182e9aa0d35df6f81bf9e36220df79139afa287fa43d9aa3
2025-11-17 16:44:13 +00:00
drh
02268693c3 Fix test cases impacted by the use of ~/.sqliterc
FossilOrigin-Name: 8fc05faef91186429c6c710991fd736b1df9a9af946c29d207db2518d6436b38
2025-11-17 00:15:14 +00:00
stephan
3e2ecc390b Remove an unused struct.
FossilOrigin-Name: 93dd0e62b74a0d99803f680f23953e9fa2429074505ba402ca5ed4610ddef8fb
2025-11-15 16:06:03 +00:00
stephan
a1dede1e58 JNI: when validing the eTextRep argument in sqlite3_create_function(), only validate the lower four bits (the high bits are for other flags). Add flags to test functions to ensure this case is triggered.
FossilOrigin-Name: aab640be7bc5829fe16d2582b13f942b7debb271c150ca2471561de6b2d70dc7
2025-11-15 15:30:45 +00:00
drh
dd3b30ec85 Columnar modes respond to nScreenWidth.
FossilOrigin-Name: 60d26ebb4d91cc885b6b938ef2fc2864ebbf5a18d2e456521ee2f4aa3b22eddf
2025-11-15 15:18:41 +00:00