################################################################################
# t/partition_special_myisam.test                                                 #
#                                                                              #
# Purpose:                                                                     #
#  different Tests                                                             #
#        MYISAM branch                                                         #
#                                                                              #
#------------------------------------------------------------------------------#
# Original Author: HH                                                          #
# Original Date: 2006-08-01                                                    #
# Change Author:                                                               #
# Change Date:                                                                 #
# Change:                                                                      #
################################################################################

#
# 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;

# The server must support partitioning.
--source include/have_partition.inc

#------------------------------------------------------------------------------#
# Engine specific settings and requirements

##### Storage engine to be tested
let $engine= 'MyISAM';

#------------------------------------------------------------------------------#
# Execute the tests to be applied to all storage engines
--source suite/parts/inc/partition_key_4col.inc
--source suite/parts/inc/partition_key_8col.inc
--source suite/parts/inc/partition_key_16col.inc
--source suite/parts/inc/partition_key_32col.inc

--echo #
--echo # Bug#53770: Server crash at handler.cc:2076 on LOAD DATA
--echo #            after timed out COALESCE PARTITION
CREATE TABLE t1 ( i INT NOT NULL AUTO_INCREMENT PRIMARY KEY, f INT )
        ENGINE = MyISAM PARTITION BY HASH(i) PARTITIONS 3;

--echo # Connection 1 starts transaction and gets lock
START TRANSACTION;
SELECT * FROM t1;

--connect (con2,localhost,root,,)
SET lock_wait_timeout = 2;
--echo # Connection 2 tries to coalesce partitions (timeout):
--error ER_LOCK_WAIT_TIMEOUT
ALTER TABLE t1 COALESCE PARTITION 2;

--connect (con3,localhost,root,,)

--let $MYSQLD_DATADIR= `SELECT @@datadir`
--write_file $MYSQLD_DATADIR/test/load.in
1
2
3
EOF
--echo # Connection 3 tries to load into the table:
send LOAD DATA INFILE 'load.in' INTO TABLE t1 (f);

--connection default
--real_sleep 1
--echo # Connection 1 commits the transaction
COMMIT;

--connection con3
--echo # Connection 3...
--reap
DROP TABLE t1;

--disconnect con3
--disconnect con2
--connection default
