1
################################################################################
2
# t/partition_basic_innodb.test #
5
# Tests around Create Partitioned table using DATA/INDEX DIR #
8
#------------------------------------------------------------------------------#
9
# Original Author: mleich #
10
# Original Date: 2006-03-05 #
11
# Change Author: mattiasj #
12
# Change Date: 2008-02-05 #
13
# Change: copied it from partition_basic_innodb.test and kept DATA DIR #
14
# Change Author: mattiasj #
15
# Change Date: 2008-03-16 #
16
# Change: Replaced all test with alter -> myisam, since innodb does not support#
17
# DATA/INDEX DIRECTORY #
18
################################################################################
20
# NOTE: Until InnoDB supports DATA/INDEX DIR, test that a partitioned table
21
# remembers the DATA/INDEX DIR and it is used if altered to MyISAM
23
--echo # Will not run partition_basic_symlink on InnoDB, since it is the same
24
--echo # as partition_basic, since InnoDB does not support DATA/INDEX DIR
25
--echo # Will only verify that the DATA/INDEX DIR is stored and used if
26
--echo # ALTER to MyISAM.
27
--source include/have_innodb.inc
28
# The server must support partitioning.
29
--source include/have_partition.inc
30
# The server must support symlink for DATA/INDEX DIRECTORY.
31
--source include/have_symlink.inc
32
# windows does not support symlink for DATA/INDEX DIRECTORY.
33
--source include/not_windows.inc
36
DROP TABLE IF EXISTS t1;
38
--mkdir $MYSQLTEST_VARDIR/mysql-test-data-dir
39
--mkdir $MYSQLTEST_VARDIR/mysql-test-idx-dir
40
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
41
eval CREATE TABLE t1 (c1 INT)
43
PARTITION BY HASH (c1)
45
DATA DIRECTORY = '$MYSQLTEST_VARDIR/mysql-test-data-dir'
46
INDEX DIRECTORY = '$MYSQLTEST_VARDIR/mysql-test-idx-dir',
48
DATA DIRECTORY = '$MYSQLTEST_VARDIR/mysql-test-data-dir'
49
INDEX DIRECTORY = '$MYSQLTEST_VARDIR/mysql-test-idx-dir'
51
--echo # Verifying .frm and .par files
52
--file_exists $MYSQLTEST_VARDIR/master-data/test/t1.frm
53
--file_exists $MYSQLTEST_VARDIR/master-data/test/t1.par
54
--echo # Verifying that there are no MyISAM files
56
--file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD
58
--file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI
60
--file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD
62
--file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI
64
--file_exists $MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#p0.MYD
66
--file_exists $MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#p0.MYI
68
--file_exists $MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#p1.MYD
70
--file_exists $MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#p1.MYI
72
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
74
ALTER TABLE t1 ENGINE = MyISAM;
75
--echo # Verifying .frm, .par and MyISAM files (.MYD, MYI)
76
--file_exists $MYSQLTEST_VARDIR/master-data/test/t1.frm
77
--file_exists $MYSQLTEST_VARDIR/master-data/test/t1.par
78
--file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD
79
--file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI
80
--file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD
81
--file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI
82
--file_exists $MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#p0.MYD
83
--file_exists $MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#p0.MYI
84
--file_exists $MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#p1.MYD
85
--file_exists $MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#p1.MYI
87
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
90
--rmdir $MYSQLTEST_VARDIR/mysql-test-data-dir
91
--rmdir $MYSQLTEST_VARDIR/mysql-test-idx-dir
93
# here is the old test, which is tested by partition_basic_innodb
96
# NOTE: PLEASE DO NOT ADD NOT INNODB SPECIFIC TESTCASES HERE !
97
# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN
98
# THE SOURCED FILES ONLY.
100
# Please read the README at the end of inc/partition.pre before changing
101
# any of the variables.
104
#------------------------------------------------------------------------------#
105
# General not engine specific settings and requirements
107
##### Options, for debugging support #####
109
let $with_partitioning= 1;
111
##### Option, for displaying files #####
114
##### Number of rows for the INSERT/UPDATE/DELETE/SELECT experiments #####
115
# on partioned tables
118
##### Execute more tests #####
119
let $more_trigger_tests= 0;
120
let $more_pk_ui_tests= 0;
122
# The server must support partitioning.
123
--source include/have_partition.inc
124
# The server must support symlink for DATA/INDEX DIRECTORY.
125
--source include/have_symlink.inc
126
# windows does not support symlink for DATA/INDEX DIRECTORY.
127
--source include/not_windows.inc
129
#------------------------------------------------------------------------------#
130
# Engine specific settings and requirements
132
##### Storage engine to be tested
133
--source include/have_innodb.inc
134
let $engine= 'InnoDB';
136
##### Execute the test of "table" files
137
# InnoDB has no files per PK, UI, ...
138
let $do_file_tests= 0;
140
##### Execute PRIMARY KEY tests #####
141
# AFAIK InnoDB clusters the table around PRIMARY KEYs.
144
##### Assign a big number smaller than the maximum value for partitions #####
145
# and smaller than the maximum value of SIGNED INTEGER
146
let $MAX_VALUE= (2147483646);
148
# Generate the prerequisites ($variables, @variables, tables) needed
149
--source suite/parts/inc/partition.pre
151
##### Workarounds for known open engine specific bugs
154
#------------------------------------------------------------------------------#
155
# Execute the tests to be applied to all storage engines
156
--source suite/parts/inc/partition_basic_symlink.inc
158
#------------------------------------------------------------------------------#
159
# Execute storage engine specific tests
161
#------------------------------------------------------------------------------#
163
--source suite/parts/inc/partition_cleanup.inc