-
Notifications
You must be signed in to change notification settings - Fork 600
/
Copy pathtable.slt
111 lines (81 loc) · 2.1 KB
/
table.slt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# Create a table.
statement ok
create table ddl_t (v1 int not null);
statement ok
explain select v1 from ddl_t;
# Create another table with duplicated name.
statement error
create table ddl_t (v2 int not null);
# Drop the table.
statement ok
drop table ddl_t;
# Drop it again.
statement error
drop table ddl_t;
# Create another table with the same name.
statement ok
create table ddl_t (v2 int not null);
statement ok
explain select v2 from ddl_t;
# Create a mview on top of it.
statement ok
create materialized view ddl_mv as select v2 from ddl_t;
statement ok
explain select v2 from ddl_t;
# Create a mview with duplicated name.
statement error
create materialized view ddl_mv as select v2 from ddl_t;
# Drop the table before dropping the mview.
statement error
drop table ddl_t;
# We're not allowed to drop the mview using `DROP TABLE`.
statement error
drop table ddl_mv;
# Drop the mview.
statement ok
drop materialized view ddl_mv;
# Drop it again.
statement error
drop materialized view ddl_mv;
# We're not allowed to drop the table using `DROP MATERIALIZED VIEW`.
statement error
drop materialized view ddl_t;
# Now, we can drop the base table.
statement ok
drop table ddl_t;
# Create table concludes struct column.
statement ok
create table st (v1 int, v2 struct<v1 int, v2 struct<v1 int, v2 int>>);
statement ok
drop table st
# We test the case sensitivity of table name and column name.
statement ok
create table t1 (v1 int);
statement ok
drop table T1;
statement ok
create table T1 (v1 int);
statement ok
drop table t1;
statement ok
create table "T1" (v1 int);
# Since we have not really bound the columns in the insert statement
# this test case cannot be enabled.
# statement error
# insert into "T1" ("V1") values (1);
statement error
drop table t1;
statement error
drop table T1;
statement ok
drop table "T1";
statement ok
create table "T2" ("V1" int);
# Since we have not really bound the columns in the insert statement
# this test case cannot be enabled.
# statement error
# insert into "T2" (V1) values (1);
statement ok
insert into "T2" ("V1") values (1);
statement error
create tabke C1 (c1 varchar(5));