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

« back to all changes in this revision

Viewing changes to tests/kewpie/randgen/conf/drizzle/translog_concurrent3.yy

  • Committer: Package Import Robot
  • Author(s): Tobias Frost
  • Date: 2012-04-04 15:12:07 UTC
  • mfrom: (1.1.4)
  • Revision ID: package-import@ubuntu.com-20120404151207-xwsgn1xegslle4p0
Tags: 1:7.1.32-rc-1
* New upstream release.
* Plugin-filtered-replicator upstream removed and will no longer be built.
* Updating d/*install files to accommodate upstream changes from drizzle7
  to drizzle
* Added symlink in libdrizzledmessage-dev to library
* libdrizzle: soname-bump
* Rename package drizzle-plugin-performance-dictionary to shorten package name
  (due to linitan warning package-has-long-file-name)
* Debian/control: removed unused substitution variable ${shlibs:Depends} for
  -dbg and -dev packages

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