From 2d7eca3ce082a2b9cf2a8db40fec13d7e49db97f Mon Sep 17 00:00:00 2001 From: "D. Richard Hipp" Date: Sat, 28 Oct 2017 12:20:09 +0000 Subject: [PATCH] Add test cases from OSSFuzz to prevent a regression in co-routine processing. --- test/with1.test | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/test/with1.test b/test/with1.test index 252a32bc69..92fbc58fcc 100644 --- a/test/with1.test +++ b/test/with1.test @@ -1003,6 +1003,17 @@ do_execsql_test 19.1 { SELECT * FROM t1; } {0 0 0 {SCAN SUBQUERY 1} 0 1 1 {SCAN SUBQUERY 1}} - +# 2017-10-28. +# See check-in https://sqlite.org/src/info/0926df095faf72c2 +# Tried to optimize co-routine processing by changing a Copy opcode +# into SCopy. But OSSFuzz found two (similar) cases where that optimization +# does not work. +# +do_execsql_test 20.1 { + WITH c(i)AS(VALUES(9)UNION SELECT~i FROM c)SELECT max(5)>i fROM c; +} {0} +do_execsql_test 20.2 { + WITH c(i)AS(VALUES(5)UNIoN SELECT 0)SELECT min(1)-i fROM c; +} {1} finish_test -- 2.11.4.GIT