mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Bug #11754178 45740: MYSQLDUMP DOESN'T DUMP GENERAL_LOG AND SLOW_QUERY
CAUSES RESTORE PROBLEM Merging the fix from mysql-5.1 to mysql-5.5 mysql-test/t/mysqldump.test: There is a difference in the testcase which is added as part of this fix, when compared with mysql-5.1. In mysql-5.5 and mysql-5.6, "DROP mysql database" fails by enabling logging, hence removed those lines.
This commit is contained in:
@ -5205,3 +5205,48 @@ DROP DATABASE b12809202_db;
|
||||
# Delete all existing binary logs.
|
||||
#
|
||||
RESET MASTER;
|
||||
#
|
||||
# Bug#45740 MYSQLDUMP DOESN'T DUMP GENERAL_LOG AND SLOW_QUERY CAUSES RESTORE PROBLEM
|
||||
#
|
||||
SET @old_log_output_state= @@global.log_output;
|
||||
SET @old_general_log_state= @@global.general_log;
|
||||
SET @old_slow_query_log_state= @@global.slow_query_log;
|
||||
call mtr.add_suppression("Failed to write to mysql.general_log");
|
||||
SET @@global.log_output="TABLE";
|
||||
SET @@global.general_log='OFF';
|
||||
SET @@global.slow_query_log='OFF';
|
||||
DROP DATABASE mysql;
|
||||
Warnings:
|
||||
Error 1146 Table 'mysql.proc' doesn't exist
|
||||
Error 1146 Table 'mysql.event' doesn't exist
|
||||
SHOW CREATE TABLE mysql.general_log;
|
||||
Table Create Table
|
||||
general_log CREATE TABLE `general_log` (
|
||||
`event_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
`user_host` mediumtext NOT NULL,
|
||||
`thread_id` int(11) NOT NULL,
|
||||
`server_id` int(10) unsigned NOT NULL,
|
||||
`command_type` varchar(64) NOT NULL,
|
||||
`argument` mediumtext NOT NULL
|
||||
) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='General log'
|
||||
SHOW CREATE TABLE mysql.slow_log;
|
||||
Table Create Table
|
||||
slow_log CREATE TABLE `slow_log` (
|
||||
`start_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
`user_host` mediumtext NOT NULL,
|
||||
`query_time` time NOT NULL,
|
||||
`lock_time` time 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'
|
||||
SET @@global.log_output= @old_log_output_state;
|
||||
SET @@global.slow_query_log= @old_slow_query_log_state;
|
||||
SET @@global.general_log= @old_general_log_state;
|
||||
#
|
||||
# End of 5.1 tests
|
||||
#
|
||||
|
@ -2367,3 +2367,30 @@ RESET MASTER;
|
||||
|
||||
# Wait till we reached the initial number of concurrent sessions
|
||||
--source include/wait_until_count_sessions.inc
|
||||
|
||||
--echo #
|
||||
--echo # Bug#45740 MYSQLDUMP DOESN'T DUMP GENERAL_LOG AND SLOW_QUERY CAUSES RESTORE PROBLEM
|
||||
--echo #
|
||||
SET @old_log_output_state= @@global.log_output;
|
||||
SET @old_general_log_state= @@global.general_log;
|
||||
SET @old_slow_query_log_state= @@global.slow_query_log;
|
||||
|
||||
call mtr.add_suppression("Failed to write to mysql.general_log");
|
||||
--exec $MYSQL_DUMP -uroot --all-databases > $MYSQLTEST_VARDIR/tmp/bug45740.sql
|
||||
# Make log_output as table and disabling general_log and slow_log
|
||||
SET @@global.log_output="TABLE";
|
||||
SET @@global.general_log='OFF';
|
||||
SET @@global.slow_query_log='OFF';
|
||||
DROP DATABASE mysql;
|
||||
--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug45740.sql
|
||||
SHOW CREATE TABLE mysql.general_log;
|
||||
SHOW CREATE TABLE mysql.slow_log;
|
||||
--remove_file $MYSQLTEST_VARDIR/tmp/bug45740.sql
|
||||
|
||||
SET @@global.log_output= @old_log_output_state;
|
||||
SET @@global.slow_query_log= @old_slow_query_log_state;
|
||||
SET @@global.general_log= @old_general_log_state;
|
||||
|
||||
--echo #
|
||||
--echo # End of 5.1 tests
|
||||
--echo #
|
||||
|
Reference in New Issue
Block a user