1
# Copyright (C) 2008 Sun Microsystems, Inc. All rights reserved.
2
# Use is subject to license terms.
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.
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.
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
19
# This grammar is suitable for general stress testing of storage engines
20
# including the InnoDB plugin and Falcon, their locking and transactional mechanisms. It can
21
# also be used along with the Combinations facility in order to provide stress testing under
22
# various configurations
24
# The goal is to spend as much time as possible inside the storage engine and as little time
25
# as possible in the optimizer. Therefore, most of the queries have trivial optimizer plans
26
# and run very quickly.
28
# At the same time, please note that this grammar does not aim to cover all possible
29
# table access methods. The grammars from conf/optimizer/optimizer* are more suitable for that.
36
insert_replace | update | delete |
37
insert_replace | update | delete |
38
insert_replace | update | delete |
39
insert_replace | update | delete |
40
insert_replace | update | delete ;
44
COMMIT ; SET TRANSACTION ISOLATION LEVEL isolation_level |
45
ROLLBACK ; SET TRANSACTION ISOLATION LEVEL isolation_level |
46
SAVEPOINT A | ROLLBACK TO SAVEPOINT A |
47
SET AUTOCOMMIT=OFF | SET AUTOCOMMIT=ON ;
50
READ UNCOMMITTED | READ COMMITTED | REPEATABLE READ | SERIALIZABLE ;
53
SELECT select_list FROM join_list where LIMIT large_digit for_update_lock_in_share_mode;
56
X . _field_key | X . _field_key |
63
SELECT _field_key FROM _table WHERE `pk` = value ;
65
# Use index for all joins
68
_table AS X LEFT JOIN _table AS Y USING ( _field_key );
70
for_update_lock_in_share_mode:
75
# Insert more than we delete
77
i_r INTO _table (`pk`) VALUES (NULL) |
78
i_r INTO _table ( _field_no_pk , _field_no_pk ) VALUES ( value , value ) , ( value , value ) |
79
i_r INTO _table ( _field_no_pk ) SELECT _field_key FROM _table AS X where ORDER BY _field_list LIMIT large_digit;
83
INSERT low_priority IGNORE |
94
UPDATE low_priority ignore _table AS X SET _field_no_pk = value where ORDER BY _field_list LIMIT large_digit ;
96
# We use a smaller limit on DELETE so that we delete less than we insert
99
DELETE low_priority quick ignore FROM _table where_delete ORDER BY _field_list LIMIT small_digit ;
106
| ORDER BY X . _field_key ;
108
# Use an index at all times
111
WHERE X . _field_key < value | # Use only < to reduce deadlocks
112
WHERE X . _field_key IN ( value , value , value , value , value ) |
113
WHERE X . _field_key BETWEEN small_digit AND large_digit |
114
WHERE X . _field_key BETWEEN _tinyint_unsigned AND _int_unsigned |
115
WHERE X . _field_key = ( subselect ) ;
119
WHERE _field_key = value |
120
WHERE _field_key IN ( value , value , value , value , value ) |
121
WHERE _field_key IN ( subselect ) |
122
WHERE _field_key BETWEEN small_digit AND large_digit ;
131
_digit | _tinyint_unsigned | _varchar(1) | _int_unsigned ;