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

Unified Diff: third_party/sqlite/src/ext/rtree/rtreeF.test

Issue 949043002: Add //third_party/sqlite to dirs_to_snapshot, remove net_sql.patch (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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
« no previous file with comments | « third_party/sqlite/src/ext/rtree/rtreeE.test ('k') | third_party/sqlite/src/ext/rtree/sqlite3rtree.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/sqlite/src/ext/rtree/rtreeF.test
diff --git a/third_party/sqlite/src/ext/rtree/rtreeF.test b/third_party/sqlite/src/ext/rtree/rtreeF.test
new file mode 100644
index 0000000000000000000000000000000000000000..c9620d34f7e957543b32263577ed01b1f50525fb
--- /dev/null
+++ b/third_party/sqlite/src/ext/rtree/rtreeF.test
@@ -0,0 +1,81 @@
+# 2014-08-21
+#
+# 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 contains tests for the r-tree module.
+#
+# This file contains test cases for the ticket
+# [369d57fb8e5ccdff06f197a37147a88f9de95cda] (2014-08-21)
+#
+# The following SQL causes an assertion fault while running
+# sqlite3_prepare() on the DELETE statement:
+#
+# CREATE TABLE t1(x);
+# CREATE TABLE t2(y);
+# CREATE VIRTUAL TABLE t3 USING rtree(a,b,c);
+# CREATE TRIGGER t2del AFTER DELETE ON t2 WHEN (SELECT 1 from t1) BEGIN
+# DELETE FROM t3 WHERE a=old.y;
+# END;
+# DELETE FROM t2 WHERE y=1;
+#
+
+if {![info exists testdir]} {
+ set testdir [file join [file dirname [info script]] .. .. test]
+}
+source $testdir/tester.tcl
+ifcapable !rtree { finish_test ; return }
+
+do_execsql_test rtreeF-1.1 {
+ CREATE TABLE t1(x);
+ CREATE TABLE t2(y);
+ CREATE VIRTUAL TABLE t3 USING rtree(a,b,c);
+ CREATE TRIGGER t2dwl AFTER DELETE ON t2 WHEN (SELECT 1 from t1) BEGIN
+ DELETE FROM t3 WHERE a=old.y;
+ END;
+
+ INSERT INTO t1(x) VALUES(999);
+ INSERT INTO t2(y) VALUES(1),(2),(3),(4),(5);
+ INSERT INTO t3(a,b,c) VALUES(1,2,3),(2,3,4),(3,4,5),(4,5,6),(5,6,7);
+
+ SELECT a FROM t3 ORDER BY a;
+ SELECT '|';
+ SELECT y FROM t2 ORDER BY y;
+} {1 2 3 4 5 | 1 2 3 4 5}
+do_execsql_test rtreeF-1.2 {
+ DELETE FROM t2 WHERE y=3;
+
+ SELECT a FROM t3 ORDER BY a;
+ SELECT '|';
+ SELECT y FROM t2 ORDER BY y;
+} {1 2 4 5 | 1 2 4 5}
+do_execsql_test rtreeF-1.3 {
+ DELETE FROM t1;
+ DELETE FROM t2 WHERE y=5;
+
+ SELECT a FROM t3 ORDER BY a;
+ SELECT '|';
+ SELECT y FROM t2 ORDER BY y;
+} {1 2 4 5 | 1 2 4}
+do_execsql_test rtreeF-1.4 {
+ INSERT INTO t1 DEFAULT VALUES;
+ DELETE FROM t2 WHERE y=5;
+
+ SELECT a FROM t3 ORDER BY a;
+ SELECT '|';
+ SELECT y FROM t2 ORDER BY y;
+} {1 2 4 5 | 1 2 4}
+do_execsql_test rtreeF-1.5 {
+ DELETE FROM t2 WHERE y=2;
+
+ SELECT a FROM t3 ORDER BY a;
+ SELECT '|';
+ SELECT y FROM t2 ORDER BY y;
+} {1 4 5 | 1 4}
+
+finish_test
« no previous file with comments | « third_party/sqlite/src/ext/rtree/rtreeE.test ('k') | third_party/sqlite/src/ext/rtree/sqlite3rtree.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698