| 1 |
########################################################################## |
| 2 |
# Test script to test UPGRADE from older version table having |
| 3 |
# INSTANT ADD columns and try UPDATE/ROLLBACK on them. The tables have |
| 4 |
# row fitting exactly to page bounday and UPDATE will cause fields to be |
| 5 |
# stored off page. Whereas ROLLBACK shall bring it back to in page. |
| 6 |
# |
| 7 |
# NOTE : This behavior isn't there for tables with row versions. |
| 8 |
########################################################################## |
| 9 |
|
| 10 |
--source include/not_valgrind.inc |
| 11 |
--source include/have_lowercase0.inc |
| 12 |
--source include/have_innodb_16k.inc |
| 13 |
|
| 14 |
# ------------------------------------------------------------ |
| 15 |
# Tables created on earlier version with following |
| 16 |
# ------------------------------------------------------------ |
| 17 |
# CREATE TABLE t1_redundant(c1 longtext) ROW_FORMAT=REDUNDANT; |
| 18 |
# INSERT INTO t1_redundant VALUES (repeat('x', 8098)); |
| 19 |
# ALTER TABLE t1_redundant ADD COLUMN c2 INT, ALGORITHM=INSTANT; |
| 20 |
# |
| 21 |
# CREATE TABLE t2_redundant(id int NOT NULL AUTO_INCREMENT KEY, c1 longtext) ROW_FORMAT=REDUNDANT; |
| 22 |
# INSERT INTO t2_redundant VALUES (1, repeat('x', 8100)); |
| 23 |
# ALTER TABLE t2_redundant ADD COLUMN c2 INT, ALGORITHM=INSTANT; |
| 24 |
# |
| 25 |
# CREATE TABLE t1_compact(c1 longtext) ROW_FORMAT=COMPACT; |
| 26 |
# INSERT INTO t1_compact VALUES (repeat('x', 8098)); |
| 27 |
# ALTER TABLE t1_compact ADD COLUMN c2 INT, ALGORITHM=INSTANT; |
| 28 |
# |
| 29 |
# CREATE TABLE t2_compact(id int NOT NULL AUTO_INCREMENT KEY, c1 longtext) ROW_FORMAT=COMPACT; |
| 30 |
# INSERT INTO t2_compact VALUES (1, repeat('x', 8100)); |
| 31 |
# ALTER TABLE t2_compact ADD COLUMN c2 INT, ALGORITHM=INSTANT; |
| 32 |
# |
| 33 |
# CREATE TABLE t1_dynamic(c1 longtext) ROW_FORMAT=DYNAMIC; |
| 34 |
# INSERT INTO t1_dynamic VALUES (repeat('x', 8098)); |
| 35 |
# ALTER TABLE t1_dynamic ADD COLUMN c2 INT, ALGORITHM=INSTANT; |
| 36 |
# |
| 37 |
# CREATE TABLE t2_dynamic(id int NOT NULL AUTO_INCREMENT KEY, c1 longtext) ROW_FORMAT=DYNAMIC; |
| 38 |
# INSERT INTO t2_dynamic VALUES (1, repeat('x', 8100)); |
| 39 |
# ALTER TABLE t2_dynamic ADD COLUMN c2 INT, ALGORITHM=INSTANT; |
| 40 |
# ------------------------------------------------------------ |
| 41 |
|
| 42 |
--echo ######### |
| 43 |
--echo # SETUP # |
| 44 |
--echo ######### |
| 45 |
|
| 46 |
--echo # Stop the running the server |
| 47 |
--source include/shutdown_mysqld.inc |
| 48 |
|
| 49 |
--echo # Copy and unzip the datadir. |
| 50 |
--copy_file $MYSQLTEST_VARDIR/std_data/instant_ddl/instant_ddl_upgrade_update.zip $MYSQL_TMP_DIR/instant_ddl_upgrade_update.zip |
| 51 |
--file_exists $MYSQL_TMP_DIR/instant_ddl_upgrade_update.zip |
| 52 |
--exec unzip -qo $MYSQL_TMP_DIR/instant_ddl_upgrade_update.zip -d $MYSQL_TMP_DIR |
| 53 |
let $DATADIR = $MYSQL_TMP_DIR/data; |
| 54 |
|
| 55 |
--echo # Restart the server against the unzipped datadir |
| 56 |
--replace_result $DATADIR DATADIR |
| 57 |
--let $restart_parameters = restart: --datadir=$DATADIR --innodb-page-size=16k |
| 58 |
--let $wait_counter=3000 |
| 59 |
--source include/start_mysqld.inc |
| 60 |
|
| 61 |
--echo ############################################## |
| 62 |
--echo # Test instant ADD/DROP COLUMN for REDUNDANT format |
| 63 |
--echo ############################################## |
| 64 |
let $row_format = redundant; |
| 65 |
--source suite/innodb/include/instant_ddl_upgrade_update.inc |
| 66 |
|
| 67 |
--echo ############################################ |
| 68 |
--echo # Test instant ADD/DROP COLUMN for DYNAMIC format |
| 69 |
--echo ############################################ |
| 70 |
let $row_format = dynamic; |
| 71 |
--source suite/innodb/include/instant_ddl_upgrade_update.inc |
| 72 |
|
| 73 |
--echo ############################################ |
| 74 |
--echo # Test instant ADD/DROP COLUMN for COMPACT format |
| 75 |
--echo ############################################ |
| 76 |
let $row_format = compact; |
| 77 |
--source suite/innodb/include/instant_ddl_upgrade_update.inc |
| 78 |
|
| 79 |
--echo ########### |
| 80 |
--echo # CLEANUP # |
| 81 |
--echo ########### |
| 82 |
|
| 83 |
--echo # Shutdown server |
| 84 |
--source include/shutdown_mysqld.inc |
| 85 |
|
| 86 |
--echo # Remove copied files |
| 87 |
--file_exists $MYSQL_TMP_DIR/instant_ddl_upgrade_update.zip |
| 88 |
--force-rmdir $MYSQL_TMP_DIR/data |
| 89 |
--remove_file $MYSQL_TMP_DIR/instant_ddl_upgrade_update.zip |
| 90 |
|
| 91 |
--echo # Restarting server to restore server state |
| 92 |
let $restart_parameters =; |
| 93 |
--source include/start_mysqld.inc |