~drizzle-trunk/drizzle/development

1315.1.1 by Lee Bieber
add queries used to setup randgen testing so we can ensure that randgen tests can at least build and run
1
drop table if exists t1;
2
show variables like 'version';
3
Variable_name	Value
4
version	####.##.####
5
select version();
6
version()
7
####.##.####
8
select database();
9
database()
10
test
11
CREATE TABLE `t1` (
12
`col_bigint` bigint,
13
`col_text` text,
14
`col_char` char (1),
15
`col_enum` enum ('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'),
16
`col_int` int,
17
`col_char_not_null` char (1) not null,
18
`col_int_not_null_key` int not null,
19
`col_text_not_null` text not null,
20
`col_enum_not_null_key` enum ('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z') not null,
21
`col_int_key` int,
22
`col_char_key` char (1),
23
`col_enum_not_null` enum ('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z') not null,
24
`col_text_not_null_key` text not null,
25
pk integer auto_increment,
26
`col_bigint_key` bigint,
27
`col_int_not_null` int not null,
28
`col_bigint_not_null` bigint not null,
29
`col_bigint_not_null_key` bigint not null,
30
`col_char_not_null_key` char (1) not null,
31
`col_text_key` text,
32
`col_enum_key` enum ('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'),
33
/*Indices*/
34
key (`col_int_not_null_key` ),
35
key (`col_enum_not_null_key` ),
36
key (`col_int_key` ),
37
key (`col_char_key` ),
38
key (`col_text_not_null_key`  (255)),
39
primary key (pk),
40
key (`col_bigint_key` ),
41
key (`col_bigint_not_null_key` ),
42
key (`col_char_not_null_key` ),
43
key (`col_text_key`  (255)),
44
key (`col_enum_key` )) ENGINE=innodb;
45
set AUTOCOMMIT=OFF;
1644.2.1 by Patrick Crews
Altered randgen_queries.test to use explicit ORDER BY as DATA_DICTIONARY and INFORMATION_SCHEMA tables no longer internally sort data automatically. Updated result file as well
46
select SQL_BIG_RESULT table_schema, 
1315.1.1 by Lee Bieber
add queries used to setup randgen testing so we can ensure that randgen tests can at least build and run
47
table_name, 
1320.3.1 by Lee Bieber
update randgen_queries test and results to use the same query as is being used in randgen
48
CASE WHEN table_type = 'STANDARD' THEN 'table' 
49
WHEN table_type = 'FUNCTION' then 'function' 
50
ELSE 'misc' END, 
1309.4.2 by Brian Aker
Updates to schema dictionary for lee
51
column_name,
1666.1.1 by Patrick Crews
Updated randgen_queries test to reflect use of YES/NO vs. TRUE/FALSE in I_S and D_D
52
CASE WHEN IS_USED_IN_PRIMARY = 'YES' THEN 'primary' 
53
WHEN IS_INDEXED = 'YES' THEN 'indexed' 
1309.4.2 by Brian Aker
Updates to schema dictionary for lee
54
ELSE 'indexed' END 
1320.3.1 by Lee Bieber
update randgen_queries test and results to use the same query as is being used in randgen
55
FROM data_dictionary.tables INNER JOIN
1643.3.13 by Brian Aker
Remove sort() and add in DEBUG mode to randomize the results of generators.
56
data_dictionary.columns USING(table_schema, table_name) ORDER BY table_schema, table_name limit 20;
1320.3.1 by Lee Bieber
update randgen_queries test and results to use the same query as is being used in randgen
57
table_schema	table_name	CASE WHEN table_type = 'STANDARD' THEN 'table' 
58
WHEN table_type = 'FUNCTION' then 'function' 
1666.1.1 by Patrick Crews
Updated randgen_queries test to reflect use of YES/NO vs. TRUE/FALSE in I_S and D_D
59
ELSE 'misc' END	column_name	CASE WHEN IS_USED_IN_PRIMARY = 'YES' THEN 'primary' 
60
WHEN IS_INDEXED = 'YES' THEN 'indexed' 
1309.4.2 by Brian Aker
Updates to schema dictionary for lee
61
ELSE 'indexed' END 
62
1395.1.17 by Brian Aker
Correction to some of the output.
63
DATA_DICTIONARY	CHARACTER_SETS	function	CHARACTER_SET_NAME	indexed
64
DATA_DICTIONARY	CHARACTER_SETS	function	DEFAULT_COLLATE_NAME	indexed
65
DATA_DICTIONARY	CHARACTER_SETS	function	DESCRIPTION	indexed
66
DATA_DICTIONARY	CHARACTER_SETS	function	MAXLEN	indexed
67
DATA_DICTIONARY	COLLATIONS	function	CHARACTER_SET_NAME	indexed
68
DATA_DICTIONARY	COLLATIONS	function	COLLATION_NAME	indexed
69
DATA_DICTIONARY	COLLATIONS	function	DESCRIPTION	indexed
70
DATA_DICTIONARY	COLLATIONS	function	ID	indexed
71
DATA_DICTIONARY	COLLATIONS	function	IS_DEFAULT	indexed
72
DATA_DICTIONARY	COLLATIONS	function	IS_COMPILED	indexed
73
DATA_DICTIONARY	COLLATIONS	function	SORTLEN	indexed
74
DATA_DICTIONARY	COLUMNS	function	TABLE_SCHEMA	indexed
75
DATA_DICTIONARY	COLUMNS	function	TABLE_NAME	indexed
76
DATA_DICTIONARY	COLUMNS	function	COLUMN_NAME	indexed
77
DATA_DICTIONARY	COLUMNS	function	COLUMN_TYPE	indexed
78
DATA_DICTIONARY	COLUMNS	function	ORDINAL_POSITION	indexed
79
DATA_DICTIONARY	COLUMNS	function	COLUMN_DEFAULT	indexed
80
DATA_DICTIONARY	COLUMNS	function	COLUMN_DEFAULT_IS_NULL	indexed
81
DATA_DICTIONARY	COLUMNS	function	COLUMN_DEFAULT_UPDATE	indexed
82
DATA_DICTIONARY	COLUMNS	function	IS_NULLABLE	indexed
1644.2.2 by Patrick Crews
Altered randgen_query test to include non-DATA_DICTIONARY / INFORMATION_SCHEMA tables (new test case)
83
CREATE SCHEMA randgen_query_test;
84
USE randgen_query_test;
85
CREATE TABLE t1 (a INT);
86
CREATE TABLE t2 LIKE t1;
87
CREATE TABLE t3 LIKE t1;
88
CREATE TABLE t4 (b CHAR(500));
89
CREATE TABLE t5 LIKE t4;
90
select SQL_BIG_RESULT table_schema,
91
table_name,
92
CASE WHEN table_type = 'STANDARD' THEN 'table'
93
            WHEN table_type = 'FUNCTION' then 'function'
94
       ELSE 'misc' END,
95
column_name,
1666.1.1 by Patrick Crews
Updated randgen_queries test to reflect use of YES/NO vs. TRUE/FALSE in I_S and D_D
96
CASE WHEN IS_USED_IN_PRIMARY = 'YES' THEN 'primary'
97
             WHEN IS_INDEXED = 'YES' THEN 'indexed'
1644.2.2 by Patrick Crews
Altered randgen_query test to include non-DATA_DICTIONARY / INFORMATION_SCHEMA tables (new test case)
98
       ELSE 'indexed' END
99
FROM data_dictionary.tables INNER JOIN
100
data_dictionary.columns USING(table_schema, table_name) WHERE table_schema NOT IN ('DATA_DICTIONARY','INFORMATION_SCHEMA')
101
ORDER BY table_schema, table_name limit 20;
102
table_schema	table_name	CASE WHEN table_type = 'STANDARD' THEN 'table'
103
            WHEN table_type = 'FUNCTION' then 'function'
1666.1.1 by Patrick Crews
Updated randgen_queries test to reflect use of YES/NO vs. TRUE/FALSE in I_S and D_D
104
       ELSE 'misc' END	column_name	CASE WHEN IS_USED_IN_PRIMARY = 'YES' THEN 'primary'
105
             WHEN IS_INDEXED = 'YES' THEN 'indexed'
1644.2.2 by Patrick Crews
Altered randgen_query test to include non-DATA_DICTIONARY / INFORMATION_SCHEMA tables (new test case)
106
       ELSE 'indexed' END
107
108
randgen_query_test	t1	table	a	indexed
109
randgen_query_test	t2	table	a	indexed
110
randgen_query_test	t3	table	a	indexed
111
randgen_query_test	t4	table	b	indexed
112
randgen_query_test	t5	table	b	indexed
113
test	t1	table	col_bigint	indexed
114
test	t1	table	col_text	indexed
115
test	t1	table	col_char	indexed
116
test	t1	table	col_enum	indexed
117
test	t1	table	col_int	indexed
118
test	t1	table	col_char_not_null	indexed
119
test	t1	table	col_int_not_null_key	indexed
120
test	t1	table	col_text_not_null	indexed
121
test	t1	table	col_enum_not_null_key	indexed
122
test	t1	table	col_int_key	indexed
123
test	t1	table	col_char_key	indexed
124
test	t1	table	col_enum_not_null	indexed
125
test	t1	table	col_text_not_null_key	indexed
1666.1.1 by Patrick Crews
Updated randgen_queries test to reflect use of YES/NO vs. TRUE/FALSE in I_S and D_D
126
test	t1	table	pk	primary
1644.2.2 by Patrick Crews
Altered randgen_query test to include non-DATA_DICTIONARY / INFORMATION_SCHEMA tables (new test case)
127
test	t1	table	col_bigint_key	indexed
128
DROP SCHEMA randgen_query_test;
129
USE test;
1315.1.1 by Lee Bieber
add queries used to setup randgen testing so we can ensure that randgen tests can at least build and run
130
select AVG(`col_int_key`) + AVG(`col_int`) AS average1,
131
(SUM(`col_int_key`) + SUM(`col_int`)) / COUNT(*) AS average2,
132
COUNT(*) AS count FROM t1;
133
average1	average2	count
134
NULL	NULL	0
135
select collation_name,character_set_name FROM data_dictionary.collations;
136
collation_name	character_set_name
1643.3.13 by Brian Aker
Remove sort() and add in DEBUG mode to randomize the results of generators.
137
binary	binary
138
utf8_bin	utf8_general_ci
139
utf8_czech_ci	utf8_general_ci
140
utf8_danish_ci	utf8_general_ci
141
utf8_esperanto_ci	utf8_general_ci
142
utf8_estonian_ci	utf8_general_ci
1315.1.1 by Lee Bieber
add queries used to setup randgen testing so we can ensure that randgen tests can at least build and run
143
utf8_general_ci	utf8_general_ci
1643.3.13 by Brian Aker
Remove sort() and add in DEBUG mode to randomize the results of generators.
144
utf8_hungarian_ci	utf8_general_ci
1315.1.1 by Lee Bieber
add queries used to setup randgen testing so we can ensure that randgen tests can at least build and run
145
utf8_icelandic_ci	utf8_general_ci
146
utf8_latvian_ci	utf8_general_ci
1643.3.13 by Brian Aker
Remove sort() and add in DEBUG mode to randomize the results of generators.
147
utf8_lithuanian_ci	utf8_general_ci
148
utf8_persian_ci	utf8_general_ci
149
utf8_polish_ci	utf8_general_ci
150
utf8_roman_ci	utf8_general_ci
1315.1.1 by Lee Bieber
add queries used to setup randgen testing so we can ensure that randgen tests can at least build and run
151
utf8_romanian_ci	utf8_general_ci
1643.3.13 by Brian Aker
Remove sort() and add in DEBUG mode to randomize the results of generators.
152
utf8_sinhala_ci	utf8_general_ci
153
utf8_slovak_ci	utf8_general_ci
1315.1.1 by Lee Bieber
add queries used to setup randgen testing so we can ensure that randgen tests can at least build and run
154
utf8_slovenian_ci	utf8_general_ci
1643.3.13 by Brian Aker
Remove sort() and add in DEBUG mode to randomize the results of generators.
155
utf8_spanish2_ci	utf8_general_ci
1315.1.1 by Lee Bieber
add queries used to setup randgen testing so we can ensure that randgen tests can at least build and run
156
utf8_spanish_ci	utf8_general_ci
157
utf8_swedish_ci	utf8_general_ci
158
utf8_turkish_ci	utf8_general_ci
1643.3.13 by Brian Aker
Remove sort() and add in DEBUG mode to randomize the results of generators.
159
utf8_unicode_ci	utf8_general_ci
1315.1.1 by Lee Bieber
add queries used to setup randgen testing so we can ensure that randgen tests can at least build and run
160
select COUNT(*) from data_dictionary.tables;
161
COUNT(*)
1340.1.2 by Brian Aker
Merge of table cache/def DD.
162
####.##.####
1435.1.4 by Stewart Smith
randgen_queries wasn't cleaning up after itself.
163
DROP TABLE t1;