| 1 |
-- source include/have_multi_ndb.inc |
| 2 |
|
| 3 |
# Determine if ndb_binlog_index is stored in InnoDB, in such case ALTER it |
| 4 |
# to other engine before running mysql_upgrade |
| 5 |
let $using_innodb = `select (engine = 'InnoDB') from information_schema.tables |
| 6 |
where table_name = 'ndb_binlog_index'` ; |
| 7 |
|
| 8 |
# Check that mysql.ndb_binlog_index is in InnoDB |
| 9 |
if (!$using_innodb) |
| 10 |
{ |
| 11 |
die The mysql.ndb_binlog_index is not in Innodb; |
| 12 |
} |
| 13 |
|
| 14 |
connection server2; |
| 15 |
# Create table mysql.ndb_binlog_index table in MyISAM engine. |
| 16 |
disable_query_log; |
| 17 |
disable_result_log; |
| 18 |
RENAME TABLE mysql.ndb_binlog_index TO mysql.ndb_binlog_index_bkp; |
| 19 |
CREATE TABLE mysql.ndb_binlog_index ENGINE='MyISAM' AS SELECT * FROM mysql.ndb_binlog_index_bkp; |
| 20 |
ALTER TABLE mysql.ndb_binlog_index ADD PRIMARY KEY (epoch, orig_server_id, orig_epoch); |
| 21 |
enable_query_log; |
| 22 |
enable_result_log; |
| 23 |
|
| 24 |
call mtr.add_suppression("Can't create database 'performance_schema'; database exists"); |
| 25 |
--let $MYSQLD_LOG= $MYSQLTEST_VARDIR/log/mysql_2_upgrade.log |
| 26 |
--let $restart_parameters= restart:--upgrade=FORCE --log-error=$MYSQLD_LOG |
| 27 |
--let $mysqld_name=mysqld.2.1 |
| 28 |
--let $wait_counter= 10000 |
| 29 |
--replace_result $MYSQLD_LOG MYSQLD_LOG $MYSQLD MYSQLD |
| 30 |
--source include/restart_mysqld.inc |
| 31 |
|
| 32 |
connection server1; |
| 33 |
# Create table mysql.ndb_binlog_index table in MyISAM engine. |
| 34 |
disable_query_log; |
| 35 |
disable_result_log; |
| 36 |
RENAME TABLE mysql.ndb_binlog_index TO mysql.ndb_binlog_index_bkp; |
| 37 |
CREATE TABLE mysql.ndb_binlog_index ENGINE='MyISAM' AS SELECT * FROM mysql.ndb_binlog_index_bkp; |
| 38 |
ALTER TABLE mysql.ndb_binlog_index ADD PRIMARY KEY (epoch, orig_server_id, orig_epoch); |
| 39 |
enable_query_log; |
| 40 |
enable_result_log; |
| 41 |
|
| 42 |
call mtr.add_suppression("Can't create database 'performance_schema'; database exists"); |
| 43 |
--let $MYSQLD_LOG= $MYSQLTEST_VARDIR/log/mysql_1_upgrade.log |
| 44 |
--let $restart_parameters= restart:--upgrade=FORCE --log-error=$MYSQLD_LOG |
| 45 |
--let $mysqld_name=mysqld.1.1 |
| 46 |
--let $wait_counter= 10000 |
| 47 |
disconnect default; |
| 48 |
--replace_result $MYSQLD_LOG MYSQLD_LOG $MYSQLD MYSQLD |
| 49 |
--source include/restart_mysqld.inc |
| 50 |
|
| 51 |
connect (default,127.0.0.1,root,,test,$MASTER_MYPORT,); |
| 52 |
--source suite/ndb_binlog/t/ndb_binlog_purge_lock.inc |
| 53 |
|
| 54 |
connection server2; |
| 55 |
disable_query_log; |
| 56 |
disable_result_log; |
| 57 |
DROP TABLE mysql.ndb_binlog_index; |
| 58 |
RENAME TABLE mysql.ndb_binlog_index_bkp TO mysql.ndb_binlog_index; |
| 59 |
enable_query_log; |
| 60 |
enable_result_log; |
| 61 |
|
| 62 |
connection server1; |
| 63 |
disable_query_log; |
| 64 |
disable_result_log; |
| 65 |
DROP TABLE mysql.ndb_binlog_index; |
| 66 |
RENAME TABLE mysql.ndb_binlog_index_bkp TO mysql.ndb_binlog_index; |
| 67 |
enable_query_log; |
| 68 |
enable_result_log; |