drh
7815214b6c
An unknown function can be seen in exprNodeCanReturnSubtype(), but only
...
if SQLite is compiled with SQLITE_ENABLE_UNKNOWN_SQL_FUNCTIONS. Adjust
asserts accordingly.
FossilOrigin-Name: dcf20611cdd4a250531d0e753144ab1b6796635331bb906df0e174aea4bd4158
2026-10-12 21:24:29 +00:00
drh
e26021ed60
Temporarily back out the penultimate check-in on this branch in order to
...
prevent an assertion fault. Need to reconsider this approach in light of
[bug:/info/2026-05-18T14:04:01Z|Bug 2026-05-18T14:04:01Z]. That other
bug might be fixed incorrectly, and might also need to be backed out.
Both bugs reopened until we can complete the analysis.
FossilOrigin-Name: 163413d8e19b97e36b2a1f6734c271b3944195a213973e2975e43f45a1e80735
2026-10-12 17:52:40 +00:00
dan
5bf1891464
Fix a problem causing "aggregate( t1.col1 ORDER BY t2.col2 )" where col1 and col2 are in the same positions in their tables to be treated as "aggregate( t2.col2 ORDER BY t2.col2 )". Report [bugs:info/2026-10-12T13:31:40Z | 2026-10-12T13:31:40Z].
...
FossilOrigin-Name: ffe3f056f1789f188a0afece0363dc2ea74912510bbbd4edcb656ad8a1acc704
2026-10-12 16:29:30 +00:00
dan
3922c42423
Prevent scalar subqueries from ever returning a value with a non-zero subtype. Report [bugs:/info/2026-10-12T13:52:22Z | 2026-10-12T13:52:22Z].
...
FossilOrigin-Name: af3c900e2b5251bcbc0611dbe2f86b13fd2daa07bcf42563a9d6db46dfdd6b3d
2026-10-12 16:08:07 +00:00
dan
48fedaa403
Avoid excessive reprepares when there is an unindexed "col=?" constraint on a join query. This should only be reprepared when the bound value toggles between integer values 0 or 1 and any other value. Report [bugs:/info/2026-10-11T16:06:46Z | 2026-10-11T16:06:46Z].
...
FossilOrigin-Name: 7f154192db5a3a79f4666edd31dfc29fd73904ccd3630952e3b032e49fee6455
2026-10-12 13:36:00 +00:00
drh
e326d6eff0
Do not use an index expression to evaluate a constant expression, as that
...
uses unnecessary disk access and might actually give incorrect results if
the expression was moved outside of the indexed loop. The error condition
arose in check-in [44200596aa943963] for version 3.41.0 and was first
reported 3.5 years later by
[bugs:/info/2026-10-11T19:26:40Z|Bug 2026-10-11T19:26:40Z].
FossilOrigin-Name: fee60d93e9fb37234d9cad50c65fb6d62dfe21a7fde21a16ce39025290375ad8
2026-10-12 10:24:09 +00:00
drh
d54522a5b8
Fix expression tree depth calculations for COLLATE.
...
[bugs:/info/2026-10-04T04:50:56Z|Bug 2026-10-04T04:50:56Z]
FossilOrigin-Name: 252c0b7bf5a727d29605672bb58e06c758173c276671df3e388a68294998b4d3
2026-10-04 21:54:17 +00:00
drh
ebba9a05f2
Performance optimizations and code simplifications.
...
FossilOrigin-Name: cbf2e796e02b23df9d51b59e047673fe0bdecd6497e678507b5bbc5c136dad7d
2026-08-27 01:42:32 +00:00
drh
0754d37652
Split the sqlite3ColumnExpr() routine out into two routines, one that works
...
as before and the second sqlite3ColumnExprAuth() to deal with the
authenticator in places where that is needed.
FossilOrigin-Name: 51a1149bdcbe142b8eb92c2b817d3973bf88aaa73859e0c475505aa201da920b
2026-08-26 21:04:25 +00:00
drh
04a4ee45c5
An attempt to make the authorizer effective at preventing the use of
...
some functions within the DEFAULT clause of a table.
FossilOrigin-Name: 321e41b09179acba59958bdd6b07e4b7d915b9c0dfca143e4914b3690692c201
2026-08-26 19:37:23 +00:00
drh
8a9882714d
The sqlite3ExprListIsConstant() routine probably should not return true
...
if the list contains a function like random(). Fixed here. Simplify
the logic used to test if expressions are constant.
FossilOrigin-Name: 753f42a0925112fd4f2bbe40e72919230890ffc8014900d36624c0dfa371bdf7
2026-08-26 15:23:14 +00:00
dan
11d653bbd3
When an expression that may have a subtype from the WHERE clause of a partial index is substituted for a column value, clear the subtype before the value is used. Report [bugs:/info/2026-08-25T05:36:33Z | 2026-08-25T05:36:33Z].
...
FossilOrigin-Name: e6ae6fbd5c0b33ae6950a5a45fc0631cd5e0a437eb672f0a2ec6d288596f1be2
2026-08-25 14:26:16 +00:00
drh
3468c5b73e
Fix check-in [468e730036edac22] so that it works with DESC indexes.
...
[bugs:/info/2026-08-22T07:01:45Z|Bug 2026-08-22T07:01:45Z].
FossilOrigin-Name: d1f4fa43f30d0aaf04af1b2afe9ec488654df43444bd49fae31ba1e2ab16b985
2026-08-22 09:33:37 +00:00
drh
8fafd53c09
Refactor. 2M cycles faster on x64.
...
FossilOrigin-Name: 2b3e73200b7842db493da6c9912c3f4405f629384127449edd46febdc21a0228
2026-08-21 20:21:23 +00:00
drh
5d92a8f1b5
Merge the latest trunk enhancements into the reduce-reprepares branch.
...
FossilOrigin-Name: 62ad88fe1ccd647ef77910d116856d6f2d9c96a726a2a270eacc8f5785875264
2026-08-20 14:05:49 +00:00
drh
ed22d61dd2
Fix the order of 32-bit works on an OP_ColumnsUsed operator.
...
FossilOrigin-Name: 0433f33e02e181fecfaff043f72c24118303d767aa9768ed118f48e548f61db3
2026-08-20 09:26:01 +00:00
drh
255f7220fd
Modify the OP_Int64 and OP_Real opcodes so that their 64-bit immediate value
...
is stored split across to arguments, P1 and P3, rather than being stored
as a separate memory allocation pointed to by P4. Slightly smaller and
slightly faster, but perhaps also easier to maintain.
FossilOrigin-Name: c13b4c2c41e19fc47925dfb75e5f48d9972ef9ffb68c2d3c57e71a23e75717f9
2026-08-20 01:22:18 +00:00
drh
2b356863cc
Merge recent trunk enhancements into the reduce-reprepares branch.
...
FossilOrigin-Name: f3adcd561a50646fa53173da162ed3952065d7bd6cc82babbecf3973be269d57
2026-08-19 17:25:54 +00:00
drh
857f41a4ae
Fix a minor error in [d287358b8d356d4f] that was causing an assertion fault.
...
FossilOrigin-Name: 1357ac105a0e0c380dc88b13d53b93799221a389f3f81ba6d05fe8fd9ffc6975
2026-08-19 10:38:49 +00:00
dan
bb7c3e8eac
Refactor the new code on this branch.
...
FossilOrigin-Name: 76a03b5314bd3a48e5f8de60c47cdb6ae749a8741bf0dede0a3b599a796d76d1
2026-08-18 21:12:12 +00:00
dan
6252e83bec
Also correctly process "x IS NOT TRUE" expressions that appear in the second or later rows of a VALUES() clause.
...
FossilOrigin-Name: 0de50d5685b2edf317bdc48f79052f58a64738d3ee966ad1e631f76f4aba6168
2026-08-18 14:40:24 +00:00
dan
6227f9abd7
Correctly process an "x IS TRUE" expression that appears in the second or later rows of a VALUES() clause. Possible fix for report [bugs:/info/2026-08-18T05:06:40Z 2026-08-18T05:06:40Z].
...
FossilOrigin-Name: 1be96edbd5f695e8a12620e4d74d2b7bc7fb277a956c4b5e5ee8274121920c7b
2026-08-18 14:21:27 +00:00
drh
464f5129c2
Change the variable name for the variable-number bitmap cache. Make the size
...
of the cache configurable at compile-time.
FossilOrigin-Name: 35c9c6e6352ff855eea4782da2270ff2937a969116db9d481bc0701375749c2b
2026-08-16 19:50:46 +00:00
jeffchen
3de1035b3b
Add a small bitmap to the Parse object recording which variable numbers below 128 are already in Parse.pVList, so that repeated or out-of-order ?NNN parameters avoid a linear scan of the VList on each occurrence. Optimize particularly well on ORM testset.
...
FossilOrigin-Name: 306f8f3ccbd7d5c4993f0f084db73950b2c00fb356c10f00e579c7d413ddab6b
2026-08-16 12:04:16 +00:00
drh
f1a8574eef
Do not use the propagate-constant optimization on a constant that is
...
really a function that might return a subtype.
FossilOrigin-Name: a5bf606f3b76b66988d9f4ce97ca48827c2583e2e275f50a2fdfc8bb08719779
2026-08-12 13:23:52 +00:00
dan
24ad808809
When comparing row values that are sub-selects, do not consider the collation sequences of the expressions returned by the sub-select when determining the collation sequences to use for the comparisons. i.e. in "(a, b)=(SELECT c, d)", do not consider the collation sequences of "c" or "d". Fix for problem [forum:/info/2026-08-09T09:33:49Z | 2026-08-09T09:33:49Z].
...
FossilOrigin-Name: 88580851be734d1917809a4254f2f117df58c71b4c118509ccb4756a300fa6e6
2026-08-10 15:57:42 +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
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
drh
b4ca411eb6
Improved Bloom-filter invariant checking.
...
FossilOrigin-Name: f38f4167110df11ba54816932126f695dc6e114d4001d0261669807a55ad7966
2026-07-23 18:55:12 +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
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
drh
72d26f4660
Do not allow internal-use-only functions to be coded, anywhere, unless
...
inside of a nested parse (which is the case for ALTER TABLE) or if
the appropriate test-control is activated.
[bugs:/info/2026-06-23T15:49:27Z|Bug 2026-06-23T15:49:27Z].
FossilOrigin-Name: a145307e4d0b621c5493cecc7c826e8422cbd8dbc8cd9a042b8ec9e05d389eb6
2026-06-23 19:08:18 +00:00
drh
2dacda40a6
Extra testcase() macros to ensure adequate testing of the previous
...
check-in.
FossilOrigin-Name: 003013ccabaaa7aea1e78844474ed5032ee9c9824f98c5d36687ac5256a5e128
2026-06-04 11:39:13 +00:00
dan
62a3734e78
Fix problems with expressions like "(?,?,?) IN (SELECT c,b,a FROM ...)" when there is an index on columns "c", "b" and "a", but not in that order. Bug [bugs:/info/2026-06-04T07:02:53Z | 2026-06-04T07:02:53Z].
...
FossilOrigin-Name: 07667afd0f17b73b58df8ace6a2a5c3a593276f9b7804cb14d4705051258dd75
2026-06-04 11:19:43 +00:00
dan
03aa9a7b50
For expressions of the form "(x, y...) IN (SELECT a, b ...)" where the result is not true, consider the collation sequences of columns "a" and "b" when determinining if the result should be false or NULL. Bug report [bugs:/info/0785f45e67 | 2026-05-31T02:10:44Z].
...
FossilOrigin-Name: 04d7a9d788cf0bb811483baceb9142f67d4a2380d4af409d5300a92f7972472e
2026-06-01 16:20:40 +00:00
drh
f305e1921b
Performance optimization to the sqlite3ExprCollSeqMatch() routine.
...
FossilOrigin-Name: 035f1d2f284a081e6aef01cc773a3784458ec8e6297f3fbf4063670a9e65278c
2026-05-21 14:48:43 +00:00
drh
d3265d1473
Improved comment on sqlite3ExprCanReturnSubtype() as well as one very
...
minor efficiency improvement.
FossilOrigin-Name: b57d6b76b0f9f4f154997af83f14d545bf2b6b8f7194746835e4c34885db227a
2026-05-16 16:02:08 +00:00
dan
61d9f8f881
When using an index on a CASE expression that may return a value with a subtype, avoid discarding any subtype.
...
FossilOrigin-Name: 69c9a82cbaea7b6faa6a357dd884b1e0d2bc684d847efb31a2d64c75fabf5428
2026-05-15 19:44:24 +00:00
drh
d20673a95f
Fix typos and inaccuracies in comments. No changes to code.
...
FossilOrigin-Name: a6c2d7ce84f4f5f8a82cc566a27f98f5418f251e87f1f264ae57935fb10399f7
2026-04-13 17:33:34 +00:00
drh
f855727e45
Back out the sqlite3_atof() API, for now.
...
FossilOrigin-Name: 7568d264be3988df195401158d8d07105b8e9e018eccf98ac948219bee9388ac
2026-03-26 12:09:37 +00:00
drh
80b88b2482
Proposed new API routine: sqlite3_atof().
...
FossilOrigin-Name: db370f0f628895279a1c1db79ba7428cb4e31b56cafc191859c2f1a5a924435b
2026-03-22 20:52:23 +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
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
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
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
33db5b73e5
The Select.addrOpenEphm field is no longer needed. Remove it and
...
simplify related code.
FossilOrigin-Name: 1fe5a1ca72892987716b71b9419265f25c8c426e52320acf56724fd64b838be6
2026-01-25 20:15:00 +00:00
drh
ca77c585be
Fix an incorrect assert().
...
FossilOrigin-Name: b9ce349e1e4166c3d1c97d2f6fb1792b89e3316c8ec182daa032b6655e9c2c17
2026-01-24 00:33:41 +00:00
drh
4b736ce2f8
More code simplifications.
...
FossilOrigin-Name: 3d76732a45333f6f3e21667bb018a859d20815243d276fad0dc126d3c667d4aa
2026-01-23 18:52:45 +00:00
drh
1f567aef4c
Remove code that is no longer used.
...
FossilOrigin-Name: 8d7f91e07b0c7573f94fddd64f39671e608969764615bd7f5c060e7ee7540bc6
2026-01-23 16:07:51 +00:00
dan
add73c831b
Add the SQLITE_PREPARE_FROM_DDL flag to sqlite3_prepare_v3(). Use this to prevent fts3/4 tables in non-trusted schemas from calling unsafe SQL functions.
...
FossilOrigin-Name: 26f39ac806a5582fab1497e38a4ce68dad2b79df8c8aade43c4e21eed7576931
2025-12-22 15:22:02 +00:00