summaryrefslogtreecommitdiffstats
path: root/test/pragma4.test
diff options
context:
space:
mode:
Diffstat (limited to 'test/pragma4.test')
-rw-r--r--test/pragma4.test18
1 files changed, 17 insertions, 1 deletions
diff --git a/test/pragma4.test b/test/pragma4.test
index b82df81..97c6226 100644
--- a/test/pragma4.test
+++ b/test/pragma4.test
@@ -83,7 +83,7 @@ foreach {tn sql} {
# Verify that that P4_INTARRAY argument to OP_IntegrityCk is rendered
# correctly.
#
-db close
+catch {db close}
forcedelete test.db
sqlite3 db test.db
do_test pragma4-2.100 {
@@ -264,5 +264,21 @@ do_execsql_test 5.0 {
0 a {} 0 'abc' 0 1 b {} 0 -1 0 2 c {} 0 +4.0 0
}
+# 2024-03-24 https://sqlite.org/forum/forumpost/85b6a8b6705fb77a
+#
+catch {db2 close}
+catch {db3 close}
+ifcapable vtab {
+ reset_db
+ do_execsql_test 6.0 {
+ CREATE TABLE t1(a INT PRIMARY KEY, b INT);
+ CREATE TABLE t2(c INT PRIMARY KEY, d INT REFERENCES t1);
+ SELECT t.name, f."table", f."from", i.name, i.pk
+ FROM pragma_table_list() AS t
+ JOIN pragma_foreign_key_list(t.name, t.schema) AS f
+ JOIN pragma_table_info(f."table", t.schema) AS i
+ WHERE i.pk;
+ } {t2 t1 d a 1}
+}
finish_test