File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change
1
+ # name: test/sql/catalog/test_switching_from_detached_catalog.test
2
+ # description: Test switching from detached catalog to another catalog
3
+ # group: [catalog]
4
+
5
+ statement ok con1;
6
+ ATTACH ':memory:' AS db1;
7
+
8
+ statement ok con1;
9
+ ATTACH ':memory:' AS db2;
10
+
11
+ statement ok con1;
12
+ USE db1;
13
+
14
+ query I con1;
15
+ SELECT CURRENT_SETTING('search_path');
16
+ ----
17
+ db1.main
18
+
19
+ statement ok con2;
20
+ USE db2;
21
+
22
+ # drop catalog db1, which con1 is using
23
+ statement ok con2;
24
+ DETACH db1;
25
+
26
+ # querying within the detached catalog fails
27
+ statement error con1;
28
+ SHOW TABLES;
29
+ ----
30
+ Binder Error: Catalog "db1" does not exist!
31
+
32
+ # swithcing to another catalog should work
33
+ statement ok con1
34
+ USE db2;
35
+
36
+ query I con1
37
+ SELECT CURRENT_SETTING('search_path');
38
+ ----
39
+ db2.main
40
+
You can’t perform that action at this time.
0 commit comments