~jaypipes/drizzle/split-xa-resource-manager

« back to all changes in this revision

Viewing changes to plugin/schema_dictionary/tests/t/data_dictionary.test

  • Committer: Jay Pipes
  • Date: 2010-02-14 20:26:43 UTC
  • mfrom: (1273.1.27 staging)
  • Revision ID: jpipes@serialcoder-20100214202643-ahuqvc8rhn8u7y33
Merge trunk and resolve conflicts

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Drizzle's data dictionary.
 
2
 
 
3
CREATE SCHEMA data_dictionary;
 
4
 
 
5
use data_dictionary;
 
6
 
 
7
--replace_column 1 #
 
8
SELECT count(*) FROM columns;
 
9
 
 
10
--replace_column 1 #
 
11
SELECT count(*) FROM indexes;
 
12
 
 
13
--replace_column 1 #
 
14
SELECT count(*) FROM index_parts;
 
15
 
 
16
--replace_column 1 #
 
17
SELECT SCHEMA_NAME  FROM schemas;
 
18
 
 
19
--replace_column 1 #
 
20
SELECT COLUMN_NAME  FROM columns;
 
21
 
 
22
--replace_column 1 #
 
23
SELECT count(*) FROM REFERENTIAL_CONSTRAINTS;
 
24
 
 
25
--replace_column 1 #
 
26
SELECT count(*) FROM TABLE_CONSTRAINTS;
 
27
 
 
28
# Make sure we don't change the names of the columns
 
29
 
 
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 ;
 
39
 
 
40
# Test the behavior of LOCAL_TABLE_NAMES
 
41
select * from LOCAL_TABLE_NAMES;
 
42
 
 
43
 
 
44
# Slap tests for concurrency
 
45
CREATE SCHEMA drizzleslap;
 
46
 
 
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=";"
 
54
 
 
55
DROP SCHEMA drizzleslap;
 
56
 
 
57
# Test that the data dictionary is not leaking its tables to other schema
 
58
CREATE SCHEMA A;
 
59
use A;
 
60
create table A (a int);
 
61
SELECT COUNT(*) FROM data_dictionary.tables WHERE TABLE_NAME = "A";
 
62
 
 
63
# Test the behavior of LOCAL_TABLE_NAMES
 
64
select * from data_dictionary.LOCAL_TABLE_NAMES;
 
65
 
 
66
DROP SCHEMA A;
 
67
DROP SCHEMA data_dictionary;