1
0
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:
Daniel Black
2020-10-05 13:26:28 +11:00
parent 00c44fb18e
commit 874942a0f9
4 changed files with 101 additions and 15 deletions

View File

@@ -2,12 +2,54 @@ include/master-slave.inc
[connection master]
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
call mtr.add_suppression("table or database name 'mysqltest-1'");
DROP DATABASE IF EXISTS `#mysql50#mysqltest-1`;
CREATE DATABASE `#mysql50#mysqltest-1`;
CREATE DATABASE `mysqltest-1`;
Master position is not changed
STOP SLAVE SQL_THREAD;
include/wait_for_slave_sql_to_stop.inc
Master position has been changed
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';
ALTER TABLE mysql.slow_log DROP COLUMN thread_id, DROP COLUMN rows_affected;
DROP DATABASE `mysqltest-1`;
DROP DATABASE `#mysql50#mysqltest-1`;
SHOW CREATE TABLE mysql.slow_log;
Table Create Table
slow_log CREATE TABLE `slow_log` (
`start_time` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
`user_host` mediumtext NOT NULL,
`query_time` time(6) NOT NULL,
`lock_time` time(6) NOT NULL,
`rows_sent` int(11) NOT NULL,
`rows_examined` int(11) NOT NULL,
`db` varchar(512) NOT NULL,
`last_insert_id` int(11) NOT NULL,
`insert_id` int(11) NOT NULL,
`server_id` int(10) unsigned NOT NULL,
`sql_text` mediumtext NOT NULL
) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='Slow log'
Master position has been changed
SHOW CREATE TABLE mysql.slow_log;
Table Create Table
slow_log CREATE TABLE `slow_log` (
`start_time` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
`user_host` mediumtext NOT NULL,
`query_time` time(6) NOT NULL,
`lock_time` time(6) NOT NULL,
`rows_sent` int(11) NOT NULL,
`rows_examined` int(11) NOT NULL,
`db` varchar(512) NOT NULL,
`last_insert_id` int(11) NOT NULL,
`insert_id` int(11) NOT NULL,
`server_id` int(10) unsigned NOT NULL,
`sql_text` mediumtext NOT NULL,
`thread_id` bigint(21) unsigned NOT NULL,
`rows_affected` int(11) NOT NULL
) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='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;
include/rpl_end.inc