mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
MDEV-4851: (tests) log tables modifiable on log_output!=TABLE
Test we can ALTER log tables directly when not being written to. This removes the contraint in the rpl_mysql_upgrade.test such that we can run mysql_upgrade --write-binlog all the way through to a replica. We test this in the replication scenario where the mysql.{slow,general}_log tables aren't being written to. Reviewers: Vicențiu Ciorbaru, Anel Husakovic
This commit is contained in:
@@ -14,8 +14,7 @@ call mtr.add_suppression("table or database name 'mysqltest-1'");
|
||||
|
||||
connection master;
|
||||
--disable_warnings
|
||||
DROP DATABASE IF EXISTS `#mysql50#mysqltest-1`;
|
||||
CREATE DATABASE `#mysql50#mysqltest-1`;
|
||||
CREATE DATABASE `mysqltest-1`;
|
||||
--enable_warnings
|
||||
sync_slave_with_master;
|
||||
|
||||
@@ -34,13 +33,25 @@ if ($before_position == $after_position)
|
||||
echo Master position is not changed;
|
||||
}
|
||||
|
||||
#Some log events of the mysql_upgrade's will cause errors on slave.
|
||||
# Some log events of the mysql_upgrade previously caused errors on slave,
|
||||
# however with MDEV-4851 this should be ok, so we test it:
|
||||
connection slave;
|
||||
STOP SLAVE SQL_THREAD;
|
||||
source include/wait_for_slave_sql_to_stop.inc;
|
||||
SET @old_general_log_state = @@global.general_log;
|
||||
SET @old_slow_log_state = @@global.slow_query_log;
|
||||
SET @old_log_output = @@global.log_output;
|
||||
SET GLOBAL general_log = 'ON';
|
||||
SET GLOBAL slow_query_log = 'ON';
|
||||
SET GLOBAL log_output = 'FILE';
|
||||
|
||||
connection master;
|
||||
#With '--force' option, mysql_upgrade always executes all sql statements for upgrading.
|
||||
ALTER TABLE mysql.slow_log DROP COLUMN thread_id, DROP COLUMN rows_affected;
|
||||
DROP DATABASE `mysqltest-1`;
|
||||
sync_slave_with_master;
|
||||
|
||||
connection slave;
|
||||
SHOW CREATE TABLE mysql.slow_log;
|
||||
connection master;
|
||||
--exec $MYSQL_UPGRADE --skip-verbose --write-binlog --force --user=root > $MYSQLTEST_VARDIR/log/mysql_upgrade.log 2>&1
|
||||
|
||||
let $datadir= `select @@datadir`;
|
||||
@@ -55,8 +66,15 @@ if ($before_position != $after_position)
|
||||
echo Master position has been changed;
|
||||
}
|
||||
|
||||
DROP DATABASE `mysqltest-1`;
|
||||
sync_slave_with_master;
|
||||
connection slave;
|
||||
DROP DATABASE `#mysql50#mysqltest-1`;
|
||||
--let $rpl_only_running_threads= 1
|
||||
SHOW CREATE TABLE mysql.slow_log;
|
||||
SET GLOBAL general_log = 'OFF';
|
||||
SET GLOBAL slow_query_log = 'OFF';
|
||||
truncate mysql.slow_log;
|
||||
truncate mysql.general_log;
|
||||
SET GLOBAL general_log = @old_general_log_state;
|
||||
SET GLOBAL slow_query_log = @old_slow_log_state;
|
||||
SET GLOBAL log_output = @old_log_output;
|
||||
|
||||
--source include/rpl_end.inc
|
||||
|
Reference in New Issue
Block a user