| 1 |
########################################################################## |
| 2 |
# Test script to test RECOVERY of table having INSTANT ADD columns in |
| 3 |
# older version. |
| 4 |
########################################################################## |
| 5 |
|
| 6 |
--source include/have_lowercase0.inc |
| 7 |
--source include/have_debug.inc |
| 8 |
let $is_debug=1; |
| 9 |
|
| 10 |
# ------------------------------------------------------------ |
| 11 |
# Tables created on earlier version with following |
| 12 |
# ------------------------------------------------------------ |
| 13 |
# create table t1_redundant(c1 char(10), c2 char(10)) ROW_FORMAT=REDUNDANT; |
| 14 |
# insert into t1_redundant values ("r1c1", "r1c2"); |
| 15 |
# alter table t1_redundant add column c3 char(10), algorithm=instant; |
| 16 |
# |
| 17 |
# create table t1_compact(c1 char(10), c2 char(10)) ROW_FORMAT=COMPACT; |
| 18 |
# insert into t1_compact values ("r1c1", "r1c2"); |
| 19 |
# alter table t1_compact add column c3 char(10), algorithm=instant; |
| 20 |
# |
| 21 |
# create table t1_dynamic(c1 char(10), c2 char(10)) ROW_FORMAT=DYNAMIC; |
| 22 |
# insert into t1_dynamic values ("r1c1", "r1c2"); |
| 23 |
# alter table t1_dynamic add column c3 char(10), algorithm=instant; |
| 24 |
# ------------------------------------------------------------ |
| 25 |
|
| 26 |
--echo ######### |
| 27 |
--echo # SETUP # |
| 28 |
--echo ######### |
| 29 |
|
| 30 |
--echo # Stop the running the server |
| 31 |
--source include/shutdown_mysqld.inc |
| 32 |
|
| 33 |
--echo # Copy and unzip the datadir. |
| 34 |
--copy_file $MYSQLTEST_VARDIR/std_data/instant_ddl/recv_old_datadir.zip $MYSQL_TMP_DIR/recv_old_datadir.zip |
| 35 |
--file_exists $MYSQL_TMP_DIR/recv_old_datadir.zip |
| 36 |
--exec unzip -qo $MYSQL_TMP_DIR/recv_old_datadir.zip -d $MYSQL_TMP_DIR |
| 37 |
let $DATADIR = $MYSQL_TMP_DIR/data; |
| 38 |
|
| 39 |
--echo # Restart the server against the unzipped datadir |
| 40 |
--replace_result $DATADIR DATADIR |
| 41 |
--let $restart_parameters = restart: --datadir=$DATADIR --innodb-page-size=16k |
| 42 |
--let $wait_counter=3000 |
| 43 |
--source include/start_mysqld.inc |
| 44 |
|
| 45 |
--echo ############################################## |
| 46 |
--echo # Test instant ADD COLUMN for REDUNDANT format |
| 47 |
--echo ############################################## |
| 48 |
let $row_format = redundant; |
| 49 |
--source suite/innodb/include/instant_ddl_recovery_old_2.inc |
| 50 |
|
| 51 |
--echo ############################################ |
| 52 |
--echo # Test instant ADD COLUMN for DYNAMIC format |
| 53 |
--echo ############################################ |
| 54 |
let $row_format = dynamic; |
| 55 |
--source suite/innodb/include/instant_ddl_recovery_old_2.inc |
| 56 |
|
| 57 |
--echo ############################################ |
| 58 |
--echo # Test instant ADD COLUMN for COMPACT format |
| 59 |
--echo ############################################ |
| 60 |
let $row_format = compact; |
| 61 |
--source suite/innodb/include/instant_ddl_recovery_old_2.inc |
| 62 |
|
| 63 |
--echo ########### |
| 64 |
--echo # CLEANUP # |
| 65 |
--echo ########### |
| 66 |
|
| 67 |
--echo # Shutdown server |
| 68 |
--source include/shutdown_mysqld.inc |
| 69 |
|
| 70 |
--echo # Remove copied files |
| 71 |
--file_exists $MYSQL_TMP_DIR/recv_old_datadir.zip |
| 72 |
--force-rmdir $MYSQL_TMP_DIR/data |
| 73 |
--remove_file $MYSQL_TMP_DIR/recv_old_datadir.zip |
| 74 |
|
| 75 |
--echo # Restarting server to restore server state |
| 76 |
let $restart_parameters =; |
| 77 |
--source include/start_mysqld.inc |