1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-01 06:27:03 +03:00

An UPDATE of a table that is indexed by a constant virtual column that uses

the one-pass optimization might cause the table seek to be omitted before
reaching row DELETE/INSERT.  Fix this by coding an extra OP_Column in that
circumstance.  Ticket [ec8abb025e78f40c]

FossilOrigin-Name: e54560495926fbb8a2ce829c677a2dd0066e46b7a8d4ada9d8a34a3426959836
This commit is contained in:
drh
2019-12-26 23:16:18 +00:00
parent e752040c09
commit d3ee3ad12f
4 changed files with 39 additions and 9 deletions

View File

@ -468,6 +468,20 @@ do_execsql_test gencol1-17.50 {
SELECT a FROM t1 WHERE b='DEF' AND a='def';
} {DEF}
# 2019-12-26 ticket ec8abb025e78f40c
# An index on a virtual column with a constant value (why would anybody
# ever do such a thing?) can cause problems for a one-pass DELETE.
#
reset_db
do_execsql_test gencol1-18.10 {
CREATE TABLE t0(c0 UNIQUE AS(0), c1, c2);
INSERT INTO t0(c1) VALUES(0);
SELECT * FROM t0;
} {0 0 {}}
do_execsql_test gencol1-18.20 {
UPDATE t0 SET c1=0, c2=0 WHERE c0>=0;
SELECT * FROM t0;
} {0 0 0}