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

« back to all changes in this revision

Viewing changes to tests/test_tools/randgen/conf/percona/translog_concurrent3.yy

  • Committer: Package Import Robot
  • Author(s): Dmitrijs Ledkovs
  • Date: 2013-10-29 15:43:40 UTC
  • mfrom: (1.2.12) (2.1.19 trusty-proposed)
  • Revision ID: package-import@ubuntu.com-20131029154340-2gp39el6cv8bwf2o
Tags: 1:7.2.3-2ubuntu1
* Merge from debian, remaining changes:
  - Link against boost_system because of boost_thread.
  - Add required libs to message/include.am
  - Add upstart job and adjust init script to be upstart compatible.
  - Disable -floop-parallelize-all due to gcc-4.8/4.9 compiler ICE
    http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57732

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
        normal_query | normal_query | normal_query ;
 
28
 
 
29
normal_query:
 
30
        select | select |
 
31
        select | select |
 
32
        select | select |
 
33
        select | select |
 
34
        insert_query | update | delete |
 
35
        insert_query | update | delete |
 
36
        insert_query | update | delete |
 
37
        insert_query | update | delete |
 
38
        insert_query | update | delete | 
 
39
        insert_query | update | delete |
 
40
        insert_query | update | delete |
 
41
        insert_query | update | delete |
 
42
        insert_query | update | delete |
 
43
        insert_query | update | delete |
 
44
        SAVEPOINT A /*Generated by THREAD_ID _thread_id*/ |
 
45
        ROLLBACK TO SAVEPOINT A /*Generated by THREAD_ID _thread_id*/ ;
 
46
 
 
47
normal_query_list:
 
48
  normal_query_list ; normal_query ; normal_query ; normal_query ; normal_query ; normal_query | 
 
49
  normal_query ; normal_query ; normal_query ; normal_query ; normal_query ; normal_query |
 
50
  normal_query ; normal_query ; normal_query ; normal_query ;
 
51
 
 
52
transaction:
 
53
  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*/;
 
54
 
 
55
end_transaction:
 
56
  commit_rollback ; /*Generated by THREAD_ID _thread_id*/ ;
 
57
 
 
58
commit_rollback:
 
59
  COMMIT /*Generated by THREAD_ID _thread_id*/ | 
 
60
  COMMIT /*Generated by THREAD_ID _thread_id*/ | 
 
61
  COMMIT /*Generated by THREAD_ID _thread_id*/ |
 
62
  COMMIT /*Generated by THREAD_ID _thread_id*/ | 
 
63
  COMMIT /*Generated by THREAD_ID _thread_id*/ | 
 
64
  ROLLBACK /*Generated by THREAD_ID _thread_id*/ ;
 
65
 
 
66
select:
 
67
        SELECT select_list FROM join_list where LIMIT large_digit for_update_lock_in_share_mode /*Generated by THREAD_ID _thread_id*/ ;
 
68
 
 
69
select_list:
 
70
        X . _field_key | X . _field_key |
 
71
        X . `pk` |
 
72
        X . _field |
 
73
        * |
 
74
        ( subselect );
 
75
 
 
76
subselect:
 
77
        SELECT _field_key FROM _table WHERE `pk` = value ;
 
78
 
 
79
# Use index for all joins
 
80
join_list:
 
81
        _table AS X | 
 
82
        _table AS X LEFT JOIN _table AS Y USING ( _field_key );
 
83
 
 
84
for_update_lock_in_share_mode:
 
85
        | | | | | 
 
86
        FOR UPDATE |
 
87
        LOCK IN SHARE MODE ;
 
88
 
 
89
ignore:
 
90
        | 
 
91
        IGNORE ;
 
92
 
 
93
low_priority:
 
94
        | | | LOW_PRIORITY;
 
95
 
 
96
insert_query:
 
97
  insert_replace INTO _table ( insert_column_list ) 
 
98
  SELECT insert_column_list 
 
99
  FROM _table where_insert 
 
100
  ORDER BY _field_list LIMIT insert_limit /*Generated by THREAD_ID _thread_id*/ ;
 
101
 
 
102
 
 
103
insert_replace:
 
104
  INSERT | INSERT | INSERT | INSERT | INSERT |
 
105
  INSERT | INSERT | INSERT | INSERT | INSERT |
 
106
  REPLACE ;
 
107
 
 
108
insert_column_list:
 
109
# We use a set column list because even though all tables have the same
 
110
# columns, each table has a different order of those columns for 
 
111
# enhanced randomness
 
112
 `col_char_10` , `col_char_10_key` , `col_char_10_not_null` , `col_char_10_not_null_key` ,
 
113
 `col_char_255` , `col_char_255_key` , `col_char_255_not_null` , `col_char_255_not_null_key` ,
 
114
 `col_int` , `col_int_key` , `col_int_not_null` , `col_int_not_null_key` ,
 
115
 `col_bigint` , `col_bigint_key` , `col_bigint_not_null` , `col_bigint_not_null_key` ,
 
116
 `col_enum` , `col_enum_key` , `col_enum_not_null` , `col_enum_not_null_key` ,
 
117
 `col_text` , `col_text_key` , `col_text_not_null` , `col_text_not_null_key` 
 
118
 ;
 
119
 
 
120
update:
 
121
        UPDATE _table SET update_clause where_insert ORDER BY _field_list LIMIT large_digit /*Generated by THREAD_ID _thread_id*/ ;
 
122
 
 
123
update_clause:
 
124
  no_pk_int_field_name = int_value ;
 
125
 
 
126
# We use a smaller limit on DELETE so that we delete less than we insert
 
127
 
 
128
delete:
 
129
        DELETE FROM _table where_insert ORDER BY _field_list LIMIT small_digit /*Generated by THREAD_ID _thread_id*/ ;
 
130
 
 
131
quick:
 
132
        | 
 
133
        QUICK ;
 
134
 
 
135
order_by:
 
136
        | ORDER BY X . _field_key ;
 
137
 
 
138
# Use an index at all times
 
139
where:
 
140
    | 
 
141
    WHERE X . int_field_name compare_operator int_value |
 
142
    WHERE X . char_field_name compare_operator char_value |
 
143
    WHERE X . int_field_name BETWEEN small_digit AND large_digit |
 
144
    WHERE X . int_field_name greater_than small_digit |
 
145
    WHERE X . int_field_name less_than large_digit |
 
146
    WHERE X . char_field_name greater_than small_letter |
 
147
    WHERE X . char_field_name less_than large_letter ; 
 
148
 
 
149
where_disabled: 
 
150
# only used in select's, but causing crashes on bad
 
151
# compares like enum to int
 
152
        WHERE X . _field_key = ( subselect ) ;
 
153
       
 
154
 
 
155
where_delete:
 
156
        | ;
 
157
        
 
158
 
 
159
where_insert:
 
160
    |
 
161
    WHERE int_field_name compare_operator int_value |
 
162
    WHERE char_field_name compare_operator char_value |
 
163
    WHERE int_field_name BETWEEN small_digit AND large_digit |
 
164
    WHERE int_field_name greater_than small_digit |
 
165
    WHERE int_field_name less_than large_digit |
 
166
    WHERE char_field_name greater_than small_letter |
 
167
    WHERE char_field_name less_than large_letter |
 
168
    where_fuzz ;
 
169
 
 
170
where_fuzz:
 
171
# rules to introduce some fuzz testing 
 
172
# we deliberately allow the chance of bad
 
173
# comparisons here to see what happens
 
174
    WHERE _field_key = ( subselect ) |
 
175
    WHERE _field_key compare_operator value |
 
176
    WHERE _field_key IN ( subselect ) ;
 
177
 
 
178
compare_operator:
 
179
  = | < | > | <= | >= | != ;
 
180
 
 
181
less_than:
 
182
  < | <= ;
 
183
 
 
184
greater_than:
 
185
  > | >= ;
 
186
 
 
187
 
 
188
 
 
189
int_value:
 
190
  _digit | _digit | large_digit | small_digit | 
 
191
  _digit | insert_limit | _tinyint_unsigned |
 
192
  _digit | _digit | large_digit | small_digit | 
 
193
  _digit | insert_limit | _tinyint_unsigned |
 
194
  value ;
 
195
 
 
196
int_value_list:  
 
197
  int_value_list, int_value | int_value | int_value ;
 
198
 
 
199
char_value:
 
200
  _char | _char | _quid ;
 
201
 
 
202
char_value_list:
 
203
  char_value_list, char_value | char_value | char_value ;
 
204
 
 
205
int_field_name:
 
206
    `pk` | `col_int_key` | `col_int` |
 
207
    `col_bigint` | `col_bigint_key` |
 
208
    `col_int_not_null` | `col_int_not_null_key` ;
 
209
 
 
210
no_pk_int_field_name:
 
211
    `col_int_key` | `col_int` |
 
212
    `col_bigint` | `col_bigint_key` |
 
213
    `col_int_not_null` | `col_int_not_null_key` ;    
 
214
 
 
215
 
 
216
char_field_name:
 
217
      `col_char_10` | `col_char_10_key` | `col_text_not_null` | `col_text_not_null_key` |
 
218
      `col_text_key` | `col_text` | `col_char_10_not_null_key` | `col_char_10_not_null` |
 
219
      `col_char_255` | `col_char_255_key` | `col_char_255_not_null` | `col_char_255_not_null_key` ;
 
220
 
 
221
large_digit:
 
222
        5 | 6 | 7 | 8 ;
 
223
 
 
224
small_digit:
 
225
        1 | 2 | 3 | 4 ;
 
226
 
 
227
small_letter:
 
228
  'a' | 'b' | 'c' ;
 
229
 
 
230
large_letter:
 
231
  'x' | 'y' | 'z' ;
 
232
 
 
233
insert_limit:
 
234
   10 | 10 | 25 | 25 | 25 | 25 | 50 | 50 | 100 ;
 
235
 
 
236
value:
 
237
        _digit | _tinyint_unsigned | _varchar(1) | _int_unsigned ;
 
238
 
 
239
zero_one:
 
240
        0 | 0 | 1;