Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(94)

Unified Diff: third_party/sqlite/sqlite-src-3100200/test/with3.test

Issue 1610543003: [sql] Import reference version of SQLite 3.10.2. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/sqlite/sqlite-src-3100200/test/with3.test
diff --git a/third_party/sqlite/sqlite-src-3100200/test/with3.test b/third_party/sqlite/sqlite-src-3100200/test/with3.test
new file mode 100644
index 0000000000000000000000000000000000000000..62e88441ab41c5f1c9bb6bc635203586a4ce1c58
--- /dev/null
+++ b/third_party/sqlite/sqlite-src-3100200/test/with3.test
@@ -0,0 +1,64 @@
+# 2015-11-07
+#
+# The author disclaims copyright to this source code. In place of
+# a legal notice, here is a blessing:
+#
+# May you do good and not evil.
+# May you find forgiveness for yourself and forgive others.
+# May you share freely, never taking more than you give.
+#
+#***********************************************************************
+# This file implements regression tests for SQLite library. The
+# focus of this file is testing the WITH clause.
+#
+
+set testdir [file dirname $argv0]
+source $testdir/tester.tcl
+set ::testprefix with3
+
+ifcapable {!cte} {
+ finish_test
+ return
+}
+
+# Test problems found by Kostya Serebryany using
+# LibFuzzer. (http://llvm.org/docs/LibFuzzer.html)
+#
+do_catchsql_test 1.0 {
+ WITH i(x) AS (
+ WITH j AS (SELECT 10)
+ SELECT 5 FROM t0 UNION SELECT 8 FROM m
+ )
+ SELECT * FROM i;
+} {1 {no such table: m}}
+
+# Additional test cases that came out of the work to
+# fix for Kostya's problem.
+#
+do_execsql_test 2.0 {
+ WITH
+ x1 AS (SELECT 10),
+ x2 AS (SELECT 11),
+ x3 AS (
+ SELECT * FROM x1 UNION ALL SELECT * FROM x2
+ ),
+ x4 AS (
+ WITH
+ x1 AS (SELECT 12),
+ x2 AS (SELECT 13)
+ SELECT * FROM x3
+ )
+ SELECT * FROM x4;
+
+} {10 11}
+
+do_execsql_test 2.1 {
+ CREATE TABLE t1(x);
+ WITH
+ x1(a) AS (values(100))
+ INSERT INTO t1(x)
+ SELECT * FROM (WITH x2(y) AS (SELECT * FROM x1) SELECT y+a FROM x1, x2);
+ SELECT * FROM t1;
+} {200}
+
+finish_test
« no previous file with comments | « third_party/sqlite/sqlite-src-3100200/test/with2.test ('k') | third_party/sqlite/sqlite-src-3100200/test/withM.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698