Index: third_party/sqlite/src/test/fuzz2.test |
diff --git a/third_party/sqlite/src/test/fuzz2.test b/third_party/sqlite/src/test/fuzz2.test |
index 989b00f056afe1bf3b5e21c0d540e62d4eaa54fd..51dfce140b00d360e353c38483049e58605520ab 100644 |
--- a/third_party/sqlite/src/test/fuzz2.test |
+++ b/third_party/sqlite/src/test/fuzz2.test |
@@ -12,7 +12,6 @@ |
# |
# This file checks error recovery from malformed SQL strings. |
# |
-# $Id: fuzz2.test,v 1.3 2007/05/15 16:51:37 drh Exp $ |
set testdir [file dirname $argv0] |
source $testdir/tester.tcl |
@@ -105,4 +104,36 @@ do_test fuzz2-5.5 { |
fuzzcatch {SELECT ALL * GROUP BY EXISTS ( SELECT "AAAAAA" . * , AAAAAA ( * ) AS AAAAAA FROM "AAAAAA" . "AAAAAA" AS "AAAAAA" USING ( AAAAAA , "AAAAAA" , "AAAAAA" ) WHERE AAAAAA ( DISTINCT ) - RAISE ( FAIL , "AAAAAA" ) HAVING "AAAAAA" . "AAAAAA" . AAAAAA ORDER BY #182 , #55 ) BETWEEN EXISTS ( SELECT ALL * FROM ( ( } |
} {1} |
+# Test cases discovered by Michal Zalewski on 2015-01-03 and reported on the |
+# sqlite-users mailing list. All of these cases cause segfaults in |
+# SQLite 3.8.7.4 and earlier. |
+# |
+do_test fuzz2-6.1 { |
+ catchsql {SELECT n()AND+#0;} |
+} {1 {near "#0": syntax error}} |
+do_test fuzz2-6.2 { |
+ catchsql {SELECT strftime()} |
+} {0 {{}}} |
+do_test fuzz2-6.3 { |
+ catchsql {DETACH(SELECT group_concat(q));} |
+} {1 {no such column: q}} |
+do_test fuzz2-6.4a { |
+ db eval {DROP TABLE IF EXISTS t0; CREATE TABLE t0(t);} |
+ catchsql {INSERT INTO t0 SELECT strftime();} |
+} {0 {}} |
+do_test fuzz2-6.4b { |
+ db eval {SELECT quote(t) FROM t0} |
+} {NULL} |
+ |
+# Another test case discovered by Michal Zalewski, this on on 2015-01-22. |
+# Ticket 32b63d542433ca6757cd695aca42addf8ed67aa6 |
+# |
+do_test fuzz2-7.1 { |
+ catchsql {select e.*,0 from(s,(L))e;} |
+} {1 {no such table: s}} |
+do_test fuzz2-7.2 { |
+ catchsql {SELECT c.* FROM (a,b) AS c} |
+} {1 {no such table: a}} |
+ |
+ |
finish_test |