1
################################################################################
2
# inc/partition_directory.inc #
5
# Create and check partitioned tables #
6
# The partitioning function use the column f_int1 #
8
# For all Data/Index directory combinations #
10
# 1. Create the partitioned table #
11
# 2 Insert the content of the table t0_template into t1 #
12
# 3. Execute inc/partition_check.inc #
13
# 4. Drop the table t1 #
15
#------------------------------------------------------------------------------#
16
# Original Author: HH #
17
# Original Date: 2006-05-11 #
21
################################################################################
24
DROP TABLE IF EXISTS t1;
28
#----------- PARTITION BY HASH
29
if ($with_partitioning)
31
let $partitioning= PARTITION BY HASH(f_int1) PARTITIONS 2;
32
if ($with_directories)
35
PARTITION BY HASH(f_int1) PARTITIONS 2
42
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
43
eval CREATE TABLE t1 (
49
--source suite/parts/inc/partition_check.inc
51
--source suite/parts/inc/partition_check_drop.inc
53
#----------- PARTITION BY KEY
54
if ($with_partitioning)
56
let $partitioning= PARTITION BY KEY(f_int1) PARTITIONS 5;
57
if ($with_directories)
60
PARTITION BY HASH(f_int1) PARTITIONS 5
73
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
74
eval CREATE TABLE t1 (
80
--source suite/parts/inc/partition_check.inc
82
--source suite/parts/inc/partition_check_drop.inc
84
#----------- PARTITION BY LIST
85
if ($with_partitioning)
88
PARTITION BY LIST(MOD(f_int1,4))
89
(PARTITION part_3 VALUES IN (-3)
91
PARTITION part_2 VALUES IN (-2)
93
PARTITION part_1 VALUES IN (-1)
94
$data_directory $index_directory,
95
PARTITION part_N VALUES IN (NULL)
97
PARTITION part0 VALUES IN (0)
99
PARTITION part1 VALUES IN (1)
101
PARTITION part2 VALUES IN (2)
103
PARTITION part3 VALUES IN (3)
104
$data_directory $index_directory);
106
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
107
eval CREATE TABLE t1 (
113
--source suite/parts/inc/partition_check.inc
115
--source suite/parts/inc/partition_check_drop.inc
117
#----------- PARTITION BY RANGE
118
if ($with_partitioning)
120
let $partitioning= PARTITION BY RANGE(f_int1)
121
(PARTITION parta VALUES LESS THAN (0)
123
PARTITION partb VALUES LESS THAN ($max_row_div4)
125
PARTITION partc VALUES LESS THAN ($max_row_div2)
128
PARTITION partd VALUES LESS THAN ($max_row_div2 + $max_row_div4),
129
PARTITION parte VALUES LESS THAN ($max_row)
131
PARTITION partf VALUES LESS THAN $MAX_VALUE
134
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
135
eval CREATE TABLE t1 (
141
--source suite/parts/inc/partition_check.inc
143
--source suite/parts/inc/partition_check_drop.inc
145
#----------- PARTITION BY RANGE -- SUBPARTITION BY HASH
146
if ($with_partitioning)
149
PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 2
150
(PARTITION parta VALUES LESS THAN (0)
152
PARTITION partb VALUES LESS THAN ($max_row_div4)
154
PARTITION partc VALUES LESS THAN ($max_row_div2),
155
PARTITION partd VALUES LESS THAN $MAX_VALUE
159
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
160
eval CREATE TABLE t1 (
166
--source suite/parts/inc/partition_check.inc
168
--source suite/parts/inc/partition_check_drop.inc
170
#----------- PARTITION BY RANGE -- SUBPARTITION BY KEY
171
if ($with_partitioning)
173
let $partitioning= PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1)
174
(PARTITION part1 VALUES LESS THAN (0)
176
(SUBPARTITION subpart11, SUBPARTITION subpart12),
177
PARTITION part2 VALUES LESS THAN ($max_row_div4)
179
(SUBPARTITION subpart21, SUBPARTITION subpart22),
180
PARTITION part3 VALUES LESS THAN ($max_row_div2)
183
(SUBPARTITION subpart31, SUBPARTITION subpart32),
184
PARTITION part4 VALUES LESS THAN $MAX_VALUE
185
(SUBPARTITION subpart41, SUBPARTITION subpart42));
187
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
188
eval CREATE TABLE t1 (
194
--source suite/parts/inc/partition_check.inc
196
--source suite/parts/inc/partition_check_drop.inc
198
#----------- PARTITION BY LIST -- SUBPARTITION BY HASH
199
if ($with_partitioning)
202
PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 1)
203
(PARTITION part1 VALUES IN (0)
209
PARTITION part2 VALUES IN (1)
215
PARTITION part3 VALUES IN (2)
220
PARTITION part4 VALUES IN (NULL)
228
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
229
eval CREATE TABLE t1 (
235
--source suite/parts/inc/partition_check.inc
237
--source suite/parts/inc/partition_check_drop.inc
239
let $with_directories= FALSE;