summaryrefslogtreecommitdiff
path: root/test/e_fkey.test
diff options
context:
space:
mode:
Diffstat (limited to 'test/e_fkey.test')
-rw-r--r--test/e_fkey.test206
1 files changed, 107 insertions, 99 deletions
diff --git a/test/e_fkey.test b/test/e_fkey.test
index 001ba6c..0975650 100644
--- a/test/e_fkey.test
+++ b/test/e_fkey.test
@@ -135,9 +135,9 @@ reset_db
#
# This also tests that foreign key constraints are disabled by default.
#
-# EVIDENCE-OF: R-59578-04990 Foreign key constraints are disabled by
+# EVIDENCE-OF: R-44261-39702 Foreign key constraints are disabled by
# default (for backwards compatibility), so must be enabled separately
-# for each database connection separately.
+# for each database connection.
#
drop_all_tables
do_test e_fkey-4.1 {
@@ -163,9 +163,10 @@ do_test e_fkey-4.2 {
} {world}
#-------------------------------------------------------------------------
-# EVIDENCE-OF: R-15278-54456 The application can can also use a PRAGMA
+# EVIDENCE-OF: R-08013-37737 The application can also use a PRAGMA
# foreign_keys statement to determine if foreign keys are currently
# enabled.
+
#
# This also tests the example code in section 2 of foreignkeys.in.
#
@@ -211,7 +212,7 @@ do_test e_fkey-6.1 {
catchsql {
DELETE FROM t1
}
-} {1 {foreign key constraint failed}}
+} {1 {FOREIGN KEY constraint failed}}
do_test e_fkey-6.2 {
execsql { PRAGMA foreign_keys }
} {1}
@@ -265,11 +266,11 @@ do_test e_fkey-7.1 {
#
do_test e_fkey-8.1 {
catchsql { INSERT INTO track VALUES(1, 'track 1', 1) }
-} {1 {foreign key constraint failed}}
+} {1 {FOREIGN KEY constraint failed}}
do_test e_fkey-8.2 {
execsql { INSERT INTO artist VALUES(2, 'artist 1') }
catchsql { INSERT INTO track VALUES(1, 'track 1', 1) }
-} {1 {foreign key constraint failed}}
+} {1 {FOREIGN KEY constraint failed}}
do_test e_fkey-8.2 {
execsql { INSERT INTO track VALUES(1, 'track 1', 2) }
} {}
@@ -283,7 +284,7 @@ do_test e_fkey-8.2 {
#
do_test e_fkey-9.1 {
catchsql { DELETE FROM artist WHERE artistid = 2 }
-} {1 {foreign key constraint failed}}
+} {1 {FOREIGN KEY constraint failed}}
do_test e_fkey-9.2 {
execsql {
DELETE FROM track WHERE trackartist = 2;
@@ -311,14 +312,14 @@ do_test e_fkey-10.2 {
do_test e_fkey-10.3 {
# Setting the trackid to a non-NULL value fails, of course.
catchsql { UPDATE track SET trackartist = 5 WHERE trackid = 1 }
-} {1 {foreign key constraint failed}}
+} {1 {FOREIGN KEY constraint failed}}
do_test e_fkey-10.4 {
execsql {
INSERT INTO artist VALUES(5, 'artist 5');
UPDATE track SET trackartist = 5 WHERE trackid = 1;
}
catchsql { DELETE FROM artist WHERE artistid = 5}
-} {1 {foreign key constraint failed}}
+} {1 {FOREIGN KEY constraint failed}}
do_test e_fkey-10.5 {
execsql {
UPDATE track SET trackartist = NULL WHERE trackid = 1;
@@ -344,8 +345,8 @@ proc test_r52486_21352 {tn sql} {
set res [catchsql $sql]
set results {
{0 {}}
- {1 {PRIMARY KEY must be unique}}
- {1 {foreign key constraint failed}}
+ {1 {UNIQUE constraint failed: artist.artistid}}
+ {1 {FOREIGN KEY constraint failed}}
}
if {[lsearch $results $res]<0} {
error $res
@@ -409,7 +410,7 @@ do_test e_fkey-12.1 {
} {}
do_test e_fkey-12.2 {
catchsql { INSERT INTO track VALUES(14, 'Mr. Bojangles', NULL) }
-} {1 {track.trackartist may not be NULL}}
+} {1 {NOT NULL constraint failed: track.trackartist}}
#-------------------------------------------------------------------------
# EVIDENCE-OF: R-16127-35442
@@ -438,7 +439,7 @@ do_test e_fkey-13.1 {
} {}
do_test e_fkey-13.2 {
catchsql { INSERT INTO track VALUES(14, 'Mr. Bojangles', 3) }
-} {1 {foreign key constraint failed}}
+} {1 {FOREIGN KEY constraint failed}}
do_test e_fkey-13.3 {
execsql { INSERT INTO track VALUES(14, 'Mr. Bojangles', NULL) }
} {}
@@ -446,7 +447,7 @@ do_test e_fkey-13.4 {
catchsql {
UPDATE track SET trackartist = 3 WHERE trackname = 'Mr. Bojangles';
}
-} {1 {foreign key constraint failed}}
+} {1 {FOREIGN KEY constraint failed}}
do_test e_fkey-13.5 {
execsql {
INSERT INTO artist VALUES(3, 'Sammy Davis Jr.');
@@ -464,7 +465,7 @@ do_test e_fkey-14.1 {
catchsql {
DELETE FROM artist WHERE artistname = 'Frank Sinatra';
}
-} {1 {foreign key constraint failed}}
+} {1 {FOREIGN KEY constraint failed}}
do_test e_fkey-14.2 {
execsql {
DELETE FROM track WHERE trackname = 'My Way';
@@ -475,7 +476,7 @@ do_test e_fkey-14.3 {
catchsql {
UPDATE artist SET artistid=4 WHERE artistname = 'Dean Martin';
}
-} {1 {foreign key constraint failed}}
+} {1 {FOREIGN KEY constraint failed}}
do_test e_fkey-14.4 {
execsql {
DELETE FROM track WHERE trackname IN('That''s Amore', 'Christmas Blues');
@@ -513,7 +514,7 @@ do_test e_fkey-15.1 {
proc test_efkey_45 {tn isError sql} {
do_test e_fkey-15.$tn.1 "
catchsql {$sql}
- " [lindex {{0 {}} {1 {foreign key constraint failed}}} $isError]
+ " [lindex {{0 {}} {1 {FOREIGN KEY constraint failed}}} $isError]
do_test e_fkey-15.$tn.2 {
execsql {
@@ -557,10 +558,10 @@ do_test e_fkey-16.2 {
} {}
do_test e_fkey-16.3 {
catchsql { UPDATE t2 SET b = 'two' WHERE rowid = 1 }
-} {1 {foreign key constraint failed}}
+} {1 {FOREIGN KEY constraint failed}}
do_test e_fkey-16.4 {
catchsql { DELETE FROM t1 WHERE rowid = 1 }
-} {1 {foreign key constraint failed}}
+} {1 {FOREIGN KEY constraint failed}}
#-------------------------------------------------------------------------
# Specifically, test that when comparing child and parent key values the
@@ -592,7 +593,7 @@ do_test e_fkey-17.3 {
} {integer integer text}
do_test e_fkey-17.4 {
catchsql { DELETE FROM t1 WHERE rowid = 2 }
-} {1 {foreign key constraint failed}}
+} {1 {FOREIGN KEY constraint failed}}
###########################################################################
### SECTION 3: Required and Suggested Database Indexes
@@ -896,7 +897,7 @@ do_test e_fkey-23.1 {
proc test_efkey_60 {tn isError sql} {
do_test e_fkey-23.$tn "
catchsql {$sql}
- " [lindex {{0 {}} {1 {foreign key constraint failed}}} $isError]
+ " [lindex {{0 {}} {1 {FOREIGN KEY constraint failed}}} $isError]
}
test_efkey_60 2 1 "INSERT INTO c1 VALUES(239, 231)"
@@ -933,7 +934,7 @@ do_test e_fkey-24.1 {
proc test_efkey_61 {tn isError sql} {
do_test e_fkey-24.$tn "
catchsql {$sql}
- " [lindex {{0 {}} {1 {foreign key constraint failed}}} $isError]
+ " [lindex {{0 {}} {1 {FOREIGN KEY constraint failed}}} $isError]
}
foreach {tn c} [list 2 c1 3 c2 4 c3] {
test_efkey_61 $tn.1 1 "INSERT INTO $c VALUES(1, 2)"
@@ -974,15 +975,15 @@ do_execsql_test e_fkey-25.2 {
EXPLAIN QUERY PLAN DELETE FROM artist WHERE 1;
EXPLAIN QUERY PLAN SELECT rowid FROM track WHERE trackartist = ?;
} {
- 0 0 0 {SCAN TABLE artist (~1000000 rows)}
- 0 0 0 {SCAN TABLE track (~100000 rows)}
+ 0 0 0 {SCAN TABLE artist}
+ 0 0 0 {SCAN TABLE track}
}
do_execsql_test e_fkey-25.3 {
PRAGMA foreign_keys = ON;
EXPLAIN QUERY PLAN DELETE FROM artist WHERE 1;
} {
- 0 0 0 {SCAN TABLE artist (~1000000 rows)}
- 0 0 0 {SCAN TABLE track (~100000 rows)}
+ 0 0 0 {SCAN TABLE artist}
+ 0 0 0 {SCAN TABLE track}
}
do_test e_fkey-25.4 {
execsql {
@@ -998,7 +999,7 @@ do_test e_fkey-25.5 {
concat \
[execsql { SELECT rowid FROM track WHERE trackartist = 5 }] \
[catchsql { DELETE FROM artist WHERE artistid = 5 }]
-} {1 1 {foreign key constraint failed}}
+} {1 1 {FOREIGN KEY constraint failed}}
do_test e_fkey-25.6 {
concat \
@@ -1010,7 +1011,7 @@ do_test e_fkey-25.7 {
concat \
[execsql { SELECT rowid FROM track WHERE trackartist = 6 }] \
[catchsql { DELETE FROM artist WHERE artistid = 6 }]
-} {2 1 {foreign key constraint failed}}
+} {2 1 {FOREIGN KEY constraint failed}}
#-------------------------------------------------------------------------
# EVIDENCE-OF: R-47936-10044 Or, more generally:
@@ -1099,15 +1100,15 @@ do_test e_fkey-27.2 {
do_execsql_test e_fkey-27.3 {
EXPLAIN QUERY PLAN UPDATE artist SET artistid = ?, artistname = ?
} {
- 0 0 0 {SCAN TABLE artist (~1000000 rows)}
- 0 0 0 {SEARCH TABLE track USING COVERING INDEX trackindex (trackartist=?) (~10 rows)}
- 0 0 0 {SEARCH TABLE track USING COVERING INDEX trackindex (trackartist=?) (~10 rows)}
+ 0 0 0 {SCAN TABLE artist}
+ 0 0 0 {SEARCH TABLE track USING COVERING INDEX trackindex (trackartist=?)}
+ 0 0 0 {SEARCH TABLE track USING COVERING INDEX trackindex (trackartist=?)}
}
do_execsql_test e_fkey-27.4 {
EXPLAIN QUERY PLAN DELETE FROM artist
} {
- 0 0 0 {SCAN TABLE artist (~1000000 rows)}
- 0 0 0 {SEARCH TABLE track USING COVERING INDEX trackindex (trackartist=?) (~10 rows)}
+ 0 0 0 {SCAN TABLE artist}
+ 0 0 0 {SEARCH TABLE track USING COVERING INDEX trackindex (trackartist=?)}
}
@@ -1199,7 +1200,7 @@ do_test e_fkey-29.3 {
catchsql {
INSERT INTO song VALUES(2, 'Elvis Presley', 'Elvis Is Back!', 'Fever');
}
-} {1 {foreign key constraint failed}}
+} {1 {FOREIGN KEY constraint failed}}
#-------------------------------------------------------------------------
@@ -1240,7 +1241,7 @@ do_test e_fkey-31.1 {
do_test e_fkey-31.2 {
# Execute a statement that violates the immediate FK constraint.
catchsql { INSERT INTO prince VALUES(1, 2) }
-} {1 {foreign key constraint failed}}
+} {1 {FOREIGN KEY constraint failed}}
do_test e_fkey-31.3 {
# This time, use a trigger to fix the constraint violation before the
@@ -1265,7 +1266,7 @@ do_test e_fkey-31.4 {
DROP TRIGGER kt;
}
catchsql { INSERT INTO prince VALUES(3, 4) }
-} {1 {foreign key constraint failed}}
+} {1 {FOREIGN KEY constraint failed}}
do_test e_fkey-31.5 {
execsql {
COMMIT;
@@ -1296,7 +1297,7 @@ do_test e_fkey-31.5 {
proc test_efkey_34 {tn isError sql} {
do_test e_fkey-32.$tn "
catchsql {$sql}
- " [lindex {{0 {}} {1 {foreign key constraint failed}}} $isError]
+ " [lindex {{0 {}} {1 {FOREIGN KEY constraint failed}}} $isError]
}
drop_all_tables
@@ -1327,7 +1328,7 @@ drop_all_tables
proc test_efkey_35 {tn isError sql} {
do_test e_fkey-33.$tn "
catchsql {$sql}
- " [lindex {{0 {}} {1 {foreign key constraint failed}}} $isError]
+ " [lindex {{0 {}} {1 {FOREIGN KEY constraint failed}}} $isError]
}
do_test e_fkey-33.1 {
execsql {
@@ -1417,7 +1418,7 @@ do_test e_fkey-34.1 {
proc test_efkey_29 {tn sql isError} {
do_test e_fkey-34.$tn "catchsql {$sql}" [
- lindex {{0 {}} {1 {foreign key constraint failed}}} $isError
+ lindex {{0 {}} {1 {FOREIGN KEY constraint failed}}} $isError
]
}
test_efkey_29 2 "BEGIN" 0
@@ -1491,7 +1492,7 @@ do_test e_fkey-35.2 {
INSERT INTO track VALUES(1, 'White Christmas', 5);
}
catchsql COMMIT
-} {1 {foreign key constraint failed}}
+} {1 {FOREIGN KEY constraint failed}}
do_test e_fkey-35.3 {
execsql {
INSERT INTO artist VALUES(5, 'Bing Crosby');
@@ -1528,7 +1529,7 @@ do_test e_fkey-36.2 {
} {}
do_test e_fkey-36.3 {
catchsql COMMIT
-} {1 {foreign key constraint failed}}
+} {1 {FOREIGN KEY constraint failed}}
do_test e_fkey-36.4 {
execsql {
UPDATE t1 SET a = 5 WHERE a = 4;
@@ -1558,7 +1559,7 @@ do_test e_fkey-37.1 {
} {}
do_test e_fkey-37.2 {
catchsql {RELEASE one}
-} {1 {foreign key constraint failed}}
+} {1 {FOREIGN KEY constraint failed}}
do_test e_fkey-37.3 {
execsql {
UPDATE t1 SET a = 7 WHERE a = 6;
@@ -1575,7 +1576,7 @@ do_test e_fkey-37.4 {
} {}
do_test e_fkey-37.5 {
catchsql {RELEASE one}
-} {1 {foreign key constraint failed}}
+} {1 {FOREIGN KEY constraint failed}}
do_test e_fkey-37.6 {
execsql {ROLLBACK TO one ; RELEASE one}
} {}
@@ -1606,7 +1607,7 @@ do_test e_fkey-38.2 {
} {1 1 2 2 3 3 4 4 5 6}
do_test e_fkey-38.3 {
catchsql COMMIT
-} {1 {foreign key constraint failed}}
+} {1 {FOREIGN KEY constraint failed}}
do_test e_fkey-38.4 {
execsql {
ROLLBACK TO one;
@@ -1627,11 +1628,11 @@ do_test e_fkey-38.5 {
} {}
do_test e_fkey-38.6 {
catchsql {RELEASE a}
-} {1 {foreign key constraint failed}}
+} {1 {FOREIGN KEY constraint failed}}
do_test e_fkey-38.7 {
execsql {ROLLBACK TO c}
catchsql {RELEASE a}
-} {1 {foreign key constraint failed}}
+} {1 {FOREIGN KEY constraint failed}}
do_test e_fkey-38.8 {
execsql {
ROLLBACK TO b;
@@ -1782,7 +1783,7 @@ do_test e_fkey-41.2 {
} {j k l m}
do_test e_fkey-41.3 {
catchsql COMMIT
-} {1 {foreign key constraint failed}}
+} {1 {FOREIGN KEY constraint failed}}
do_test e_fkey-41.4 {
execsql ROLLBACK
} {}
@@ -1820,10 +1821,10 @@ do_test e_fkey-41.2 {
} {}
do_test e_fkey-41.3 {
catchsql { DELETE FROM parent WHERE p1 = 'a' }
-} {1 {foreign key constraint failed}}
+} {1 {FOREIGN KEY constraint failed}}
do_test e_fkey-41.4 {
catchsql { UPDATE parent SET p2 = 'e' WHERE p1 = 'c' }
-} {1 {foreign key constraint failed}}
+} {1 {FOREIGN KEY constraint failed}}
#-------------------------------------------------------------------------
# Test that RESTRICT is slightly different from NO ACTION for IMMEDIATE
@@ -1857,7 +1858,7 @@ do_test e_fkey-42.1 {
} {}
do_test e_fkey-42.2 {
catchsql { UPDATE parent SET x = 'key one' WHERE x = 'key1' }
-} {1 {foreign key constraint failed}}
+} {1 {FOREIGN KEY constraint failed}}
do_test e_fkey-42.3 {
execsql {
UPDATE parent SET x = 'key two' WHERE x = 'key2';
@@ -1885,7 +1886,7 @@ do_test e_fkey-42.4 {
} {}
do_test e_fkey-42.5 {
catchsql { DELETE FROM parent WHERE x = 'key1' }
-} {1 {foreign key constraint failed}}
+} {1 {FOREIGN KEY constraint failed}}
do_test e_fkey-42.6 {
execsql {
DELETE FROM parent WHERE x = 'key2';
@@ -1908,7 +1909,7 @@ do_test e_fkey-42.7 {
} {}
do_test e_fkey-42.8 {
catchsql { REPLACE INTO parent VALUES('key1') }
-} {1 {foreign key constraint failed}}
+} {1 {FOREIGN KEY constraint failed}}
do_test e_fkey-42.9 {
execsql {
REPLACE INTO parent VALUES('key2');
@@ -1944,13 +1945,13 @@ do_test e_fkey-43.1 {
} {}
do_test e_fkey-43.2 {
catchsql { UPDATE parent SET x = 'key one' WHERE x = 'key1' }
-} {1 {foreign key constraint failed}}
+} {1 {FOREIGN KEY constraint failed}}
do_test e_fkey-43.3 {
execsql { UPDATE parent SET x = 'key two' WHERE x = 'key2' }
} {}
do_test e_fkey-43.4 {
catchsql COMMIT
-} {1 {foreign key constraint failed}}
+} {1 {FOREIGN KEY constraint failed}}
do_test e_fkey-43.5 {
execsql {
UPDATE child2 SET c = 'key two';
@@ -1978,13 +1979,13 @@ do_test e_fkey-43.6 {
} {}
do_test e_fkey-43.7 {
catchsql { DELETE FROM parent WHERE x = 'key1' }
-} {1 {foreign key constraint failed}}
+} {1 {FOREIGN KEY constraint failed}}
do_test e_fkey-43.8 {
execsql { DELETE FROM parent WHERE x = 'key2' }
} {}
do_test e_fkey-43.9 {
catchsql COMMIT
-} {1 {foreign key constraint failed}}
+} {1 {FOREIGN KEY constraint failed}}
do_test e_fkey-43.10 {
execsql {
UPDATE child2 SET c = NULL;
@@ -2240,7 +2241,7 @@ do_test e_fkey-49.3 {
} {ONE two three}
do_test e_fkey-49.4 {
catchsql { UPDATE parent SET a = '' WHERE a = 'oNe' }
-} {1 {foreign key constraint failed}}
+} {1 {FOREIGN KEY constraint failed}}
#-------------------------------------------------------------------------
@@ -2275,7 +2276,7 @@ do_test e_fkey-50.1 {
} {}
do_test e_fkey-50.2 {
catchsql { DELETE FROM artist WHERE artistname = 'Sammy Davis Jr.' }
-} {1 {foreign key constraint failed}}
+} {1 {FOREIGN KEY constraint failed}}
do_test e_fkey-50.3 {
execsql {
INSERT INTO artist VALUES(0, 'Unknown Artist');
@@ -2639,7 +2640,7 @@ do_test e_fkey-58.1 {
}
execsql { INSERT INTO c5 VALUES('a', 'b') }
catchsql { DROP TABLE p }
-} {1 {foreign key constraint failed}}
+} {1 {FOREIGN KEY constraint failed}}
do_test e_fkey-58.2 {
execsql { SELECT * FROM p }
} {a b}
@@ -2648,7 +2649,7 @@ do_test e_fkey-58.3 {
BEGIN;
DROP TABLE p;
}
-} {1 {foreign key constraint failed}}
+} {1 {FOREIGN KEY constraint failed}}
do_test e_fkey-58.4 {
execsql {
SELECT * FROM p;
@@ -2682,11 +2683,11 @@ do_test e_fkey-59.2 {
} {}
do_test e_fkey-59.3 {
catchsql COMMIT
-} {1 {foreign key constraint failed}}
+} {1 {FOREIGN KEY constraint failed}}
do_test e_fkey-59.4 {
execsql { CREATE TABLE p(a, b, PRIMARY KEY(a, b)) }
catchsql COMMIT
-} {1 {foreign key constraint failed}}
+} {1 {FOREIGN KEY constraint failed}}
do_test e_fkey-59.5 {
execsql { INSERT INTO p VALUES('a', 'b') }
execsql COMMIT
@@ -2849,7 +2850,7 @@ foreach zMatch [list SIMPLE PARTIAL FULL Simple parTIAL FuLL ] {
# Check that the FK is enforced properly if there are no NULL values
# in the child key columns.
catchsql { INSERT INTO c VALUES('a', 2, 4) }
- } {1 {foreign key constraint failed}}
+ } {1 {FOREIGN KEY constraint failed}}
}
#-------------------------------------------------------------------------
@@ -2879,13 +2880,13 @@ do_test e_fkey-62.3 {
} {}
do_test e_fkey-62.4 {
catchsql { INSERT INTO ci VALUES('x', 'y') }
-} {1 {foreign key constraint failed}}
+} {1 {FOREIGN KEY constraint failed}}
do_test e_fkey-62.5 {
catchsql { INSERT INTO cd VALUES('x', 'y') }
} {0 {}}
do_test e_fkey-62.6 {
catchsql { COMMIT }
-} {1 {foreign key constraint failed}}
+} {1 {FOREIGN KEY constraint failed}}
do_test e_fkey-62.7 {
execsql {
DELETE FROM cd;
@@ -2946,45 +2947,52 @@ proc test_on_update_recursion {limit} {
"
}
-do_test e_fkey-63.1.1 {
- test_on_delete_recursion $SQLITE_MAX_TRIGGER_DEPTH
-} {0 0}
-do_test e_fkey-63.1.2 {
- test_on_delete_recursion [expr $SQLITE_MAX_TRIGGER_DEPTH+1]
-} {1 {too many levels of trigger recursion}}
-do_test e_fkey-63.1.3 {
- sqlite3_limit db SQLITE_LIMIT_TRIGGER_DEPTH 5
- test_on_delete_recursion 5
-} {0 0}
-do_test e_fkey-63.1.4 {
- test_on_delete_recursion 6
-} {1 {too many levels of trigger recursion}}
-do_test e_fkey-63.1.5 {
- sqlite3_limit db SQLITE_LIMIT_TRIGGER_DEPTH 1000000
-} {5}
-do_test e_fkey-63.2.1 {
- test_on_update_recursion $SQLITE_MAX_TRIGGER_DEPTH
-} {0 0}
-do_test e_fkey-63.2.2 {
- test_on_update_recursion [expr $SQLITE_MAX_TRIGGER_DEPTH+1]
-} {1 {too many levels of trigger recursion}}
-do_test e_fkey-63.2.3 {
- sqlite3_limit db SQLITE_LIMIT_TRIGGER_DEPTH 5
- test_on_update_recursion 5
-} {0 0}
-do_test e_fkey-63.2.4 {
- test_on_update_recursion 6
-} {1 {too many levels of trigger recursion}}
-do_test e_fkey-63.2.5 {
- sqlite3_limit db SQLITE_LIMIT_TRIGGER_DEPTH 1000000
-} {5}
+# If the current build was created using clang with the -fsanitize=address
+# switch, then the library uses considerably more stack space than usual.
+# So much more, that some of the following tests cause stack overflows
+# if they are run under this configuration.
+#
+if {[clang_sanitize_address]==0} {
+ do_test e_fkey-63.1.1 {
+ test_on_delete_recursion $SQLITE_MAX_TRIGGER_DEPTH
+ } {0 0}
+ do_test e_fkey-63.1.2 {
+ test_on_delete_recursion [expr $SQLITE_MAX_TRIGGER_DEPTH+1]
+ } {1 {too many levels of trigger recursion}}
+ do_test e_fkey-63.1.3 {
+ sqlite3_limit db SQLITE_LIMIT_TRIGGER_DEPTH 5
+ test_on_delete_recursion 5
+ } {0 0}
+ do_test e_fkey-63.1.4 {
+ test_on_delete_recursion 6
+ } {1 {too many levels of trigger recursion}}
+ do_test e_fkey-63.1.5 {
+ sqlite3_limit db SQLITE_LIMIT_TRIGGER_DEPTH 1000000
+ } {5}
+ do_test e_fkey-63.2.1 {
+ test_on_update_recursion $SQLITE_MAX_TRIGGER_DEPTH
+ } {0 0}
+ do_test e_fkey-63.2.2 {
+ test_on_update_recursion [expr $SQLITE_MAX_TRIGGER_DEPTH+1]
+ } {1 {too many levels of trigger recursion}}
+ do_test e_fkey-63.2.3 {
+ sqlite3_limit db SQLITE_LIMIT_TRIGGER_DEPTH 5
+ test_on_update_recursion 5
+ } {0 0}
+ do_test e_fkey-63.2.4 {
+ test_on_update_recursion 6
+ } {1 {too many levels of trigger recursion}}
+ do_test e_fkey-63.2.5 {
+ sqlite3_limit db SQLITE_LIMIT_TRIGGER_DEPTH 1000000
+ } {5}
+}
#-------------------------------------------------------------------------
# The setting of the recursive_triggers pragma does not affect foreign
# key actions.
#
-# EVIDENCE-OF: R-51769-32730 The PRAGMA recursive_triggers setting does
-# not not affect the operation of foreign key actions.
+# EVIDENCE-OF: R-44355-00270 The PRAGMA recursive_triggers setting does
+# not affect the operation of foreign key actions.
#
foreach recursive_triggers_setting [list 0 1 ON OFF] {
drop_all_tables