1
# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
3
# This program is free software; you can redistribute it and/or modify
4
# it under the terms of the GNU General Public License as published by
5
# the Free Software Foundation; version 2 of the License.
7
# This program is distributed in the hope that it will be useful,
8
# but WITHOUT ANY WARRANTY; without even the implied warranty of
9
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
# GNU General Public License for more details.
12
# You should have received a copy of the GNU General Public License
13
# along with this program; if not, write to the Free Software Foundation,
14
# 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
16
# Last Modification to Grammar : Sandeep D (Bug #11766276)
17
# The joins on information schema tables resulted in high usage of temp space (> 350G) . The space consumtion is basically due to sorting temp table created during order by on
18
# joins involving tables like INNODB_BUFFER_PAGE . The current modification eliminates the order by on Joins and preserves sorting on projection queries with single table
21
SELECT _field FROM _table ; # Populate the RQG metadata caches from the start of the start of the test
24
modify ; # Issue DDL that are reflected in INFORMATION_SCHEMA
27
{ @nonaggregates = () ; @table_names = () ; @database_names = () ; $tables = 0 ; $fields = 0 ; "" } select |
28
{ @nonaggregates = () ; @table_names = () ; @database_names = () ; $tables = 0 ; $fields = 0 ; "" } select |
29
{ @nonaggregates = () ; @table_names = () ; @database_names = () ; $tables = 0 ; $fields = 0 ; "" } select |
30
{ @nonaggregates = () ; @table_names = () ; @database_names = () ; $tables = 0 ; $fields = 0 ; "" } select_join |
31
{ @nonaggregates = () ; @table_names = () ; @database_names = () ; $tables = 0 ; $fields = 0 ; "" } select_join |
32
{ @nonaggregates = () ; @table_names = () ; @database_names = () ; $tables = 0 ; $fields = 0 ; "" } select_join |
40
SHOW COLUMNS FROM _table |
41
SHOW CREATE DATABASE _letter |
42
SHOW CREATE FUNCTION _letter |
43
SHOW CREATE PROCEDURE _letter |
44
SHOW CREATE TABLE _letter |
45
SHOW CREATE VIEW _letter |
50
SHOW FUNCTION CODE _letter |
51
SHOW FUNCTION STATUS |
53
SHOW INDEX FROM _table |
54
# SHOW INNODB STATUS |
60
SHOW PROCEDURE CODE _letter |
61
SHOW PROCEDURE STATUS |
77
# collation_character_set_applicability |
91
# referential_constraints |
92
# routines | # same as parameters
107
ALTER TABLE _table ADD COLUMN _letter INTEGER |
108
ALTER TABLE _table DROP COLUMN _letter ;
111
GRANT privilege_list ON _table TO 'someuser'@'somehost';
114
CREATE EVENT _letter ON SCHEDULE AT NOW() DO SET @a=@a |
118
ALTER TABLE _table ADD KEY ( _letter ) |
119
ALTER TABLE _table DROP KEY _letter ;
122
CREATE PROCEDURE _letter ( procedure_parameter_list ) BEGIN SELECT COUNT(*) INTO @a FROM _table; END ; |
123
DROP PROCEDURE IF EXISTS _letter |
124
CREATE FUNCTION _letter ( function_parameter_list ) RETURNS INTEGER RETURN 1 |
125
DROP FUNCTION IF EXISTS _letter ;
128
ALTER TABLE _table PARTITION BY KEY() PARTITIONS _digit |
129
ALTER TABLE _table REMOVE PARTITIONING ;
132
CREATE DATABASE IF NOT EXISTS _letter |
133
DROP DATABASE IF EXISTS _letter ;
136
GRANT ALL PRIVILEGES ON _letter . * TO 'someuser'@'somehost' |
137
REVOKE ALL PRIVILEGES ON _letter . * FROM 'someuser'@'somehost' ;
140
CREATE TABLE _letter LIKE _table |
144
ALTER TABLE _table DROP PRIMARY KEY |
145
ALTER TABLE _table ADD PRIMARY KEY (`pk`) ;
148
GRANT ALL PRIVILEGES ON test . _letter TO 'someuser'@'somehost' |
149
REVOKE ALL PRIVILEGES ON test . _letter FROM 'someuser'@'somehost' ;
152
CREATE TRIGGER _letter BEFORE INSERT ON _table FOR EACH ROW BEGIN INSERT INTO _table SELECT * FROM _table LIMIT 0 ; END ; |
153
DROP TRIGGER IF EXISTS _letter;
156
GRANT admin_privilege_list ON * . * to 'someuser'@'somehost' |
157
REVOKE admin_privilege_list ON * . * FROM 'someuser'@'somehost' ;
159
admin_privilege_list:
161
admin_privilege , admin_privilege_list ;
176
CREATE OR REPLACE VIEW _letter AS SELECT * FROM _table |
177
DROP VIEW IF EXISTS _letter ;
179
function_parameter_list:
180
_letter INTEGER , _letter INTEGER ;
182
procedure_parameter_list:
184
parameter , procedure_parameter_list ;
195
privilege_item , privilege_list ;
198
privilege ( field_list );
201
INSERT | SELECT | UPDATE ;
205
_field , field_list ;
230
new_select_item , select_list ;
234
(new_table_item join_type new_table_item ON ( current_table_item . _field = previous_table_item . _field ) ) ;
237
INNER JOIN | left_right outer JOIN | STRAIGHT_JOIN ;
249
not (where_list AND where_item) |
250
not (where_list OR where_item) ;
256
existing_table_item . _field sign value |
257
existing_table_item . _field sign existing_table_item . _field ;
260
{ scalar(@nonaggregates) > 0 ? " GROUP BY ".join (', ' , @nonaggregates ) : "" };
263
| HAVING having_list;
267
not (having_list AND having_item) |
268
not (having_list OR having_item) |
269
having_item IS not NULL ;
272
existing_table_item . _field sign value ;
276
ORDER BY order_by_list |
277
ORDER BY order_by_list LIMIT _digit ;
280
{ join(', ', map { "field".$_ } (1..$fields) ) };
284
order_by_item , order_by_list ;
287
existing_table_item . _field ;
290
| LIMIT _digit | LIMIT _digit OFFSET _digit;
293
nonaggregate_select_item |
294
nonaggregate_select_item |
295
aggregate_select_item;
297
nonaggregate_select_item:
298
table_one_two . _field AS { my $f = "field".++$fields ; push @nonaggregates , $f ; $f} ;
300
aggregate_select_item:
301
aggregate table_one_two . _field ) AS { "field".++$fields };
303
# Only 20% table2, since sometimes table2 is not present at all
306
table1 { $last_table = $tables[1] } |
307
table2 { $last_table = $tables[2] } ;
310
COUNT( | SUM( | MIN( | MAX( ;
313
database . _table AS { $database_names[++$tables] = $last_database ; $table_names[$tables] = $last_table ; "table".$tables };
316
{ $last_database = $prng->arrayElement(['mysql','INFORMATION_SCHEMA','test']); return $last_database };
319
{ $last_database = $database_names[$tables] ; $last_table = $table_names[$tables] ; "table".$tables };
322
{ $last_database = $database_names[$tables-1] ; $last_table = $table_names[$tables-1] ; "table".($tables - 1) };
325
{ my $i = $prng->int(1,$tables) ; $last_database = $database_names[$i]; $last_table = $table_names[$i] ; "table".$i };
327
existing_select_item:
328
{ "field".$prng->int(1,$fields) };
331
= | > | < | != | <> | <= | >= ;
334
_digit | _char(2) | _datetime ;