Commit Graph

19683 Commits

Author SHA1 Message Date
drh
001f36f9af Mark an always-true conditional as such.
FossilOrigin-Name: 4f79434f5b52470291dcd09e31fdefba708d0243a2b60966536c6cb91451d203
2025-12-04 13:28:25 +00:00
drh
3749e75c68 Fix an error introduced by the previous check-in.
FossilOrigin-Name: 948e24ae3816d650be66bbe6b880bea74da643af37c4349e6cf2e207e6cf9b28
2025-12-04 13:08:59 +00:00
drh
fa7abfdf0b Performance optimization in the language grammar.
FossilOrigin-Name: 1c1ad5e39cb379250f10db5ef61f42e0bd56ace308f8e41f9bf5e08d92075521
2025-12-04 11:59:11 +00:00
drh
5ef150c223 Merge all the latest trunk enhancements and fixes into the temp-trigger-refs
branch.

FossilOrigin-Name: 8e8a27c77aa0ea5891968231e13a8caeade48b817419bbf6eda18ad217f1df63
2025-12-04 11:20:01 +00:00
drh
2121fc4141 Fix an incorrect answer that might arise if a scalar query is both
DISTINCT and contains an OFFSET clause.
[forum:/forumpost/2025-12-03T09:25:59Z|Forum post 2025-12-03T09:25:59Z].

FossilOrigin-Name: aef5397569d65d2971367b0278fe3a6f42544cf771572e7d046e2472f052364d
2025-12-04 00:05:49 +00:00
drh
5be3ac87db More aggressive optimization of IS NULL and IS NOT NULL operators.
FossilOrigin-Name: c69eec9909af40e1e22d44a6859ef52378ebe06a587373f332f9d379cb39a84d
2025-12-03 18:18:29 +00:00
drh
1e235b9b02 Create a new internal subroutine specifically designed to allocate
Expr nodes that hold a 32-bit integer.

FossilOrigin-Name: 38d06f69e516dd13becbfb735a2a0035c2f3c50ea5d661a668b109a996656523
2025-12-03 16:54:48 +00:00
dan
ab63da3f1c Fix a problem that could occur when a scalar subquery had both a DISTINCT and OFFSET clause. First reported by [forum:41bd7af485 | forum post 41bd7af485].
FossilOrigin-Name: 496bbff910b73775b16c1ccb95dadf37416d3f3032722a1140f2a9134666d7f1
2025-12-03 14:39:25 +00:00
drh
8686ac40ae Clarification of comment text in expr.c. No changes to code.
FossilOrigin-Name: afe5ee64f1cde4945c878220b029f2a22578c2bccda4fddc005c4e6a4718c6cd
2025-12-03 12:07:35 +00:00
drh
25ca71daac Improvements to the ".schema indent" logic.
[forum:/forumpost/c8136b1bd0|Forum post 2025-12-02T19:04:04Z].

FossilOrigin-Name: 71ea7f38ffd0648c58713d8be5d2f5536f926ec21a0adc3c2a8a9a7ba8ea3826
2025-12-02 19:55:39 +00:00
drh
a0a63a0408 New test cases for QRF
FossilOrigin-Name: e49c63e31888c6787ab13f736d58ff985a24c3f98b475e05c30e8b244afffb80
2025-12-02 18:37:49 +00:00
drh
8df04c3f41 Fix a harmless compiler warning in the previous check-in.
FossilOrigin-Name: 601c40a1d9e1bcd9c453210c275001543d1533af25b4ccf399d5ef4ea1328950
2025-12-02 15:01:29 +00:00
dan
d200379aff Fix a problem with ALTER TABLE DROP COLUMN commands where the column being dropped is the rightmost in table and is immediately preceded by a comment containing a "," character.
FossilOrigin-Name: c872bd1ee7b219e055f40e43766e4ed6bc2d2ca8cb92577cd3560f4173b1f257
2025-12-02 14:43:59 +00:00
dan
7b60ed803b Fix a memory leak that could follow an OOM on this branch.
FossilOrigin-Name: 3223fee0b93bbbe277b955a98c13bb583ded78109f8e601c9ec0a7bd3749fd55
2025-12-01 18:11:08 +00:00
dan
73937f0ca8 Fix another crash on this branch that could follow an OOM.
FossilOrigin-Name: 75c49267ec6b84c8aad0e264c34506e4b24f69475ae5def0ee7530ba3822c15d
2025-12-01 17:39:04 +00:00
dan
928276043b Merge latest trunk changes into this branch.
FossilOrigin-Name: 230fd5533e07ec36f1938f34153c9ef97a7acd6604d023b56dfc5269ca6173c2
2025-12-01 17:22:35 +00:00
dan
ac0f2d5897 Fix a crash that could occur following a parse error on this branch.
FossilOrigin-Name: 951b4533509fae971e252be3ecd3623ac2bdce16220e0ce372e600f728f80f69
2025-12-01 17:22:15 +00:00
drh
ea1020908c Disallow the undocumented -recovery-db option on the ".recover" command
of the CLI when in --safe mode.

FossilOrigin-Name: 65202440874a7fea5aba262e8e78b97c833147d47837a99f301eca968f9a78b1
2025-12-01 11:07:31 +00:00
drh
4ee2e72c58 Improvement implementation of the previous check-in: runs faster.
FossilOrigin-Name: 484d1fd2a240c8fd006e7794936d6678b8db792a8b2b30d2ae5baf5a1b19463a
2025-11-30 17:47:27 +00:00
drh
db2065aca0 Block injection of hyper-oversized SQL inputs into the parser.
FossilOrigin-Name: 42b6dab92464833eeae5fb261ed689e4b632132d7c8e1ea920aeeb5d50091ab7
2025-11-30 17:26:53 +00:00
stephan
9a07531d88 Doc typo fix.
FossilOrigin-Name: a2b53a71e9354260c7fd0ada093cebd56a20a04add12ff2a2d788c386bf8964f
2025-11-30 07:56:40 +00:00
stephan
090acb4ead Add sqlite3_db_handle() to the list of functions which are guaranteed to preserve the current error state, per request in [forum:8e79e8ddd5|forum post 8e79e8ddd5].
FossilOrigin-Name: 78bdc766330c35dbfa8b187854c48c3aff66a9d58796c9c20f3a5701e1ee4351
2025-11-30 07:25:59 +00:00
drh
9c2e031442 Additional defenses against using the ".open" command of the CLI in --safe
mode.

FossilOrigin-Name: eec0b80e53bb54ee05a4903cfb967cc2914cdcc735f1218922a0f9c80399c3e8
2025-11-29 18:59:58 +00:00
drh
91c60a0805 Update the documentation to sqlite3_str_finish(). That function might
not return NULL on an empty string now, if the empty string is created
through the use of sqlite3_str_truncate().

FossilOrigin-Name: b2e980ede581625e37701f54833e5615d31a1b821ddaf52a26798494f847e640
2025-11-29 18:32:25 +00:00
drh
1bc183a935 Fix an assertion fault in sqlite3Dequote() that can occur with
ALTER TABLE DROP CONSTRAINT on a corrupt schema.
dbsqlfuzz 509a778e8a0c21a6448003feb773a1e55ed751e7.  Test case in TH3.

FossilOrigin-Name: 2dc73eb2d215178c448b182ebb227bc4753ad7baf46c8bd58f20a2b22e998726
2025-11-29 12:06:12 +00:00
drh
6fb51919c3 Ensure that the CLI always jumps to the code that frees memory allocations
prior to exiting when it encounters errors on the command line - just so
that fuzzers won't call that memory leak, even though it is not.

FossilOrigin-Name: 50eaf4266f184963e85ad6235fb3410bf4992db8b3dc7c92be23a2f143c12a6b
2025-11-27 12:15:22 +00:00
drh
d98f758f40 Fix an utterly harmless memory leak that occurs when the CLI exits due
to an error in the command-line arguments.

FossilOrigin-Name: 55942e6d582d421187f2806dc93ea931b64dbb4025203540af654f56d1c9bc36
2025-11-27 11:40:40 +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
stephan
12572f73d5 Consistently use IsSpace()/IsDigit() instead of isspace()/isdigit() in shell.c.in to squelch warnings on Cygwin. From Jan Nijtmans.
FossilOrigin-Name: aa9d7365bb8d8a9d44388dc89dea09428d7cea2f9fba482cb56980b51b16b143
2025-11-26 13:24:10 +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
drh
993b38f0f3 Fixes to .mode in the CLI. "qbox" sets the correct null value.
The "--quote on" option sets the null value to NULL.

FossilOrigin-Name: 5454ec46e162247afa178c8532a0fa19eb05897417ac5b3d2a2ed14bfd331a75
2025-11-25 12:16:56 +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
c42259c2bd Fix typos in the help text for ".mode" of the CLI.
FossilOrigin-Name: fddb99c5162ba12a6e3c87e96583d57bae217339b4dd6dc44c3538e738fbf625
2025-11-25 00:21:27 +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
drh
4aadef3370 Add the QRF_BLOB_Size encoding for BLOBs in QRF.
FossilOrigin-Name: bafff695d34202377b937cb4ca9f8a7611ae286d9ab927e6c71faa3cd99496e5
2025-11-24 16:46:08 +00:00
dan
8f11a71722 Avoid an assert() failure caused by processing a CREATE TABLE AS ... command that generates very long column names.
FossilOrigin-Name: 06554a079d6b299986fc5eeb201595fad14f77c0efcf2d65bd2f36bbc325892c
2025-11-24 16:04:07 +00:00
dan
09079ddbc9 Avoid signed integer overflow that may occur in a non-default build when processing a very large CREATE TABLE AS ... statement.
FossilOrigin-Name: b7417497d1fdbf588a8aca8499d27dee560d728a1eafbf44b34fe3b119423d98
2025-11-24 15:40:10 +00:00
drh
10dd61fd91 Show just the list of available modes and omit the current mode display
for the ".mode --list" command in the CLI.

FossilOrigin-Name: b9b2761fe79d9cc52365eef6bc34c7442972c5410517ff69926397cc7974ae33
2025-11-24 13:26:06 +00:00
drh
69537bdef6 In the CLI on the ".mode" command, replace the recently added --no-limits option with
"--limits L,C".  And add --sw as an alias for --screenwidth.

FossilOrigin-Name: cff0978587a4193b57b0384a587bf89174be2fd91cff4d40130babef1dc8431e
2025-11-24 13:24:58 +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
c4190338c5 Add "split" mode in the CLI. Fix CLI commands given on the command line
so that they honor --once in prior commands.

FossilOrigin-Name: 2530f04d1bb02b800fda83544f5b5dcd42f52b3e56ad625cd03b40e42f24ac6b
2025-11-22 23:34:53 +00:00
drh
eeb38d3665 Add the --no-limits option to the .mode command in the CLI.
FossilOrigin-Name: 3cee168e8801481f6d909fb5d20a773b9c6ca0b8daedfc301c9d762a17f9d839
2025-11-22 21:47:48 +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
drh
494811810c Ignore semicolons at the end of dot-commands, if the compatibility date is
20251115 or later.
[forum:/forumpost/72d084ed552|Forum thread 2025-10-09T21:12:32z]

FossilOrigin-Name: 7a9e753e977ff61ceee50c4e0e5f9b1fc179e91acd9ac88378c888b3e45ebe3a
2025-11-22 16:43:52 +00:00
drh
f4197be567 Implementation of bWrapSnglCol in QRF.
FossilOrigin-Name: 4bbd3f7ead50c0babd7843f58972e2e1762a84866cc4ed88a2a74375b13da11c
2025-11-22 00:38:17 +00:00
drh
5b19de37b6 Fix typo in the implementation of the ".schema" command of the CLI for the
case when there are ATTACH-ed databases.

FossilOrigin-Name: 8a230e4da230a7b103749b069a99a58e4c220873c2f9576abdc928c3538d70b3
2025-11-21 17:30:44 +00:00
drh
873cd21ec3 Enhance ALTER TABLE to support adding and removing NOT NULL and CHECK
constraints.

FossilOrigin-Name: 895498e4431e02cff65a5d96db22f0b0cb9c96aedf1e3cdcdeb3c34c6fec432b
2025-11-21 14:15:56 +00:00
drh
980580efec Preserve auto-explain mode across mode changes, as has always been the
case before.

FossilOrigin-Name: 8896185ae0b0af8918aa8ce449f18759e6ae60358afbac1019397bae307b15d5
2025-11-20 21:08:46 +00:00
drh
a68046e79d Fix hwtime.h (broken by [305bb022368bac9f]) so that unamalgamated windows
builds work again.

FossilOrigin-Name: 1245319257d03a00eddbc8ff4b43b5813f8a567a12a9957f923bef58c85c0c20
2025-11-20 12:41:26 +00:00
drh
3df99c4861 Use sqlite3MPrintf() instead of sqlite3_mprintf() internally in alter.c,
for improved OOM reporting.

FossilOrigin-Name: 57555d75daa2ee8345f8329749841a322b3e57679e5c4899ef749c8bc814812d
2025-11-20 11:06:58 +00:00