mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-29 08:01:23 +03:00
When reading sqlite_stat4 data during query planning, be sure to expand
zeroblobs prior to running comparisons. Fix for the issue identified by [forum:/forumpost/5275207102|forum post 5275207102]. FossilOrigin-Name: 5c8dd8dfcaab9c364b3a126ca35880ef57f5cecbe030771e646c934c8cf43709
This commit is contained in:
@ -275,6 +275,20 @@ do_execsql_test analyzeE-6.4 {
|
||||
SELECT count(*) FROM sqlite_stat4 WHERE idx='i1' AND neq<>'1 1 1 1 1 1';
|
||||
} 0
|
||||
|
||||
|
||||
# 2023-03-25 https://sqlite.org/forum/forumpost/5275207102
|
||||
# Correctly expand zeroblobs while processing STAT4 information
|
||||
# during query planning.
|
||||
#
|
||||
reset_db
|
||||
do_execsql_test analyzeE-7.0 {
|
||||
CREATE TABLE t1(a TEXT COLLATE binary);
|
||||
CREATE INDEX t1x ON t1(a);
|
||||
INSERT INTO t1(a) VALUES(0),('apple'),(NULL),(''),('banana');
|
||||
ANALYZE;
|
||||
SELECT format('(%s)',a) FROM t1 WHERE t1.a > CAST(zeroblob(5) AS TEXT);
|
||||
} {(0) (apple) (banana)}
|
||||
do_execsql_test analyzeE-7.1 {
|
||||
SELECT format('(%s)',a) FROM t1 WHERE t1.a <= CAST(zeroblob(5) AS TEXT);
|
||||
} {()}
|
||||
|
||||
finish_test
|
||||
|
Reference in New Issue
Block a user