1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-07 02:42:48 +03:00

Fix a potential NULL pointer deference in the LIKE optimization. The

problem was introduced by the addition of generated columns
in check-in [b855acf1831943b3] (SQLite version 3.31.0, 2020-01-22).
Reported by Wang Ke in
[forum/forumpost/699b44b3ee|forum post 699b44b3ee].

FossilOrigin-Name: b9417d400f4585004f434837022709f818044d5844fe208fe01595a6b226ef7d
This commit is contained in:
drh
2021-09-07 15:41:25 +00:00
parent fb8ca7de0c
commit eb61630b40
4 changed files with 21 additions and 10 deletions

View File

@@ -602,4 +602,15 @@ do_execsql_test gencol1-21.1 {
SELECT name, type FROM pragma_table_xinfo('t1');
} {a INTEGER b INT c TEXT d {} e INT}
# 2021-09-07 forum https://sqlite.org/forum/forumpost/699b44b3ee
#
reset_db
do_execsql_test gencol1-22.1 {
CREATE TABLE t0(a PRIMARY KEY,b TEXT AS ('2') UNIQUE);
INSERT INTO t0(a) VALUES(2);
SELECT * FROM t0 AS x JOIN t0 AS y
WHERE x.b='2'
AND (y.a=2 OR (x.b LIKE '2*' AND y.a=x.b));
} {2 2 2 2}
finish_test