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

« back to all changes in this revision

Viewing changes to tests/randgen/conf/partitioning/partitions-ddl.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) 2008-2009 Sun Microsystems, Inc. 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
 
query_init:
19
 
        create ; create ; create ; create ; create ; create ; create ; create ; create ; create ;
20
 
 
21
 
query:
22
 
        select_explain | select_explain | 
23
 
        select | select | select | select | select | select |
24
 
        select | select | select | select | select | select |
25
 
        select | select | select | select | select | select |
26
 
 
27
 
        insert | update | delete | insert | update | delete |
28
 
        insert | update | delete | insert | update | delete |
29
 
        insert | update | delete | insert | update | delete |
30
 
 
31
 
        create | create | drop | alter |
32
 
        cache_index | load_index |
33
 
        set_key_buffer_size | set_key_cache_block_size ;
34
 
 
35
 
cache_index:
36
 
        CACHE INDEX table_name IN cache_name |
37
 
        CACHE INDEX _letter /*!50400 PARTITION ( ALL ) */ IN cache_name |
38
 
        CACHE INDEX _letter /*!50400 PARTITION ( partition_name_list ) */ IN cache_name ;
39
 
 
40
 
load_index:
41
 
        LOAD INDEX INTO CACHE table_name ignore_leaves |
42
 
        LOAD INDEX INTO CACHE _letter /*!50400 PARTITION ( ALL ) */ ignore_leaves |
43
 
        LOAD INDEX INTO CACHE _letter /*!50400 PARTITION ( partition_name_list ) */ ignore_leaves ;
44
 
 
45
 
ignore_leaves:
46
 
        | IGNORE LEAVES ;
47
 
 
48
 
set_key_buffer_size:
49
 
        /*!50400 SET GLOBAL cache_name . key_buffer_size = _tinyint_unsigned  */ |
50
 
        /*!50400 SET GLOBAL cache_name . key_buffer_size = _smallint_unsigned */ |
51
 
        /*!50400 SET GLOBAL cache_name . key_buffer_size = _mediumint_unsigned */ ;
52
 
 
53
 
set_key_cache_block_size:
54
 
        /*!50400 SET GLOBAL key_cache_block_size = key_cache_block_size_enum */ ;
55
 
 
56
 
key_cache_block_size_enum:
57
 
        512 | 1024 | 2048 | 4096 | 8192 | 16384 ;       
58
 
                
59
 
cache_name:
60
 
        c1 | c2 | c3 | c4;
61
 
 
62
 
select_explain:
63
 
        EXPLAIN /*!50100 PARTITIONS */ SELECT _field FROM table_name where ;
64
 
 
65
 
select:
66
 
        SELECT `col_int_nokey` % 10 AS `col_int_nokey` , `col_int_key` % 10 AS `col_int_key` FROM table_name where ;
67
 
 
68
 
# WHERE clauses suitable for partition pruning
69
 
where:
70
 
        | |
71
 
        WHERE _field comparison_operator value |
72
 
        WHERE _field BETWEEN value AND value ;
73
 
 
74
 
comparison_operator:
75
 
        > | < | = | <> | != | >= | <= ;
76
 
 
77
 
insert:
78
 
        insert_replace INTO table_name ( `col_int_nokey`, `col_int_key` ) VALUES ( value , value ) , ( value , value ) |
79
 
        insert_replace INTO table_name ( `col_int_nokey`, `col_int_key` ) select ORDER BY `col_int_key` , `col_int_nokey` LIMIT limit_rows ;
80
 
 
81
 
insert_replace:
82
 
        INSERT | REPLACE ;
83
 
 
84
 
update:
85
 
        UPDATE table_name SET _field = value WHERE _field = value ;
86
 
 
87
 
delete:
88
 
        DELETE FROM table_name WHERE _field = value ORDER BY `col_int_key` , `col_int_nokey` LIMIT limit_rows ;
89
 
 
90
 
_field:
91
 
        `col_int_nokey` | `col_int_nokey` ;
92
 
 
93
 
table_name:
94
 
        _letter | _table ;
95
 
 
96
 
value:
97
 
        _digit ;
98
 
 
99
 
# We can not use IF NOT EXISTS here to reduce the "Table doesn't exist errors", because
100
 
# If we run the same grammar on 5.0, the CREATE will always succeed, but in 5.1/5.4 it 
101
 
# can still fail due to a partition type mismatch
102
 
 
103
 
create:
104
 
        CREATE TABLE _letter (
105
 
                `col_int_nokey` INTEGER,
106
 
                `col_int_key` INTEGER NOT NULL,
107
 
                KEY (`col_int_key`)
108
 
        ) ENGINE = engine /*!50100 partition */ select ;
109
 
 
110
 
drop:
111
 
        DROP TABLE IF EXISTS _letter ;
112
 
 
113
 
alter:
114
 
        /*!50400 ALTER TABLE _letter alter_operation */;
115
 
 
116
 
alter_operation:
117
 
        ENGINE = engine |
118
 
        enable_disable KEYS |
119
 
        ORDER BY _field |
120
 
        partition |
121
 
        ADD PARTITION (PARTITION p3 VALUES LESS THAN MAXVALUE) |
122
 
        ADD PARTITION (PARTITION p3 VALUES LESS THAN MAXVALUE) |
123
 
        COALESCE PARTITION one_two | 
124
 
        REORGANIZE PARTITION |
125
 
        ANALYZE PARTITION partition_name_list |
126
 
        CHECK PARTITION partition_name_list |
127
 
        REBUILD PARTITION partition_name_list |
128
 
        REPAIR PARTITION partition_name_list |
129
 
        OPTIMIZE PARTITION partition_name_list |        # bug47459
130
 
        REMOVE PARTITIONING |                           # bug42438
131
 
        DROP PARTITION partition_name_list |            # DROP and TRUNCATE 
132
 
        TRUNCATE PARTITION partition_name_list          # can not be used in comparison tests against 5.0
133
 
;
134
 
 
135
 
one_two:
136
 
        1 | 2;
137
 
 
138
 
partition_name_list:
139
 
        partition_name |
140
 
        partition_name |
141
 
        partition_name |
142
 
        partition_name_list;
143
 
 
144
 
partition_name:
145
 
        p0 | p1 | p2 | p3 ;
146
 
 
147
 
enable_disable:
148
 
        ENABLE | DISABLE ;
149
 
 
150
 
# Give preference to MyISAM because key caching is specific to MyISAM
151
 
 
152
 
engine:
153
 
        MYISAM | MYISAM | MYISAM |
154
 
        INNODB | MEMORY ;
155
 
 
156
 
partition:
157
 
        |
158
 
        partition_by_range |
159
 
        partition_by_list |
160
 
        partition_by_hash |
161
 
        partition_by_key
162
 
;
163
 
 
164
 
subpartition:
165
 
        |
166
 
        SUBPARTITION BY linear HASH ( _field ) SUBPARTITIONS partition_count ;
167
 
 
168
 
partition_by_range:
169
 
        populate_ranges PARTITION BY RANGE ( _field ) subpartition (
170
 
                PARTITION p0 VALUES LESS THAN ( shift_range ),
171
 
                PARTITION p1 VALUES LESS THAN ( shift_range ),
172
 
                PARTITION p2 VALUES LESS THAN ( shift_range ),
173
 
                PARTITION p3 VALUES LESS THAN MAXVALUE
174
 
        );
175
 
 
176
 
populate_ranges:
177
 
        { @ranges = ($prng->digit(), $prng->int(10,255), $prng->int(256,65535)) ; return undef } ;
178
 
 
179
 
shift_range:
180
 
        { shift @ranges };
181
 
 
182
 
partition_by_list:
183
 
        populate_digits PARTITION BY LIST ( _field ) subpartition (
184
 
                PARTITION p0 VALUES IN ( shift_digit, NULL ),
185
 
                PARTITION p1 VALUES IN ( shift_digit, shift_digit, shift_digit ),
186
 
                PARTITION p2 VALUES IN ( shift_digit, shift_digit, shift_digit ),
187
 
                PARTITION p3 VALUES IN ( shift_digit, shift_digit, shift_digit )
188
 
        );
189
 
 
190
 
populate_digits:
191
 
        { @digits = @{$prng->shuffleArray([0..9])} ; return undef };
192
 
 
193
 
shift_digit:
194
 
        { shift @digits };
195
 
 
196
 
partition_by_hash:
197
 
        PARTITION BY linear HASH ( _field ) PARTITIONS partition_count;
198
 
 
199
 
linear:
200
 
        | LINEAR;
201
 
 
202
 
partition_by_key:
203
 
        PARTITION BY KEY(`col_int_key`) PARTITIONS partition_count ;
204
 
 
205
 
partition_item:
206
 
        PARTITION partition_name VALUES 
207
 
 
208
 
 
209
 
        PARTITION BY partition_hash_or_key;
210
 
 
211
 
partition_hash_or_key:
212
 
        HASH ( field_name ) PARTITIONS partition_count |
213
 
        KEY ( field_name ) PARTITIONS partition_count ;
214
 
 
215
 
limit_rows:
216
 
        1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 ;
217
 
 
218
 
partition_count:
219
 
        1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 ;