1
# Drizzle's data dictionary.
3
CREATE SCHEMA data_dictionary;
8
SELECT count(*) FROM columns;
11
SELECT count(*) FROM indexes;
14
SELECT count(*) FROM index_parts;
17
SELECT SCHEMA_NAME FROM schemas;
20
SELECT COLUMN_NAME FROM columns;
23
SELECT count(*) FROM REFERENTIAL_CONSTRAINTS;
26
SELECT count(*) FROM TABLE_CONSTRAINTS;
28
# Make sure we don't change the names of the columns
30
show create table COLUMNS ;
31
show create table INDEXES ;
32
show create table INDEX_PARTS ;
33
show create table LOCAL_TABLE_NAMES;
34
show create table REFERENTIAL_CONSTRAINTS ;
35
show create table SCHEMAS ;
36
show create table SCHEMA_NAMES;
37
show create table TABLES ;
38
show create table TABLE_CONSTRAINTS ;
40
# Test the behavior of LOCAL_TABLE_NAMES
41
select * from LOCAL_TABLE_NAMES;
44
# Slap tests for concurrency
45
CREATE SCHEMA drizzleslap;
47
#--exec $DRIZZLE_SLAP --silent --concurrency=5 --iterations=20 --query="select * from data_dictionary.columns" --delimiter=";"
48
#--exec $DRIZZLE_SLAP --silent --concurrency=5 --iterations=20 --query="select * from data_dictionary.index_parts" --delimiter=";"
49
#--exec $DRIZZLE_SLAP --silent --concurrency=5 --iterations=20 --query="select * from data_dictionary.indexes" --delimiter=";"
50
#--exec $DRIZZLE_SLAP --silent --concurrency=5 --iterations=20 --query="select * from data_dictionary.referential_constraints" --delimiter=";"
51
#--exec $DRIZZLE_SLAP --silent --concurrency=5 --iterations=20 --query="select * from data_dictionary.schemas" --delimiter=";"
52
#--exec $DRIZZLE_SLAP --silent --concurrency=5 --iterations=20 --query="select * from data_dictionary.table_constraints" --delimiter=";"
53
#--exec $DRIZZLE_SLAP --silent --concurrency=5 --iterations=20 --query="select * from data_dictionary.tables" --delimiter=";"
55
DROP SCHEMA drizzleslap;
57
# Test that the data dictionary is not leaking its tables to other schema
60
create table A (a int);
61
SELECT COUNT(*) FROM data_dictionary.tables WHERE TABLE_NAME = "A";
63
# Test the behavior of LOCAL_TABLE_NAMES
64
select * from data_dictionary.LOCAL_TABLE_NAMES;
67
DROP SCHEMA data_dictionary;