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

« back to all changes in this revision

Viewing changes to tests/test_tools/randgen/conf/engines/heap/heap_ddl_multi.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
#
 
2
# The goal of this grammar is to stress test the operation of the HEAP storage engine by:
 
3
 
4
# * Creating numerous tables, populating them rapidly and then dropping them
 
5
#
 
6
# * Using various DDL statements that cause HEAP tables to be created or manipulated
 
7
#
 
8
# * Have concurrent operation by using mostly TEMPORARY or connection-specific tables
 
9
#
 
10
 
 
11
query_init:
 
12
        { $table_name = 'local_'.$generator->threadId().'_1' ; return undef; } create_definition_init ; { $table_name = 'local_'.$generator->threadId().'_2' ; return undef; } create_definition_init ; { $table_name = 'local_'.$generator->threadId().'_3' ; return undef; } create_definition_init ;
 
13
 
 
14
create_definition_init:
 
15
        create_definition SELECT short_value  AS f1 , short_value AS f2 , short_value AS f3 , short_value AS f4 , short_value AS f5 FROM DUAL ;
 
16
 
 
17
query:
 
18
        create_drop |
 
19
        select | select | select | select |
 
20
        insert | insert | insert | insert |
 
21
        insert | insert | insert | insert |
 
22
        update | update | update | update |
 
23
        delete | delete | delete | delete |
 
24
        alter |
 
25
        truncate ;
 
26
 
 
27
create_drop:
 
28
        set_table_name DROP TABLE IF EXISTS { $table_name } ; create_definition ; create_definition ; create_definition |
 
29
        set_table_name DROP TABLE IF EXISTS { $table_name } ; create_definition select_all ;
 
30
 
 
31
alter:
 
32
        ALTER TABLE table_name ENGINE = HEAP |
 
33
        ALTER TABLE table_name enable_disable KEYS ;
 
34
 
 
35
enable_disable:
 
36
        ENABLE | DISABLE ;
 
37
 
 
38
truncate:
 
39
        TRUNCATE TABLE table_name ;
 
40
 
 
41
select_all:
 
42
        SELECT * FROM table_name ;
 
43
 
 
44
create_definition:
 
45
        CREATE temporary TABLE IF NOT EXISTS { $table_name } (
 
46
                f1 column_def_index ,
 
47
                f2 column_def_index ,
 
48
                f3 column_def ,
 
49
                f4 column_def ,
 
50
                f5 column_def ,
 
51
                index_definition_list
 
52
        ) ENGINE=HEAP /*executor1 ROW_FORMAT = dynamic_fixed KEY_BLOCK_SIZE = key_block_size */ ;
 
53
 
 
54
temporary:
 
55
        | | | | | | TEMPORARY ;
 
56
 
 
57
dynamic_fixed:
 
58
        DYNAMIC | DYNAMIC | DYNAMIC | DYNAMIC | DYNAMIC |
 
59
        DYNAMIC | DYNAMIC | DYNAMIC | DYNAMIC | FIXED ;
 
60
 
 
61
insert:
 
62
        insert_multi | insert_multi | insert_select ;
 
63
 
 
64
insert_multi:
 
65
        INSERT IGNORE INTO table_name VALUES row_list ;
 
66
 
 
67
insert_select:
 
68
        INSERT IGNORE INTO table_name select_all;
 
69
 
 
70
row_list:
 
71
        row , row , row , row |
 
72
        row_list , row ;
 
73
 
 
74
row:
 
75
        ( value , value , value , value , value ) ;
 
76
 
 
77
index_definition_list:
 
78
        index_definition |
 
79
        index_definition , index_definition ;
 
80
 
 
81
index_definition:
 
82
        index_type ( index_column_list ) USING btree_hash ;
 
83
 
 
84
btree_hash:
 
85
        BTREE | HASH ;
 
86
 
 
87
index_type:
 
88
        KEY | KEY | KEY | KEY | PRIMARY KEY ;
 
89
 
 
90
index_column_list:
 
91
        f1 | f2 | f1 , f2 | f2 , f1 |
 
92
        f1 ( index_column_size ) | f2 ( index_column_size ) |
 
93
        f1 ( index_column_size ) , f2 ( index_column_size ) |
 
94
        f2 ( index_column_size ) , f1 ( index_column_size ) ;   
 
95
 
 
96
index_column_size:
 
97
        1 | 2 | 32 ;
 
98
 
 
99
key_block_size:
 
100
        512 | 1024 | 2048 | 3072 ;
 
101
 
 
102
column_def:
 
103
        VARCHAR ( size_varchar ) character_set not_null default |
 
104
        VARCHAR ( size_varchar ) collation not_null default |
 
105
        VARBINARY ( size_varchar ) |
 
106
        blob not_null |
 
107
        blob not_null |
 
108
        blob not_null ;
 
109
 
 
110
character_set:
 
111
        | CHARACTER SET utf8 ;
 
112
 
 
113
collation:
 
114
        | COLLATE utf8_bin ;
 
115
 
 
116
column_def_index:
 
117
        VARCHAR ( size_index ) character_set not_null default |
 
118
        VARCHAR ( size_index ) collation not_null default ;
 
119
 
 
120
size_varchar:
 
121
        32 | 128 | 512 | 1024  ;
 
122
 
 
123
size_index:
 
124
        32 | 128 ;
 
125
 
 
126
blob:
 
127
        BLOB | BLOB ( blob_size ) | MEDIUMBLOB | TINYBLOB | LONGBLOB |
 
128
        TEXT character_set |
 
129
        TEXT collation |
 
130
        TEXT ( blob_size ) character_set  |
 
131
        TEXT ( blob_size ) collation |
 
132
        MEDIUMTEXT | TINYTEXT | LONGTEXT ;
 
133
 
 
134
blob_size:
 
135
        1024 | 65525 ;  
 
136
 
 
137
not_null:
 
138
        | NOT NULL ;
 
139
 
 
140
default:
 
141
        | DEFAULT _varchar(32) ;
 
142
 
 
143
unique:
 
144
        | UNIQUE ;
 
145
 
 
146
table_name:
 
147
        connection_specific_table |
 
148
        connection_specific_table |
 
149
        connection_specific_table |
 
150
        connection_specific_table |
 
151
        connection_specific_table |
 
152
        global_table ;
 
153
 
 
154
connection_specific_table:
 
155
        { 'local_'.$generator->threadId().'_'.$prng->int(1,5) } ;
 
156
 
 
157
global_table:
 
158
        global_1 | global_2 | global_3 | global_4 | global_5 ;
 
159
 
 
160
set_table_name:
 
161
        { $table_name = $prng->int(1,5) <= 4 ? 'local_'.$generator->threadId().'_'.$prng->int(1,5) : 'global_'.$prng->int(1,5) ; return undef ; } ;
 
162
 
 
163
value_list:
 
164
        value , value |
 
165
        value , value_list ;
 
166
 
 
167
value:
 
168
        short_value | long_value ;
 
169
 
 
170
short_value:
 
171
        _digit | _varchar(1) | NULL | _english ;
 
172
 
 
173
long_value:
 
174
        REPEAT( _varchar(128) , _digit ) | NULL | _data ;
 
175
 
 
176
select:
 
177
        SELECT field_name FROM table_name WHERE where order_by ;
 
178
 
 
179
order_by:
 
180
        ORDER BY field_name desc_asc ;
 
181
 
 
182
desc_asc:
 
183
        DESC | ASC ;
 
184
 
 
185
update:
 
186
        UPDATE table_name SET field_name = value WHERE where ;
 
187
 
 
188
delete:
 
189
        DELETE FROM table_name WHERE where ;
 
190
 
 
191
field_name:
 
192
        f1 | f2 | f3 | f4 | f5 ;
 
193
 
 
194
where:
 
195
        (field_name cmp_op value ) and_or where |
 
196
        field_name cmp_op value |
 
197
        field_name not IN ( value_list ) |
 
198
        field_name BETWEEN value AND value ;
 
199
 
 
200
and_or:
 
201
        AND | OR ;
 
202
 
 
203
not:
 
204
        | NOT ;
 
205
 
 
206
cmp_op:
 
207
        < | > | = | <= | >= | <> | <=> | != ;