oceanbase
109 строк · 5.3 Кб
1--result_format 4
2--disable_query_log
3set @@session.explicit_defaults_for_timestamp=off;
4--enable_query_log
5# owner: peihan.dph
6# owner group: SQL3
7# description:
8#
9
10# tags: inner_table, schema
11
12let $cpu = 1;
13let $memory = 1073741824;
14let $min_memory = 1073741824;
15let $disk = 536870912;
16let $iops = 100000;
17let $session = 64;
18
19use information_schema;
20desc information_schema.columns;
21desc information_schema.tables;
22desc information_schema.session_variables;
23desc information_schema.table_constraints;
24desc information_schema.character_sets;
25desc information_schema.global_variables;
26desc information_schema.statistics;
27desc information_schema.schemata;
28desc information_schema.views;
29desc information_schema.files;
30
31#select * from information_schema.columns;
32--sorted_result
33--replace_column 8 NULL 9 NULL 10 NULL 15 NULL 16 NULL
34select * from information_schema.tables where table_schema in ('oceanbase', 'mysql', 'information_schema') order by TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME;
35--echo test
36#--sorted_result
37#select * from information_schema.session_variables where variable_name != 'version_comment' and variable_name != 'version' order by VARIABLE_NAME;
38#--sorted_result
39#select * from information_schema.global_variables where variable_name != 'version_comment' and variable_name != 'version' order by VARIABLE_NAME;
40--sorted_result
41select * from information_schema.table_constraints where table_schema in ('oceanbase', 'mysql', 'information_schema') order by CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA, CONSTRAINT_NAME;
42--sorted_result
43select * from information_schema.character_sets;
44--sorted_result
45select * from information_schema.statistics where table_schema in ('oceanbase', 'mysql', 'information_schema') and TABLE_NAME not like "ob_all_proxy%" order by TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME;
46--sorted_result
47select * from information_schema.schemata where schema_name in ('oceanbase', 'mysql', 'information_schema') order by CATALOG_NAME, SCHEMA_NAME;
48--sorted_result
49select * from information_schema.views where table_schema in ('oceanbase', 'mysql', 'information_schema') order by TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME;
50# should be empty
51--sorted_result
52select * from information_schema.files;
53
54create database test1;
55use test1;
56create table t1tenant1(c1 bigint primary key, c2 bigint);
57connection default;
58--replace_column 8 NULL 9 NULL 10 NULL 15 NULL 16 NULL
59select * from information_schema.tables where table_schema in ('oceanbase', 'mysql', 'information_schema', 'test1') order by TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME;
60
61create index t1tenant1_idx1 on t1tenant1(c2, c1);
62create unique index t1tenant1_uidx on t1tenant1(c2);
63create view vt1tenant1 as select c1,c2 from t1tenant1;
64
65use information_schema;
66#select * from information_schema.columns;
67#select * from information_schema.tables;
68--sorted_result
69select * from information_schema.table_constraints where table_schema in ('oceanbase', 'mysql', 'information_schema', 'test1') order by CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA, CONSTRAINT_NAME;
70
71--sorted_result
72select * from information_schema.schemata where schema_name in ('oceanbase', 'mysql', 'information_schema', 'test1') order by CATALOG_NAME, SCHEMA_NAME;
73--sorted_result
74select * from information_schema.views where table_schema in ('oceanbase', 'mysql', 'information_schema', 'test1') order by TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME;
75
76
77# login using sys tenant
78connect (conn_sys,$OBMYSQL_MS0,root@sys,,*NO-ONE*,$OBMYSQL_PORT);
79set @@session.ob_query_timeout = 60000000;
80use information_schema;
81--disable_warnings
82drop table if exists t1, t2, t3;
83--enable_warnings
84#select * from information_schema.schemata;
85#select * from information_schema.columns;
86#select * from information_schema.session_variables where variable_name != 'version_comment' and variable_name != 'version' order by VARIABLE_NAME;
87#select * from information_schema.global_variables where variable_name != 'version_comment' and variable_name != 'version' order by VARIABLE_NAME;
88--sorted_result
89select * from information_schema.table_constraints where table_schema in ('oceanbase', 'mysql', 'information_schema', 'SYS', 'LBACSYS', 'ORAAUDITOR') order by CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA, CONSTRAINT_NAME;
90--sorted_result
91select * from information_schema.statistics where table_schema in ('oceanbase', 'mysql', 'information_schema', 'SYS', 'LBACSYS', 'ORAAUDITOR') and TABLE_NAME not like "ob_all_proxy%" order by TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME;
92--sorted_result
93select * from information_schema.views where table_schema in ('oceanbase', 'mysql', 'information_schema', 'SYS', 'LBACSYS', 'ORAAUDITOR') order by TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME;
94
95
96--error 1049
97use test1;
98connection default;
99use information_schema;
100#select * from information_schema.columns;
101#select * from information_schema.schemata;
102--sorted_result
103select * from information_schema.table_constraints where table_schema in ('oceanbase', 'mysql', 'information_schema', 'test1') order by CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA, CONSTRAINT_NAME;
104--sorted_result
105select * from information_schema.statistics where table_schema in ('oceanbase', 'mysql', 'information_schema', 'test1') and TABLE_NAME not like "ob_all_proxy%" order by TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME;
106--sorted_result
107select * from information_schema.views where table_schema in ('oceanbase', 'mysql', 'information_schema', 'test1') order by TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME;
108
109drop database test1;
110