~linuxjedi/drizzle/trunk-bug-667053

« back to all changes in this revision

Viewing changes to mysql-test/suite/parts/t/partition_basic_symlink_innodb.test

  • Committer: brian
  • Date: 2008-06-25 05:29:13 UTC
  • Revision ID: brian@localhost.localdomain-20080625052913-6upwo0jsrl4lnapl
clean slate

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
################################################################################
 
2
# t/partition_basic_innodb.test                                                #
 
3
#                                                                              #
 
4
# Purpose:                                                                     #
 
5
#  Tests around Create Partitioned table using DATA/INDEX DIR                  #
 
6
#        InnoDB branch                                                         #
 
7
#                                                                              #
 
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
################################################################################
 
19
 
 
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
 
22
#
 
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
 
34
 
 
35
--disable_warnings
 
36
DROP TABLE IF EXISTS t1;
 
37
--enable_warnings
 
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)
 
42
ENGINE = InnoDB
 
43
PARTITION BY HASH (c1)
 
44
(PARTITION p0
 
45
 DATA DIRECTORY = '$MYSQLTEST_VARDIR/mysql-test-data-dir'
 
46
 INDEX DIRECTORY = '$MYSQLTEST_VARDIR/mysql-test-idx-dir',
 
47
 PARTITION p1
 
48
 DATA DIRECTORY = '$MYSQLTEST_VARDIR/mysql-test-data-dir'
 
49
 INDEX DIRECTORY = '$MYSQLTEST_VARDIR/mysql-test-idx-dir'
 
50
);
 
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
 
55
--error 1
 
56
--file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD
 
57
--error 1
 
58
--file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI
 
59
--error 1
 
60
--file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD
 
61
--error 1
 
62
--file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI
 
63
--error 1
 
64
--file_exists $MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#p0.MYD
 
65
--error 1
 
66
--file_exists $MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#p0.MYI
 
67
--error 1
 
68
--file_exists $MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#p1.MYD
 
69
--error 1
 
70
--file_exists $MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#p1.MYI
 
71
FLUSH TABLES;
 
72
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
 
73
SHOW CREATE TABLE t1;
 
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
 
86
FLUSH TABLES;
 
87
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
 
88
SHOW CREATE TABLE t1;
 
89
DROP TABLE t1;
 
90
--rmdir $MYSQLTEST_VARDIR/mysql-test-data-dir
 
91
--rmdir $MYSQLTEST_VARDIR/mysql-test-idx-dir
 
92
--exit
 
93
# here is the old test, which is tested by partition_basic_innodb
 
94
 
 
95
#
 
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.
 
99
#
 
100
# Please read the README at the end of inc/partition.pre before changing
 
101
# any of the variables.
 
102
#
 
103
 
 
104
#------------------------------------------------------------------------------#
 
105
# General not engine specific settings and requirements
 
106
 
 
107
##### Options, for debugging support #####
 
108
let $debug= 0;
 
109
let $with_partitioning= 1;
 
110
 
 
111
##### Option, for displaying files #####
 
112
let $ls= 1;
 
113
 
 
114
##### Number of rows for the INSERT/UPDATE/DELETE/SELECT experiments #####
 
115
#     on partioned tables
 
116
SET @max_row = 20;
 
117
 
 
118
##### Execute more tests                                             #####
 
119
let $more_trigger_tests= 0;
 
120
let $more_pk_ui_tests= 0;
 
121
 
 
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
 
128
 
 
129
#------------------------------------------------------------------------------#
 
130
# Engine specific settings and requirements
 
131
 
 
132
##### Storage engine to be tested
 
133
--source include/have_innodb.inc
 
134
let $engine= 'InnoDB';
 
135
 
 
136
##### Execute the test of "table" files
 
137
# InnoDB has no files per PK, UI, ...
 
138
let $do_file_tests= 0;
 
139
 
 
140
##### Execute PRIMARY KEY tests                                      #####
 
141
# AFAIK InnoDB clusters the table around PRIMARY KEYs.
 
142
let $do_pk_tests= 1;
 
143
 
 
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);
 
147
 
 
148
# Generate the prerequisites ($variables, @variables, tables) needed
 
149
--source suite/parts/inc/partition.pre
 
150
 
 
151
##### Workarounds for known open engine specific bugs
 
152
#     none
 
153
 
 
154
#------------------------------------------------------------------------------#
 
155
# Execute the tests to be applied to all storage engines
 
156
--source suite/parts/inc/partition_basic_symlink.inc
 
157
 
 
158
#------------------------------------------------------------------------------#
 
159
# Execute storage engine specific tests
 
160
 
 
161
#------------------------------------------------------------------------------#
 
162
# Cleanup
 
163
--source suite/parts/inc/partition_cleanup.inc