diff options
Diffstat (limited to 'mysql-test/suite/parts/t')
7 files changed, 269 insertions, 39 deletions
diff --git a/mysql-test/suite/parts/t/disabled.def b/mysql-test/suite/parts/t/disabled.def index 97dce441cc2..408a624e707 100644 --- a/mysql-test/suite/parts/t/disabled.def +++ b/mysql-test/suite/parts/t/disabled.def @@ -7,19 +7,14 @@ part_supported_sql_func_ndb : cannot create t1 partition_alter1_ndb : timeout. Needs too much time. partition_alter2_ndb : cannot create t1 partition_basic_ndb : cannot create t1 -partition_bit_myisam : BUG#34225 2008-02-02 mats test suit parts uses /tmp-dir instead of mysql-test dir, which causes failures partition_bit_ndb : cannot create t1 -partition_char_myisam : BUG#34225 2008-02-02 mats test suit parts uses /tmp-dir instead of mysql-test dir, which causes failures -partition_datetime_myisam : BUG#34225 2008-02-02 mats test suit parts uses /tmp-dir instead of mysql-test dir, which causes failures -partition_decimal_myisam : BUG#34225 2008-02-02 mats test suit parts uses /tmp-dir instead of mysql-test dir, which causes failures partition_engine_ndb : cannot create t1 -partition_float_myisam : BUG#34225 2008-02-02 mats test suit parts uses /tmp-dir instead of mysql-test dir, which causes failures -partition_int_myisam : BUG#34225 2008-02-02 mats test suit parts uses /tmp-dir instead of mysql-test dir, which causes failures partition_int_ndb : cannot create t1 partition_sessions : needs system_3_init.inc -partition_special_myisam : BUG#34225 2008-02-02 mats test suit parts uses /tmp-dir instead of mysql-test dir, which causes failures partition_syntax_ndb : cannot create t1 partition_value_innodb : Bug#30581 partition_value tests use disallowed CAST() function partition_value_myisam : Bug#30581 partition_value tests use disallowed CAST() function partition_value_ndb : cannot create t1 rpl_ndb_dd_partitions : cannot create t1 +partition_alter4_myisam : Bug#20129 / WL#4176 +partition_alter4_innodb : Bug#20129 / WL#4176 diff --git a/mysql-test/suite/parts/t/ndb_partition_key.test b/mysql-test/suite/parts/t/ndb_partition_key.test index fb0581eb6f6..36a8a1863aa 100644 --- a/mysql-test/suite/parts/t/ndb_partition_key.test +++ b/mysql-test/suite/parts/t/ndb_partition_key.test @@ -75,6 +75,14 @@ drop table t1; CREATE TABLE t1 (a int not null primary key); ALTER TABLE t1 +ENGINE = NDB +PARTITION BY KEY(a) +(PARTITION p0 ENGINE = NDB, PARTITION p1 ENGINE = NDB); + +drop table t1; + +CREATE TABLE t1 (a int not null primary key) ENGINE = NDB; +ALTER TABLE t1 PARTITION BY KEY(a) (PARTITION p0 ENGINE = NDB, PARTITION p1 ENGINE = NDB); @@ -112,7 +120,9 @@ show create table t1; alter table t1 remove partitioning; show create table t1; ---error ER_MIX_HANDLER_ERROR +#--error ER_MIX_HANDLER_ERROR +# after fixing bug#31931 this works +# since it already have ndb on table level alter table t1 partition by key(a) (partition p0 engine=ndb, partition p1); diff --git a/mysql-test/suite/parts/t/partition_basic_innodb.test b/mysql-test/suite/parts/t/partition_basic_innodb.test index 2c3e172014c..d3d5916886b 100644 --- a/mysql-test/suite/parts/t/partition_basic_innodb.test +++ b/mysql-test/suite/parts/t/partition_basic_innodb.test @@ -51,8 +51,8 @@ let $more_pk_ui_tests= 0; let $engine= 'InnoDB'; ##### Execute the test of "table" files -# InnoDB has no files per PK, UI, ... -let $do_file_tests= 0; +# InnoDB has no files per PK, UI, ... But only .frm file +let $do_file_tests= 1; ##### Execute PRIMARY KEY tests ##### # AFAIK InnoDB clusters the table around PRIMARY KEYs. diff --git a/mysql-test/suite/parts/t/partition_basic_myisam.test b/mysql-test/suite/parts/t/partition_basic_myisam.test index c363d06b00a..8d84982335c 100644 --- a/mysql-test/suite/parts/t/partition_basic_myisam.test +++ b/mysql-test/suite/parts/t/partition_basic_myisam.test @@ -48,9 +48,6 @@ let $more_pk_ui_tests= 0; ##### Storage engine to be tested let $engine= 'MyISAM'; -# The server uses in case of MyISAM symlinking (if available) and the expected -# results fit to symlinking support. ---source include/have_symlink.inc ##### Execute the test of "table" files # MyISAM has files per PK, UI, ... diff --git a/mysql-test/suite/parts/t/partition_basic_symlink_innodb.test b/mysql-test/suite/parts/t/partition_basic_symlink_innodb.test new file mode 100644 index 00000000000..51e6397c018 --- /dev/null +++ b/mysql-test/suite/parts/t/partition_basic_symlink_innodb.test @@ -0,0 +1,163 @@ +################################################################################ +# t/partition_basic_innodb.test # +# # +# Purpose: # +# Tests around Create Partitioned table using DATA/INDEX DIR # +# InnoDB branch # +# # +#------------------------------------------------------------------------------# +# Original Author: mleich # +# Original Date: 2006-03-05 # +# Change Author: mattiasj # +# Change Date: 2008-02-05 # +# Change: copied it from partition_basic_innodb.test and kept DATA DIR # +# Change Author: mattiasj # +# Change Date: 2008-03-16 # +# Change: Replaced all test with alter -> myisam, since innodb does not support# +# DATA/INDEX DIRECTORY # +################################################################################ + +# NOTE: Until InnoDB supports DATA/INDEX DIR, test that a partitioned table +# remembers the DATA/INDEX DIR and it is used if altered to MyISAM +# +--echo # Will not run partition_basic_symlink on InnoDB, since it is the same +--echo # as partition_basic, since InnoDB does not support DATA/INDEX DIR +--echo # Will only verify that the DATA/INDEX DIR is stored and used if +--echo # ALTER to MyISAM. +--source include/have_innodb.inc +# The server must support partitioning. +--source include/have_partition.inc +# The server must support symlink for DATA/INDEX DIRECTORY. +--source include/have_symlink.inc +# windows does not support symlink for DATA/INDEX DIRECTORY. +--source include/not_windows.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings +--mkdir $MYSQLTEST_VARDIR/mysql-test-data-dir +--mkdir $MYSQLTEST_VARDIR/mysql-test-idx-dir +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +eval CREATE TABLE t1 (c1 INT) +ENGINE = InnoDB +PARTITION BY HASH (c1) +(PARTITION p0 + DATA DIRECTORY = '$MYSQLTEST_VARDIR/mysql-test-data-dir' + INDEX DIRECTORY = '$MYSQLTEST_VARDIR/mysql-test-idx-dir', + PARTITION p1 + DATA DIRECTORY = '$MYSQLTEST_VARDIR/mysql-test-data-dir' + INDEX DIRECTORY = '$MYSQLTEST_VARDIR/mysql-test-idx-dir' +); +--echo # Verifying .frm and .par files +--file_exists $MYSQLTEST_VARDIR/master-data/test/t1.frm +--file_exists $MYSQLTEST_VARDIR/master-data/test/t1.par +--echo # Verifying that there are no MyISAM files +--error 1 +--file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD +--error 1 +--file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI +--error 1 +--file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD +--error 1 +--file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI +--error 1 +--file_exists $MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#p0.MYD +--error 1 +--file_exists $MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#p0.MYI +--error 1 +--file_exists $MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#p1.MYD +--error 1 +--file_exists $MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#p1.MYI +FLUSH TABLES; +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +SHOW CREATE TABLE t1; +ALTER TABLE t1 ENGINE = MyISAM; +--echo # Verifying .frm, .par and MyISAM files (.MYD, MYI) +--file_exists $MYSQLTEST_VARDIR/master-data/test/t1.frm +--file_exists $MYSQLTEST_VARDIR/master-data/test/t1.par +--file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYD +--file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p0.MYI +--file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYD +--file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p1.MYI +--file_exists $MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#p0.MYD +--file_exists $MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#p0.MYI +--file_exists $MYSQLTEST_VARDIR/mysql-test-data-dir/t1#P#p1.MYD +--file_exists $MYSQLTEST_VARDIR/mysql-test-idx-dir/t1#P#p1.MYI +FLUSH TABLES; +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +SHOW CREATE TABLE t1; +DROP TABLE t1; +--rmdir $MYSQLTEST_VARDIR/mysql-test-data-dir +--rmdir $MYSQLTEST_VARDIR/mysql-test-idx-dir +--exit +# here is the old test, which is tested by partition_basic_innodb + +# +# NOTE: PLEASE DO NOT ADD NOT INNODB SPECIFIC TESTCASES HERE ! +# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN +# THE SOURCED FILES ONLY. +# +# Please read the README at the end of inc/partition.pre before changing +# any of the variables. +# + +#------------------------------------------------------------------------------# +# General not engine specific settings and requirements + +##### Options, for debugging support ##### +let $debug= 0; +let $with_partitioning= 1; + +##### Option, for displaying files ##### +let $ls= 1; + +##### Number of rows for the INSERT/UPDATE/DELETE/SELECT experiments ##### +# on partioned tables +SET @max_row = 20; + +##### Execute more tests ##### +let $more_trigger_tests= 0; +let $more_pk_ui_tests= 0; + +# The server must support partitioning. +--source include/have_partition.inc +# The server must support symlink for DATA/INDEX DIRECTORY. +--source include/have_symlink.inc +# windows does not support symlink for DATA/INDEX DIRECTORY. +--source include/not_windows.inc + +#------------------------------------------------------------------------------# +# Engine specific settings and requirements + +##### Storage engine to be tested +--source include/have_innodb.inc +let $engine= 'InnoDB'; + +##### Execute the test of "table" files +# InnoDB has no files per PK, UI, ... +let $do_file_tests= 0; + +##### Execute PRIMARY KEY tests ##### +# AFAIK InnoDB clusters the table around PRIMARY KEYs. +let $do_pk_tests= 1; + +##### Assign a big number smaller than the maximum value for partitions ##### +# and smaller than the maximum value of SIGNED INTEGER +let $MAX_VALUE= (2147483646); + +# Generate the prerequisites ($variables, @variables, tables) needed +--source suite/parts/inc/partition.pre + +##### Workarounds for known open engine specific bugs +# none + +#------------------------------------------------------------------------------# +# Execute the tests to be applied to all storage engines +--source suite/parts/inc/partition_basic_symlink.inc + +#------------------------------------------------------------------------------# +# Execute storage engine specific tests + +#------------------------------------------------------------------------------# +# Cleanup +--source suite/parts/inc/partition_cleanup.inc diff --git a/mysql-test/suite/parts/t/partition_basic_symlink_myisam.test b/mysql-test/suite/parts/t/partition_basic_symlink_myisam.test new file mode 100644 index 00000000000..8a12f8e8b39 --- /dev/null +++ b/mysql-test/suite/parts/t/partition_basic_symlink_myisam.test @@ -0,0 +1,86 @@ +################################################################################ +# t/partition_basic_myisam.test # +# # +# Purpose: # +# Tests around Create Partitioned table using DATA/INDEX DIR # +# MyISAM branch # +# # +#------------------------------------------------------------------------------# +# Original Author: mleich # +# Original Date: 2006-03-05 # +# Change Author: mattiasj # +# Change Date: 2008-02-05 # +# Change: copied it from partition_basic_myisam.test and kept DATA DIR # +################################################################################ + +# +# NOTE: PLEASE DO NOT ADD NOT MYISAM SPECIFIC TESTCASES HERE ! +# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN +# THE SOURCED FILES ONLY. +# +# Please read the README at the end of inc/partition.pre before changing +# any of the variables. +# + +#------------------------------------------------------------------------------# +# General not engine specific settings and requirements + +##### Options, for debugging support ##### +let $debug= 0; +let $with_partitioning= 1; + +##### Option, for displaying files ##### +let $ls= 1; + +##### Number of rows for the INSERT/UPDATE/DELETE/SELECT experiments ##### +# on partioned tables +SET @max_row = 20; + +##### Execute more tests ##### +let $more_trigger_tests= 0; +let $more_pk_ui_tests= 0; + +# The server must support partitioning. +--source include/have_partition.inc +# The server must support symlink for DATA/INDEX DIRECTORY. +--source include/have_symlink.inc +# windows does not support symlink for DATA/INDEX DIRECTORY. +--source include/not_windows.inc + +#------------------------------------------------------------------------------# +# Engine specific settings and requirements + +##### Storage engine to be tested +let $engine= 'MyISAM'; +# The server uses in case of MyISAM symlinking (if available) and the expected +# results fit to symlinking support. +--source include/have_symlink.inc + +##### Execute the test of "table" files +# MyISAM has files per PK, UI, ... +let $do_file_tests= 1; + +##### Execute PRIMARY KEY tests ##### +# AFAIK MyISAM treats PRIMARY KEYs like UNIQUE INDEXes +let $do_pk_tests= 0; + +##### Assign a big number smaller than the maximum value for partitions ##### +# and smaller than the maximum value of SIGNED INTEGER +let $MAX_VALUE= (2147483646); + +# Generate the prerequisites ($variables, @variables, tables) needed +--source suite/parts/inc/partition.pre + +##### Workarounds for known open engine specific bugs +# none + +#------------------------------------------------------------------------------# +# Execute the tests to be applied to all storage engines +--source suite/parts/inc/partition_basic_symlink.inc + +#------------------------------------------------------------------------------# +# Execute storage engine specific tests + +#------------------------------------------------------------------------------# +# Cleanup +--source suite/parts/inc/partition_cleanup.inc diff --git a/mysql-test/suite/parts/t/partition_sessions.test b/mysql-test/suite/parts/t/partition_sessions.test index ef3c5ef6a97..3d59292bee5 100644 --- a/mysql-test/suite/parts/t/partition_sessions.test +++ b/mysql-test/suite/parts/t/partition_sessions.test @@ -27,27 +27,6 @@ f4 datetime; let $col_access_list = f1,f2,f3,f4 ; let $col_new_list = new.f1,new.f2,new.f3 new.f4 ; -#-------------------------------------------------- -# initialize directories for partitions -#-------------------------------------------------- - ---disable_query_log -# DATA DIRECTORY -# Make directory for partition data ---exec mkdir $MYSQLTEST_VARDIR/master-data/tmpdata || true -eval SET @data_dir = 'DATA DIRECTORY = -''$MYSQLTEST_VARDIR/master-data/tmpdata'''; -let $data_directory = `select @data_dir`; - -#INDEX DIRECTORY -# Make directory for partition index ---exec mkdir $MYSQLTEST_VARDIR/master-data/tmpindex || true -eval SET @indx_dir = 'INDEX DIRECTORY = -''$MYSQLTEST_VARDIR/master-data/tmpindex'''; -let $index_directory = `select @indx_dir`; ---enable_query_log - - #--------------------------------------------------- # Setting the parameters to use during testing #--------------------------------------------------- @@ -134,16 +113,16 @@ create table test_stat ( # tb3_eng1: key partitioning #---------------------------------------------------------------------- -#--replace_result $data_directory <data_directory> $index_directory <index_directory> $ENG1 ENG1 +#--replace_result $ENG1 ENG1 eval create table tb3_eng1 ( i1 int NOT NULL auto_increment, primary key (i1), $column_list ) engine=$ENG1 PARTITION BY KEY (i1) PARTITIONS 4 -(PARTITION part1 $data_directory $index_directory, -PARTITION part2 $data_directory $index_directory, -PARTITION part3 $data_directory $index_directory, -PARTITION part4 $data_directory $index_directory); +(PARTITION part1, +PARTITION part2, +PARTITION part3, +PARTITION part4); #--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR eval load data local infile '$MYSQL_TEST_DIR/suite/system_3/data/tb1.txt' |