~ubuntu-branches/ubuntu/saucy/drizzle/saucy-proposed

« back to all changes in this revision

Viewing changes to tests/kewpie/randgen/conf/percona/query_cache_strip_comments.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) 2010 Patrick Crews. 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
# This grammar is designed to generate a transactional workload for validating transaction handling and replication
 
19
# setups
 
20
#
 
21
# This is still a work in progress and is likely to change.
 
22
# We are generating a fair number of invalid queries and we could tighten things up, however,
 
23
# we have found a number of bugs with this grammar as it currently exists.
 
24
 
 
25
query:
 
26
        transaction | transaction | 
 
27
# update_innodb_dict_size
 
28
        transaction | transaction | transaction | normal_query ;
 
29
 
 
30
#update_innodb_dict_size:
 
31
#     SET innodb_dict_size_limit = innodb_dict_value ;
 
32
 
 
33
#innodb_dict_value:
 
34
 
 
35
 
 
36
normal_query:
 
37
        select | select |
 
38
        select | select |
 
39
        select | select |
 
40
        select | select |
 
41
        insert_query | update | delete |
 
42
        insert_query | update | delete |
 
43
        insert_query | update | delete |
 
44
        insert_query | update | delete |
 
45
        insert_query | update | delete | 
 
46
        insert_query | update | delete |
 
47
        insert_query | update | delete |
 
48
        insert_query | update | delete |
 
49
        insert_query | update | delete |
 
50
        insert_query | update | delete |
 
51
        SAVEPOINT A /*Generated by THREAD_ID _thread_id*/ | 
 
52
        ROLLBACK TO SAVEPOINT A /*Generated by THREAD_ID _thread_id*/ ;
 
53
 
 
54
normal_query_list:
 
55
  normal_query_list ; normal_query ; normal_query ; normal_query ; normal_query ; normal_query | 
 
56
  normal_query ; normal_query ; normal_query ; normal_query ; normal_query ; normal_query |
 
57
  normal_query ; normal_query ; normal_query ; normal_query ;
 
58
 
 
59
transaction:
 
60
  SET AUTOCOMMIT=OFF /*Generated by THREAD_ID _thread_id*/ ; START TRANSACTION /*Generated by THREAD_ID _thread_id*/ ; normal_query_list ; end_transaction ; SET AUTOCOMMIT=ON /*Generated by THREAD_ID _thread_id*/ ;
 
61
 
 
62
end_transaction:
 
63
  commit_rollback ; 
 
64
 
 
65
commit_rollback:
 
66
  COMMIT /*Generated by THREAD_ID _thread_id*/| 
 
67
  COMMIT /*Generated by THREAD_ID _thread_id*/| 
 
68
  COMMIT /*Generated by THREAD_ID _thread_id*/| 
 
69
  COMMIT /*Generated by THREAD_ID _thread_id*/| 
 
70
  COMMIT /*Generated by THREAD_ID _thread_id*/| 
 
71
  ROLLBACK /*Generated by THREAD_ID _thread_id*/;
 
72
 
 
73
 
 
74
select:
 
75
        SELECT select_list FROM join_list where LIMIT large_digit for_update_lock_in_share_mode /*Generated by THREAD_ID _thread_id*/ ;
 
76
 
 
77
select_list:
 
78
        X . _field_key | X . _field_key |
 
79
        X . `pk` |
 
80
        X . _field |
 
81
        * |
 
82
        ( subselect );
 
83
 
 
84
subselect:
 
85
        SELECT _field_key FROM _table WHERE `pk` = value ;
 
86
 
 
87
# Use index for all joins
 
88
join_list:
 
89
        _table AS X | 
 
90
        _table AS X LEFT JOIN _table AS Y USING ( _field_key );
 
91
 
 
92
for_update_lock_in_share_mode:
 
93
        | | | | | 
 
94
        FOR UPDATE |
 
95
        LOCK IN SHARE MODE ;
 
96
 
 
97
ignore:
 
98
        | 
 
99
        IGNORE ;
 
100
 
 
101
low_priority:
 
102
        | | | LOW_PRIORITY;
 
103
 
 
104
insert_query:
 
105
  insert_replace INTO _table ( insert_column_list ) 
 
106
  SELECT insert_column_list 
 
107
  FROM _table where_insert 
 
108
  ORDER BY _field_list LIMIT insert_limit /*Generated by THREAD_ID _thread_id*/;
 
109
 
 
110
insert_replace:
 
111
  INSERT | INSERT | INSERT | INSERT | INSERT |
 
112
  INSERT | INSERT | INSERT | INSERT | INSERT |
 
113
  REPLACE ;
 
114
 
 
115
insert_column_list:
 
116
# We use a set column list because even though all tables have the same
 
117
# columns, each table has a different order of those columns for 
 
118
# enhanced randomness
 
119
 `col_char_10` , `col_char_10_key` , `col_char_10_not_null` , `col_char_10_not_null_key` ,
 
120
 `col_char_255` , `col_char_255_key` , `col_char_255_not_null` , `col_char_255_not_null_key` ,
 
121
 `col_int` , `col_int_key` , `col_int_not_null` , `col_int_not_null_key` ,
 
122
 `col_bigint` , `col_bigint_key` , `col_bigint_not_null` , `col_bigint_not_null_key` ,
 
123
 `col_enum` , `col_enum_key` , `col_enum_not_null` , `col_enum_not_null_key` 
 
124
 ;
 
125
 
 
126
update:
 
127
        UPDATE _table SET update_clause where_insert ORDER BY _field_list LIMIT large_digit /* 'foo' Generated by THREAD_ID _thread_id*/ ;
 
128
 
 
129
update_clause:
 
130
  no_pk_int_field_name = int_value ;
 
131
 
 
132
# We use a smaller limit on DELETE so that we delete less than we insert
 
133
 
 
134
delete:
 
135
        DELETE FROM _table where_insert ORDER BY _field_list LIMIT small_digit /*Generated by THREAD_ID _thread_id*/ ;
 
136
 
 
137
quick:
 
138
        | 
 
139
        QUICK ;
 
140
 
 
141
order_by:
 
142
        | ORDER BY X . _field_key ;
 
143
 
 
144
# Use an index at all times
 
145
where:
 
146
        |
 
147
        WHERE X . char_field_name != 'If you need to translate Views labels into other languages, consider installing the <a href=\" !path\">Internationalization</a> package\'s Views translation module.' |
 
148
        WHERE X . int_field_name BETWEEN _tinyint_unsigned AND _int_unsigned ;
 
149
 
 
150
where_disabled: 
 
151
# only used in select's, but causing crashes on bad
 
152
# compares like enum to int
 
153
        WHERE X . _field_key = ( subselect ) ;
 
154
       
 
155
 
 
156
where_delete:
 
157
        | ;
 
158
        
 
159
 
 
160
where_insert:
 
161
    |
 
162
    WHERE int_field_name compare_operator int_value |
 
163
    WHERE char_field_name compare_operator char_value |
 
164
    WHERE int_field_name IN (int_value_list) |
 
165
    WHERE char_field_name IN (char_value_list) |
 
166
    WHERE int_field_name BETWEEN int_value AND int_value |
 
167
    WHERE int_field BETWEEN _tinyint_unsigned AND _int_unsigned |
 
168
    WHERE int_field BETWEEN small_digit AND large_digit |
 
169
    where_fuzz ;
 
170
 
 
171
where_fuzz:
 
172
# rules to introduce some fuzz testing 
 
173
# we deliberately allow the chance of bad
 
174
# comparisons here to see what happens
 
175
    WHERE _field_key = ( subselect ) |
 
176
    WHERE _field_key compare_operator value |
 
177
    WHERE _field_key IN ( subselect ) ;
 
178
 
 
179
compare_operator:
 
180
  = | = | = | = | < | > | <= | >= | != ;
 
181
 
 
182
 
 
183
 
 
184
int_value:
 
185
  _digit | _digit | large_digit | small_digit | 
 
186
  _digit | insert_limit | _tinyint_unsigned |
 
187
  _digit | _digit | large_digit | small_digit | 
 
188
  _digit | insert_limit | _tinyint_unsigned |
 
189
  value ;
 
190
 
 
191
int_value_list:  
 
192
  int_value_list, int_value | int_value | int_value ;
 
193
 
 
194
char_value:
 
195
  _char | _char | _quid | '\\\'' | '\\"';
 
196
 
 
197
char_value_list:
 
198
  char_value_list, char_value | char_value | char_value ;
 
199
 
 
200
int_field_name:
 
201
    `pk` | `col_int_key` | `col_int` |
 
202
    `col_bigint` | `col_bigint_key` |
 
203
    `col_int_not_null` | `col_int_not_null_key` ;
 
204
 
 
205
no_pk_int_field_name:
 
206
    `col_int_key` | `col_int` |
 
207
    `col_bigint` | `col_bigint_key` |
 
208
    `col_int_not_null` | `col_int_not_null_key` ;    
 
209
 
 
210
 
 
211
char_field_name:
 
212
      `col_char_10` | `col_char_10_key`| `col_char_10_not_null_key` | `col_char_10_not_null` |
 
213
      `col_char_255` | `col_char_255_key` | `col_char_255_not_null` | `col_char_255_not_null_key` ;
 
214
 
 
215
large_digit:
 
216
        5 | 6 | 7 | 8 ;
 
217
 
 
218
small_digit:
 
219
        1 | 2 | 3 | 4 ;
 
220
 
 
221
insert_limit:
 
222
   10 | 10 | 25 | 25 | 25 | 25 | 50 | 50 | 100 ;
 
223
 
 
224
value:
 
225
        _digit | _tinyint_unsigned | _varchar(1) | _int_unsigned ;
 
226
 
 
227
zero_one:
 
228
        0 | 0 | 1;