Skip to content

Commit 06d04d0

Browse files
committed
improve test
1 parent 2862608 commit 06d04d0

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

test/sql/catalog/test_querying_from_detached_catalog.test

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ statement ok con1
1111
ATTACH ':memory:' AS db2;
1212

1313
statement ok con1
14-
CREATE TABLE db2.tbl AS SELECT 1 AS a;
14+
CREATE TABLE db2.tbl (i INTEGER, j INTEGER);
15+
16+
statement ok con1
17+
INSERT INTO db2.tbl VALUES (1, 2), (3,4);
1518

1619
statement ok con1
1720
USE db1;
@@ -28,19 +31,25 @@ USE db2;
2831
statement ok con2
2932
DETACH db1;
3033

31-
# querying to an attached catalog should work
32-
statement ok con1
34+
# querying to an attached catalog should work (with non-fully qualified name)
35+
query II con1
3336
FROM db2.tbl;
37+
----
38+
1 2
39+
3 4
3440

3541
# querying to an attached catalog should work (with fully qualified name)
36-
statement ok con1
42+
query II con1
3743
FROM db2.main.tbl;
44+
----
45+
1 2
46+
3 4
3847

39-
# should give a sensible error message
48+
# error message should say that the table does not exist
4049
statement error con1
4150
FROM db2.non_existent_table;
4251
----
43-
Binder Error: Table "non_existent_table" does not exist!
52+
Catalog Error: Table with name non_existent_table does not exist!
4453

4554
# querying within the detached catalog fails
4655
statement error con1

0 commit comments

Comments
 (0)