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

Fix a false-positive in the register validity tracking logic by moving the

temporary register release call before the jump that uses that temporary
register.

FossilOrigin-Name: 9da48a5ca66dc67c8f7fb2d2471dac7ea696e35ecba5ddf65747d08d452436c1
This commit is contained in:
drh
2020-01-04 15:21:47 +00:00
parent 4549a3b8cb
commit f6ea97ea3d
4 changed files with 38 additions and 9 deletions

View File

@ -798,4 +798,33 @@ do_execsql_test trigger1-21.1 {
SELECT * FROM t0;
} {2 0 9}
# 2020-01-04 From Yongheng
# The test case below caused problems for the register validity
# tracking logic. There was no bug in the release build. The
# only problem was a false-positive in the register validity
# tracking.
#
reset_db
do_execsql_test trigger1-22.10 {
CREATE TABLE t1(
a INTEGER PRIMARY KEY,
b DOUBLE
);
CREATE TRIGGER x AFTER UPDATE ON t1 BEGIN
SELECT sum(b)OVER(ORDER BY (SELECT b FROM t1 AS x
WHERE b IN (t1.a,127,t1.b)
GROUP BY b))
FROM t1
GROUP BY a;
END;
CREATE TEMP TRIGGER x BEFORE INSERT ON t1 BEGIN
UPDATE t1
SET b=randomblob(10)
WHERE b >= 'E'
AND a < (SELECT a FROM t1 WHERE a<22 GROUP BY b);
END;
INSERT INTO t1(b) VALUES('Y'),('X'),('Z');
SELECT a, CASE WHEN typeof(b)='text' THEN quote(b) ELSE '<blob>' END, '|' FROM t1;
} {1 <blob> | 2 'X' | 3 'Z' |}
finish_test