~ubuntu-branches/ubuntu/trusty/drizzle/trusty

« back to all changes in this revision

Viewing changes to tests/randgen/conf/runtime/information_schema.yy

  • Committer: Package Import Robot
  • Author(s): Clint Byrum
  • Date: 2012-06-19 10:46:49 UTC
  • mfrom: (1.1.6)
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20120619104649-e2l0ggd4oz3um0f4
Tags: upstream-7.1.36-stable
ImportĀ upstreamĀ versionĀ 7.1.36-stable

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Copyright (C) 2008-2009 Sun Microsystems, Inc. All rights reserved.
 
2
# Use is subject to license terms.
 
3
#
 
4
# This program is free software; you can redistribute it and/or modify
 
5
# it under the terms of the GNU General Public License as published by
 
6
# the Free Software Foundation; version 2 of the License.
 
7
#
 
8
# This program is distributed in the hope that it will be useful, but
 
9
# WITHOUT ANY WARRANTY; without even the implied warranty of
 
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 
11
# General Public License for more details.
 
12
#
 
13
# You should have received a copy of the GNU General Public License
 
14
# along with this program; if not, write to the Free Software
 
15
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
 
16
# USA
 
17
 
 
18
query_init:
 
19
        SELECT _field FROM _table ;     # Populate the RQG metadata caches from the start of the start of the test
 
20
 
 
21
thread1:
 
22
        modify ;                        # Issue DDL that are reflected in INFORMATION_SCHEMA
 
23
 
 
24
query:
 
25
        { @nonaggregates = () ; @table_names = () ; @database_names = () ; $tables = 0 ; $fields = 0 ; "" } select |
 
26
        { @nonaggregates = () ; @table_names = () ; @database_names = () ; $tables = 0 ; $fields = 0 ; "" } select |
 
27
        { @nonaggregates = () ; @table_names = () ; @database_names = () ; $tables = 0 ; $fields = 0 ; "" } select |
 
28
        show ;
 
29
 
 
30
show:
 
31
#       SHOW BINARY LOGS |
 
32
        SHOW BINLOG EVENTS |  
 
33
        SHOW CHARACTER SET  |
 
34
        SHOW COLLATION  |
 
35
        SHOW COLUMNS FROM _table |
 
36
        SHOW CREATE DATABASE  _letter |
 
37
        SHOW CREATE FUNCTION  _letter |
 
38
        SHOW CREATE PROCEDURE _letter |
 
39
        SHOW CREATE TABLE _letter |
 
40
        SHOW CREATE VIEW  _letter |
 
41
        SHOW DATABASES  |
 
42
#       SHOW ENGINE  |
 
43
        SHOW ENGINES  |
 
44
        SHOW ERRORS  |
 
45
        SHOW FUNCTION CODE _letter |
 
46
        SHOW FUNCTION STATUS | 
 
47
        SHOW GRANTS  |
 
48
        SHOW INDEX FROM _table |
 
49
#       SHOW INNODB STATUS  |
 
50
#       SHOW LOGS  |
 
51
        SHOW MASTER STATUS  |
 
52
#       SHOW MUTEX STATUS  |
 
53
        SHOW OPEN TABLES  |
 
54
        SHOW PRIVILEGES  |
 
55
        SHOW PROCEDURE CODE _letter |
 
56
        SHOW PROCEDURE STATUS | 
 
57
        SHOW PROCESSLIST  |
 
58
        SHOW PROFILE  |
 
59
        SHOW PROFILES  |
 
60
        SHOW SLAVE HOSTS  |
 
61
        SHOW SLAVE STATUS  |
 
62
        SHOW STATUS  |
 
63
        SHOW TABLE STATUS  |
 
64
        SHOW TABLES  |
 
65
        SHOW TRIGGERS | 
 
66
        SHOW VARIABLES | 
 
67
        SHOW WARNINGS ; 
 
68
 
 
69
modify:
 
70
#       character_sets |
 
71
#       collations |
 
72
#       collation_character_set_applicability |
 
73
        columns |
 
74
        column_privileges |
 
75
#       engines |
 
76
        events |
 
77
#       files |
 
78
#       global_status |
 
79
#       global_variables |
 
80
        key_column_usage |
 
81
        parameters |
 
82
        partitions |
 
83
#       plugins |
 
84
#       processlist |
 
85
#       profiling |
 
86
#       referential_constraints |
 
87
#       routines |              # same as parameters
 
88
        schemata |
 
89
        schema_privileges |
 
90
#       session_status |
 
91
#       session_variables |
 
92
#       statistics |
 
93
        tables |
 
94
#       tablespaces |
 
95
        table_constraints |
 
96
        table_privileges |
 
97
        triggers |
 
98
        user_privileges |
 
99
        views ;
 
100
 
 
101
columns:
 
102
        ALTER TABLE _table ADD COLUMN _letter INTEGER |
 
103
        ALTER TABLE _table DROP COLUMN _letter ;
 
104
 
 
105
column_privileges:
 
106
        GRANT privilege_list ON _table TO 'someuser'@'somehost';
 
107
 
 
108
events:
 
109
        CREATE EVENT _letter ON SCHEDULE AT NOW() DO SET @a=@a |
 
110
        DROP EVENT _letter ;
 
111
 
 
112
key_column_usage:
 
113
        ALTER TABLE _table ADD KEY ( _letter ) |
 
114
        ALTER TABLE _table DROP KEY _letter ;
 
115
 
 
116
parameters:
 
117
        CREATE PROCEDURE _letter ( procedure_parameter_list ) BEGIN SELECT COUNT(*) INTO @a FROM _table; END ; |
 
118
        DROP PROCEDURE IF EXISTS _letter |
 
119
        CREATE FUNCTION _letter ( function_parameter_list ) RETURNS INTEGER RETURN 1 |
 
120
        DROP FUNCTION IF EXISTS _letter ;
 
121
 
 
122
partitions:
 
123
        ALTER TABLE _table PARTITION BY KEY() PARTITIONS _digit |
 
124
        ALTER TABLE _table REMOVE PARTITIONING ;
 
125
 
 
126
schemata:
 
127
        CREATE DATABASE IF NOT EXISTS _letter |
 
128
        DROP DATABASE IF EXISTS _letter ;
 
129
 
 
130
schema_privileges:
 
131
        GRANT ALL PRIVILEGES ON _letter . * TO 'someuser'@'somehost' |
 
132
        REVOKE ALL PRIVILEGES ON _letter . * FROM 'someuser'@'somehost' ; 
 
133
 
 
134
tables:
 
135
        CREATE TABLE _letter LIKE _table |
 
136
        DROP TABLE _letter ;
 
137
 
 
138
table_constraints:
 
139
        ALTER TABLE _table DROP PRIMARY KEY |
 
140
        ALTER TABLE _table ADD PRIMARY KEY (`pk`) ;
 
141
 
 
142
table_privileges:
 
143
        GRANT ALL PRIVILEGES ON test . _letter TO 'someuser'@'somehost' |
 
144
        REVOKE ALL PRIVILEGES ON test . _letter FROM 'someuser'@'somehost' ;
 
145
 
 
146
triggers:
 
147
        CREATE TRIGGER _letter BEFORE INSERT ON _table FOR EACH ROW BEGIN INSERT INTO _table SELECT * FROM _table LIMIT 0 ; END ; |
 
148
        DROP TRIGGER IF EXISTS _letter;
 
149
 
 
150
user_privileges:
 
151
        GRANT admin_privilege_list ON * . * to 'someuser'@'somehost' |
 
152
        REVOKE admin_privilege_list ON * . * FROM 'someuser'@'somehost' ;
 
153
 
 
154
admin_privilege_list:
 
155
        admin_privilege |
 
156
        admin_privilege , admin_privilege_list ;
 
157
 
 
158
admin_privilege:
 
159
        CREATE USER |
 
160
        PROCESS |
 
161
        RELOAD |
 
162
        REPLICATION CLIENT |
 
163
        REPLICATION SLAVE |
 
164
        SHOW DATABASES |
 
165
        SHUTDOWN |
 
166
        SUPER |
 
167
#       ALL PRIVILEGES |
 
168
        USAGE ;
 
169
 
 
170
views:
 
171
        CREATE OR REPLACE VIEW _letter AS SELECT * FROM _table |
 
172
        DROP VIEW IF EXISTS _letter ;
 
173
 
 
174
function_parameter_list:
 
175
        _letter INTEGER , _letter INTEGER ;
 
176
 
 
177
procedure_parameter_list:
 
178
        parameter |
 
179
        parameter , procedure_parameter_list ;
 
180
 
 
181
parameter:
 
182
        in_out _letter INT ;
 
183
 
 
184
in_out:
 
185
        IN | OUT ;
 
186
        
 
187
 
 
188
privilege_list:
 
189
        privilege_item |
 
190
        privilege_item , privilege_list ;
 
191
 
 
192
privilege_item:
 
193
        privilege ( field_list );
 
194
 
 
195
privilege:
 
196
        INSERT | SELECT | UPDATE ;
 
197
 
 
198
field_list:
 
199
        _field |
 
200
        _field , field_list ;
 
201
 
 
202
 
 
203
 
 
204
select:
 
205
        SELECT *
 
206
        FROM join_list
 
207
        where
 
208
        group_by
 
209
        having
 
210
        order_by_limit
 
211
;
 
212
 
 
213
select_list:
 
214
        new_select_item |
 
215
        new_select_item , select_list ;
 
216
 
 
217
join_list:
 
218
        new_table_item |
 
219
        (new_table_item join_type new_table_item ON ( current_table_item . _field = previous_table_item . _field ) ) ;
 
220
 
 
221
join_type:
 
222
        INNER JOIN | left_right outer JOIN | STRAIGHT_JOIN ;  
 
223
 
 
224
left_right:
 
225
        LEFT | RIGHT ;
 
226
 
 
227
outer:
 
228
        | OUTER ;
 
229
where:
 
230
        WHERE where_list ;
 
231
 
 
232
where_list:
 
233
        not where_item |
 
234
        not (where_list AND where_item) |
 
235
        not (where_list OR where_item) ;
 
236
 
 
237
not:
 
238
        | | | NOT;
 
239
 
 
240
where_item:
 
241
        existing_table_item . _field sign value |
 
242
        existing_table_item . _field sign existing_table_item . _field ;
 
243
 
 
244
group_by:
 
245
        { scalar(@nonaggregates) > 0 ? " GROUP BY ".join (', ' , @nonaggregates ) : "" };
 
246
 
 
247
having:
 
248
        | HAVING having_list;
 
249
 
 
250
having_list:
 
251
        not having_item |
 
252
        not (having_list AND having_item) |
 
253
        not (having_list OR having_item) |
 
254
        having_item IS not NULL ;
 
255
 
 
256
having_item:
 
257
        existing_table_item . _field sign value ;
 
258
 
 
259
order_by_limit:
 
260
        |
 
261
        ORDER BY order_by_list |
 
262
        ORDER BY order_by_list LIMIT _digit ;
 
263
 
 
264
total_order_by:
 
265
        { join(', ', map { "field".$_ } (1..$fields) ) };
 
266
 
 
267
order_by_list:
 
268
        order_by_item |
 
269
        order_by_item , order_by_list ;
 
270
 
 
271
order_by_item:
 
272
        existing_table_item . _field ;
 
273
 
 
274
limit:
 
275
        | LIMIT _digit | LIMIT _digit OFFSET _digit;
 
276
 
 
277
new_select_item:
 
278
        nonaggregate_select_item |
 
279
        nonaggregate_select_item |
 
280
        aggregate_select_item;
 
281
 
 
282
nonaggregate_select_item:
 
283
        table_one_two . _field AS { my $f = "field".++$fields ; push @nonaggregates , $f ; $f} ;
 
284
 
 
285
aggregate_select_item:
 
286
        aggregate table_one_two . _field ) AS { "field".++$fields };
 
287
 
 
288
# Only 20% table2, since sometimes table2 is not present at all
 
289
 
 
290
table_one_two:
 
291
        table1 { $last_table = $tables[1] } | 
 
292
        table2 { $last_table = $tables[2] } ;
 
293
 
 
294
aggregate:
 
295
        COUNT( | SUM( | MIN( | MAX( ;
 
296
 
 
297
new_table_item:
 
298
        database . _table AS { $database_names[++$tables] = $last_database ; $table_names[$tables] = $last_table ; "table".$tables };
 
299
 
 
300
database:
 
301
        { $last_database = $prng->arrayElement(['mysql','INFORMATION_SCHEMA','test']); return $last_database };
 
302
 
 
303
current_table_item:
 
304
        { $last_database = $database_names[$tables] ; $last_table = $table_names[$tables] ; "table".$tables };
 
305
 
 
306
previous_table_item:
 
307
        { $last_database = $database_names[$tables-1] ; $last_table = $table_names[$tables-1] ; "table".($tables - 1) };
 
308
 
 
309
existing_table_item:
 
310
        { my $i = $prng->int(1,$tables) ; $last_database = $database_names[$i]; $last_table = $table_names[$i] ; "table".$i };
 
311
 
 
312
existing_select_item:
 
313
        { "field".$prng->int(1,$fields) };
 
314
 
 
315
sign:
 
316
        = | > | < | != | <> | <= | >= ;
 
317
        
 
318
value:
 
319
        _digit | _char(2) | _datetime ;