Skip to content

Commit 7b64f0e

Browse files
committed
test
1 parent 59a5860 commit 7b64f0e

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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+

0 commit comments

Comments
 (0)