-
Notifications
You must be signed in to change notification settings - Fork 333
/
information_schema.sql
79 lines (52 loc) · 1.65 KB
/
information_schema.sql
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
-- should not able to create information_schema
create database information_schema;
-- scripts table has different table ids in different modes
select *
from information_schema.tables
where table_name != 'scripts'
order by table_schema, table_name;
select * from information_schema.columns order by table_schema, table_name;
create
database my_db;
use my_db;
create table foo
(
ts TIMESTAMP TIME INDEX
);
select table_name
from information_schema.tables
where table_schema = 'my_db'
order by table_name;
select table_catalog, table_schema, table_name, table_type, engine
from information_schema.tables
where table_catalog = 'greptime'
and table_schema != 'public'
and table_schema != 'information_schema'
order by table_schema, table_name;
select table_catalog, table_schema, table_name, column_name, data_type, semantic_type
from information_schema.columns
where table_catalog = 'greptime'
and table_schema != 'public'
and table_schema != 'information_schema'
order by table_schema, table_name, column_name;
use public;
drop schema my_db;
use information_schema;
-- schemata --
desc table schemata;
select * from schemata where catalog_name = 'greptime' and schema_name != 'public' order by catalog_name, schema_name;
-- test engines
select * from engines;
desc table build_info;
select count(*) from build_info;
-- tables not implemented
desc table COLUMN_PRIVILEGES;
select * from COLUMN_PRIVILEGES;
desc table COLUMN_STATISTICS;
select * from COLUMN_STATISTICS;
select * from CHARACTER_SETS;
select * from COLLATIONS;
select * from COLLATION_CHARACTER_SET_APPLICABILITY;
desc table CHECK_CONSTRAINTS;
select * from CHECK_CONSTRAINTS;
use public;