1
0
mirror of https://github.com/sqlite/sqlite.git synced 2026-10-23 21:49:02 +03:00
Commit Graph

10441 Commits

Author SHA1 Message Date
drh
8782e0b5be Improve comments. Move a variable outside of a loop.
FossilOrigin-Name: f26831158e28a46805466da71b3fc04e19c2199545cc8c5d68281867f8110ef3
2026-07-29 21:09:37 +00:00
dan
817458fe70 Avoid assuming that cursor numbers were allocated in order for all SrcList objects when detecting ON clauses that refer to tables to their right. Possible fix for [bugs:/info/2026-07-29T17:50:40Z | 2026-07-29T17:50:40Z].
FossilOrigin-Name: ebfea8cfb03e0578364bb1f5f8f44c55127f2155d9a0999865a811098f69e9f4
2026-07-29 19:17:40 +00:00
drh
9c94fcbea8 In the experimental and unsupported amatch.c extension, raise an error
if a cost value is out of range even if the rule that the cost applies
to will never be used.
[bugs:/info/2026-07-29T06:30:13Z|Bug 2026-07-29T06:30:13Z]

FossilOrigin-Name: 86b7a62c5ccf41479a9556e705e3c43973a4033c2db42d298050dcfce121ee05
2026-07-29 18:03:45 +00:00
drh
9b6fbaf4ca Do not allow recursion in extension functions sha1_query() or sha3_query().
[bugs:/info/2026-07-29T06:29:33Z|Bug 2026-07-29T06:29:33Z].

FossilOrigin-Name: 4687e04d948b787cee748279b13774ee1389bb179f8762720631a540f5cd9136
2026-07-29 17:36:16 +00:00
drh
d14c3f15ff Turn redundant registrations of the cksumvfs extension from a stack
overflow into a harmless no-op.
[gugs:/info/2026-07-29T06:28:31Z|Bug 2026-07-29T06:28:31Z]

FossilOrigin-Name: d6453bc80e6e717813f2f5d4a40548cbc25e83e09c209793cacfddb94a408053
2026-07-29 17:08:52 +00:00
dan
88a179e9eb Return an empty string if an fts3 snippet() is requested for an out-of-range column index. Bug [bugs:/info/2026-07-29T06:30:35Z | 2026-07-29T06:30:35Z].
FossilOrigin-Name: 5c645d5e241f6055c8dd45936a52245ecb2476a6603e06b793912bf897e42239
2026-07-29 16:55:36 +00:00
dan
7932ea0f9a Always take a copy of a value used to drive an index as part of a RIGHT JOIN loop. Otherwise, the RIGHT JOIN loop and the body of the loop it jumps back into may interfere with each other. Possible fix for [bugs:/info/2026-07-29T05:33:50Z | 2026-07-29T05:33:50Z].
FossilOrigin-Name: d7ad2d0a91b7b837b09b04f78e617fe80eb5ae48f178446c942c2a84e0e0201a
2026-07-29 15:49:38 +00:00
dan
3bc026df6e Avoid apply an affinity to a register that might be the result of a TK_AGG_COLUMN expression, as it might be reused. Fix for bug [bugs:/info/2026-07-29T05:51:06Z | 2026-07-29T05:51:06Z].
FossilOrigin-Name: b9ecd9caf755dd33f1de952ac8e5e2d731c20880a0872f10494f92ecf8cae331
2026-07-29 15:13:41 +00:00
dan
98c319e259 Avoid apply an affinity to a register that might be the result of a TK_AGG_COLUMN expression, as it might be reused. Possible fix for bug [bugs:/info/2026-07-29T05:51:06Z | 2026-07-29T05:51:06Z].
FossilOrigin-Name: e5cce8a0026e71985f3afd07aba4b3f550871a1079d18234efa19438eed15d2d
2026-07-29 14:23:30 +00:00
drh
37275bc277 Block deep recursion in test extension functions test_eval() and eval().
Does not affect deliverable code.
[bugs:/info/2026-07-29T06:29:11Z|Bug 2026-07-29T06:29:11Z]

FossilOrigin-Name: 3e99c27fe3db76a146bb4a77c08007e6c4598cda7975dd40d4f7f14c3bd914b5
2026-07-29 13:00:37 +00:00
drh
67cfb59334 Fix the sha1() extension function so that it interprets zero-length
BLOBs as BLOBs and not as NULL.  Also add a few test cases for that
extension function, which was previously completely untested.
[bugs:/info/2026-07-29T06:31:41Z|Bug 2026-07-29T06:31:41Z].

FossilOrigin-Name: 978d12de384fef985d0363633566304bb20f452dfe8ceb836ca1d353a135f30a
2026-07-29 10:28:44 +00:00
dan
5a9c01b01a Further fixes for running [make devtest] with Fil-C.
FossilOrigin-Name: 1ed5e5bed26e3d38dd09541ce73dc68188574e236ecb60142260a0c40bf8902a
2026-07-28 14:16:52 +00:00
drh
701092f4a5 Improved optimization of "expr OR TRUE" and "expr OR FALSE".
[bugs:/info/2026-07-25T08:36:25Z|Bug 2026-07-25T08:36:25Z].

FossilOrigin-Name: 2f0bde4bc89c2b088c8f821719d7e457d9129c0493032152b8f4472673973e58
2026-07-25 18:56:31 +00:00
dan
536ec8a991 Avoid opening cursors only required for reads that are optimized away by the exists-to-join optimization. Addresses report [bugs:/info/2026-07-25T08:39:23Z | 2026-07-25T08:39:23Z].
FossilOrigin-Name: c81ec73a3780cf7a44965f1763f1e6e2c324b60132197756fdb351e98052fd02
2026-07-25 17:13:30 +00:00
dan
c571cec033 Ignore any DISTINCT qualifier on a SELECT statement on the RHS of an IN(...) expression. Forum post [bugs:/info/2026-07-25T08:40:13Z | 2026-07-25T08:40:13Z].
FossilOrigin-Name: c54858eab45f71a77249c8ecdc8e107cf631e743b8b883f2b6db60e0bf7e908a
2026-07-25 14:49:40 +00:00
dan
7d3a41d1f8 Fix an incompatibility with Tcl 9 in scanstatus2.test.
FossilOrigin-Name: 2f1f4f73535386549c12694dc57cfe555eec689ae6824c6241aaf8d5befcd74d
2026-07-24 16:28:47 +00:00
drh
5694c3bb2a Fix a bug in the check-in [bbd69ce274620008] causing that bug-fix
check-in to fail to completely fix the original bug.  This fix is in response
to the follow-up report at
[bugs:/info/2026-07-24T02:52:08Z|Bug 2026-07-24T02:52:08Z].

FossilOrigin-Name: 2cb22877683680c1f89bcc9edb47bd1a4a8755d4a6b846a1a20136a657dacdcc
2026-07-24 14:53:59 +00:00
drh
2273627228 Fix to the interaction between indexes-on-expressions, subtypes, and
the unary "+" operator.  This is a continuation of the prior fix from
check-in [d75c08c8416bde3f].  This enhanced fix is prompted by
[bugs:/info/2026-07-24T08:42:47Z|Bug 2026-07-24T08:42:47Z].

FossilOrigin-Name: 5398c6a2b6b218461ce1f6437791c62c1ee125fba195660e0d6d1ad97ed6d14c
2026-07-24 13:36:44 +00:00
drh
1f2f8741b7 Fix some test cases on Windows.
FossilOrigin-Name: d2d6363f31ecbae353a1e80810f42d9e2f0f8db0fe6294c7deadf0c58669b9d0
2026-07-24 00:39:41 +00:00
drh
1a2ed04399 Enhance Bloom-filter support so that it works with blob values and with
text values as long as the collating sequence is binary.

FossilOrigin-Name: a67bff640c9e4ffdf2f48c049eaf829b9e43d167a1055bf8780ff29c910bbade
2026-07-23 21:34:16 +00:00
drh
bed078a865 New test cases for Bloom filter use on text keys as long as the
collating sequence is binary.

FossilOrigin-Name: 98ced971bfd48aedf862fa0f8674744723e36eeda2ad600e91062fc8b7d9da9e
2026-07-23 20:23:04 +00:00
dan
6f9ef2245e Change the way pointers are passed between C code and Tcl test scripts. This allows tests to be run with Fil-C builds.
FossilOrigin-Name: ba919ea1d4fe84526a4c844b3f901e5e8b1650dcdee647e4d46da2d33ced1710
2026-07-23 20:04:20 +00:00
drh
83f39c1788 Add the ability for Bloom filters to work on text values, as long as
the collating sequence is BINARY.

FossilOrigin-Name: 2577edc796505a0a6dabccbcc1bb6a828457092caa4d074561da5e58a6f065a2
2026-07-23 16:00:10 +00:00
dan
c6017f07c0 Add tests to verify that the problem reported by forum post [forum:/info/2026-07-20T18:27:00Z | 2026-07-20T18:27:00Z] is only a problem on branch-3.53, not on this branch.
FossilOrigin-Name: 6384b4b8720e35682c3ec01e7de6f0fcaec58026d5e07dfaf989f5e5851d9810
2026-07-20 20:23:27 +00:00
drh
782a6a42e1 Remove an incorrect ALWAYS() macro from the implementation of the
internal exprNodeCanReturnSubtype() routine so that it works with
zero-argument deterministic functions like pi().

FossilOrigin-Name: a2511c6223a08033a2c5c66faee3afa50b992dc18de7a8498c8e3d24ce1376cc
2026-07-20 19:17:30 +00:00
dan
cd4b0a19ec Ensure that a write with REPLACE conflict resolution on an integer primary key column is handled after any IGNORE or FAIL conflicts, even if there is also an explicit "ON CONFLICT" clause unrelated to the IPK. Forum post [forum:info/2026-07-17T09:30:42Z | 2026-07--17T09:30:42Z]. Also fix a problem whereby a trigger fired by REPLACE conflict resolution might cause a UNIQUE conflict violation to be committed to the database. Forum post [forum:/info/2026-07-18T09:45:24Z | 2026-07-18T09:45:24Z].
FossilOrigin-Name: 8f0ad8f33f5e040eb70b0b77d730c2e785827621bb0ad21afd9ce2efe4dad921
2026-07-20 17:53:36 +00:00
drh
86512b11c5 Additional test cases.
FossilOrigin-Name: 3ae4f953de5349c7e90ad245a0c21e513d4ef23d636fd786842619aff12c2d27
2026-07-20 16:45:50 +00:00
drh
5179e97d9e Move the new test cases for this branch into a new *.test file.
FossilOrigin-Name: 7bdce4ec3b9995a13536eaa2e6a5702333e792b35fa58e606b2e4fa38b85f524
2026-07-20 14:37:21 +00:00
drh
73fbc0b152 Fix boundary cases of rowid lookup using very large floating point values -
values near the minimum and maximum 64-bit signed integer.
[forum:/info/2026-07-19T07:31:46Z|Forum 2026-07-19T07:31:46Z].

FossilOrigin-Name: 987ba5a3dc5f2a2294b77ef3ec1ea06682f0530a7268777c6b64985dd0e90d40
2026-07-19 19:49:24 +00:00
drh
65a80d9000 Test case fixes due to the previous.
FossilOrigin-Name: 923665823276ee9404a9fdb19378b970eeea77a97bc2f4312446c6f6bc5e4405
2026-07-18 19:49:18 +00:00
dan
c1c108fd71 After a DELETE trigger is fired by REPLACE conflict handling, retest all UNIQUE constraints to ensure that the row being inserted or updated does not conflict with one written by the DELETE trigger. Abort the statement if it does. Possible fix for forum post [forum:/info/2026-07-18T03:35:48Z | 2026-07-18T03:35:48Z].
FossilOrigin-Name: e2ab286bb713e1358ae9a1d50dc894362d0ea6f1a2e8467c587f42f0e483dd3a
2026-07-18 19:31:56 +00:00
drh
a5e160582f Disqualify the count-of-view optimization if the view is really
a correlated subquery.
[forum:/info/2026-07-18T10:23:43Z|Forum post 2026-07-18T10:23:43Z].

FossilOrigin-Name: bb65c3adcd79581715f90d287807a3f03b375f69957c7d0202d31b23cf627da0
2026-07-18 17:47:25 +00:00
drh
7922210925 Enhancements to new test cases, for improved readability.
FossilOrigin-Name: 053e0d1f011d9ff4d57a6e33adf8de9a7a5550a3c5f6a6d4c511f75b85a09a99
2026-07-18 09:04:36 +00:00
drh
8498ccfd5f Add test cases from
[forum:/info/2026-07-18T03:35:48Z|Forum Post 2026-07-18T03:35:48Z].
New test cases are currently failing, as new or alternative fixes
are needed for the original problem.

FossilOrigin-Name: 49b67b7da6bceae3ee87153480e676f53a472b0f6e0ed8d1866ed819e8f64fa1
2026-07-18 08:46:36 +00:00
drh
ab3e9fc9e9 Additional test cases
FossilOrigin-Name: da16fe363e2b0f8e735405a03fd0cae0796333c37d41cb323863d3803ebfdc45
2026-07-17 23:25:28 +00:00
dan
88b4e34fa9 Ensure that a write with REPLACE conflict resolution on an integer primary key column is handled after any IGNORE or FAIL conflicts, even if there is also an explicit "ON CONFLICT" clause unrelated to the IPK. Forum post [forum:/info/2026-07-17T09:30:42Z | 2026-07-17T09:30:42Z].
FossilOrigin-Name: 1875249ab30fb110bc09963b592c8f48d2fb57066d770ad7e1da7e8bc8602977
2026-07-17 16:26:56 +00:00
dan
856043efbf Relax the restrictions on reordering tables in vtab queries that occur to the right of a LEFT or CROSS JOIN but are not actually the RHS of said join.
FossilOrigin-Name: 7df34b446edb2e6826f504a9fed13631817ac03e1423539fc4c28efe7ec485e0
2026-07-15 19:19:03 +00:00
drh
7193cc9c08 Adjust QRF to generate lower-case HTML output with the SQLITE_STYLE_Html
style setting.

FossilOrigin-Name: 4be8630e053de91fb03c960d792960e837cf6360d5d24fbae4fc97b8fcaef062
2026-07-14 17:02:47 +00:00
drh
a9a1fac180 New compile-time option SQLITE_MAX_SCHEMA and runtime limit option
SQLITE_LIMIT_SCHEMA that put an upper bound on the number of objects
in a database schema.  Current default is 10 million.

FossilOrigin-Name: 4ff362a4c2897e2b438d3d8fc88a012264526fa617f058be5a2d596c42d2e8a4
2026-07-10 15:06:05 +00:00
dan
47a4302042 Allow "ALTER TABLE ... DROP CONSTRAINT" to drop foreign key constraints.
FossilOrigin-Name: 17c08963812d6458783720c511806727aeae263a243a11d49b463d2c7867cd54
2026-07-08 17:40:04 +00:00
drh
839d781501 Make the (legacy, deprecated) ".header" command in the CLI responsive to
the "always" title mode.  Clean up title mode and define its operation with
improved comments in the TCL interface and in the CLI.  Add the
"-title auto" option to the CLI.

FossilOrigin-Name: f94259fc07cd7856e9c6f81a46689f4f96bbf464fda7f1d11b51a308c296aca0
2026-07-08 15:34:53 +00:00
drh
3d0c7ce2aa Change the CLI so that the default "--title" is "always" instead of "on"
for some display modes.  This check-in also include a fix to "--title always"
for the "markdown" display mode.

FossilOrigin-Name: c3b0fff1b76b8c354b34fef17ff639968698e97234d6ab7af15e0e1a835486e9
2026-07-07 14:53:53 +00:00
drh
9c202c32c1 Improved title separator in QRF when using "-title always" on an empty row.
Improved comments on the mode matrix in the CLI code.  Additional test
cases.

FossilOrigin-Name: a102d28fca6376da670b274d3d733da2c73da9abe3e7128defd04b4015b03a48
2026-07-07 12:24:50 +00:00
drh
dc4cb53863 Show --rowcount for "--style insert". New test cases.
FossilOrigin-Name: 386c40e3a9706111542b7f336e82f7bb6e9f43c6056185f9f3bd9aae1159070a
2026-07-07 11:00:10 +00:00
drh
0fe9987880 Continuing work on --rowcount and --title always.
FossilOrigin-Name: adeb4fbb86a8a781d7efb0eecb9c84ce605d0bd45f63992bf2ecd60765a60d2c
2026-07-07 00:23:38 +00:00
drh
8e409df984 Add new option "bRowCount" to QRF. Add QRF_Always as a possibility for
bTitles.  Use these feature to enhance ".mode psql" to be a better
approximation of what psql actually does.

FossilOrigin-Name: 600c6b464050078b38cc688668148f684243e7c5f08d0aae4d5f72aa6f985482
2026-07-06 19:24:15 +00:00
drh
bfad7140ac Fix the parse_create_index() SQL function created by the incremental
integrity_check extension so that it works for widely correct CREATE INDEX
statements.
[bugs:/info/2026-07-05T12:00:57Z|Bug 2026-07-05T12:00:57Z].
Also fix the extension so that it removes the parse_create_index() function.
Add the sqlite3_intck_register() API function so that the
parse_create_index() function can be more easily tested.

FossilOrigin-Name: bd28985523b02875b1045652fe29757e5d5519f48e6109ffebc99212314ab69c
2026-07-05 18:28:35 +00:00
drh
7ff247c5b9 Be sure to invoke the authorizer callback on all terms of the USING clause
in a RIGHT JOIN.
[bugs:/info/2026-07-05T08:15:45Z|Bug 2026-07-05T08:15:45Z]

FossilOrigin-Name: bbd69ce27462000873af053bfebdd305c53deac85c426b1e7dbd927b5f17d622
2026-07-05 16:06:33 +00:00
drh
0c3a9d3b0c Add the strdup() SQL function extension for use in testing.
FossilOrigin-Name: 521a7cf8443d914ae0486aa8a91924ed35a1d5b88082acbe513cef216408c97e
2026-07-04 15:09:52 +00:00
drh
c077ff1a07 The jsonSkipLabel() routine, part of json_each() and json_next(), should
never return an index outside of the range of bytes of the input JSONB.
[bugs:/info/2026-07-04T04:58:54Z|Bug 2026-07-04T04:58:54Z]

FossilOrigin-Name: 96072f5f872c8e62dedf48a4ba47ca5f3bd55e98b122f62199a1d0be06de95b4
2026-07-04 12:12:16 +00:00