1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-16 00:42:55 +03:00

MDEV-21360 restore debud_dbug through a session variable instead of '-d,..'

This commit is contained in:
Alice Sherepa
2020-03-19 18:55:57 +01:00
parent 7e168634e9
commit ad6e421bd2
23 changed files with 228 additions and 237 deletions

View File

@ -22,7 +22,7 @@ master-bin.000001 #
master-bin.000002 #
###################### TEST #2
RESET MASTER;
SET GLOBAL debug_dbug="+d,error_unique_log_filename";
SET @@global.debug_dbug="d,error_unique_log_filename";
FLUSH LOGS;
ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)
@ -30,7 +30,7 @@ ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)
show binary logs;
Log_name File_size
master-bin.000001 #
SET GLOBAL debug_dbug=@old_debug;
SET @@global.debug_dbug=@old_debug;
RESET MASTER;
###################### TEST #3
CREATE TABLE t1 (a INT);
@ -44,11 +44,11 @@ show binary logs;
Log_name File_size
master-bin.000001 #
master-bin.000002 #
SET GLOBAL debug_dbug=@old_debug;
SET @@global.debug_dbug=@old_debug;
DELETE FROM t2;
RESET MASTER;
###################### TEST #4
SET GLOBAL debug_dbug="+d,error_unique_log_filename";
SET @@global.debug_dbug="d,error_unique_log_filename";
LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug_46166.data' INTO TABLE t2;
ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)
@ -56,21 +56,21 @@ ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)
SELECT count(*) FROM t2;
count(*)
1
SET GLOBAL debug_dbug=@old_debug;
SET @@global.debug_dbug=@old_debug;
DELETE FROM t2;
RESET MASTER;
###################### TEST #5
SET GLOBAL debug_dbug="+d,error_unique_log_filename";
SET @@global.debug_dbug="d,error_unique_log_filename";
LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug_46166-2.data' INTO TABLE t2;
# assert: must show one entry
SELECT count(*) FROM t2;
count(*)
1
SET GLOBAL debug_dbug=@old_debug;
SET @@global.debug_dbug=@old_debug;
DELETE FROM t2;
RESET MASTER;
###################### TEST #6
SET GLOBAL debug_dbug="+d,error_unique_log_filename";
SET @@global.debug_dbug="d,error_unique_log_filename";
SET AUTOCOMMIT=0;
INSERT INTO t2 VALUES ('muse');
LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug_46166.data' INTO TABLE t2;
@ -83,11 +83,11 @@ SELECT count(*) FROM t2;
count(*)
3
SET AUTOCOMMIT= 1;
SET GLOBAL debug_dbug=@old_debug;
SET @@global.debug_dbug=@old_debug;
DELETE FROM t2;
RESET MASTER;
###################### TEST #7
SET GLOBAL debug_dbug="+d,error_unique_log_filename";
SET @@global.debug_dbug="d,error_unique_log_filename";
SET @@binlog_annotate_row_events= 0;
SELECT count(*) FROM t4;
count(*)
@ -100,14 +100,14 @@ SELECT count(*) FROM t4;
count(*)
1
### check that the incident event is written to the current log
SET GLOBAL debug_dbug=@old_debug;
SET @@global.debug_dbug=@old_debug;
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Incident # # #1 (LOST_EVENTS)
DELETE FROM t4;
RESET MASTER;
###################### TEST #8
SET GLOBAL debug_dbug="+d,error_unique_log_filename";
SET @@global.debug_dbug="d,error_unique_log_filename";
# must show 0 entries
SELECT count(*) FROM t4;
count(*)
@ -147,9 +147,9 @@ count(*)
SELECT count(*) FROM t2;
count(*)
0
SET GLOBAL debug_dbug=@old_debug;
SET @@global.debug_dbug=@old_debug;
###################### TEST #9
SET GLOBAL debug_dbug="+d,error_unique_log_filename";
SET @@global.debug_dbug="d,error_unique_log_filename";
SET SQL_LOG_BIN=0;
INSERT INTO t2 VALUES ('aaa'), ('bbb'), ('ccc'), ('ddd');
INSERT INTO t4 VALUES ('eee'), ('fff'), ('ggg'), ('hhh');
@ -170,17 +170,17 @@ SELECT count(*) FROM t4;
count(*)
0
SET SQL_LOG_BIN=1;
SET GLOBAL debug_dbug=@old_debug;
SET @@global.debug_dbug=@old_debug;
###################### TEST #10
call mtr.add_suppression("MYSQL_BIN_LOG::open failed to sync the index file.");
call mtr.add_suppression("Could not open .*");
RESET MASTER;
SHOW WARNINGS;
Level Code Message
SET GLOBAL debug_dbug="+d,fault_injection_registering_index";
SET @@global.debug_dbug="d,fault_injection_registering_index";
FLUSH LOGS;
ERROR HY000: Can't open file: 'master-bin.000002' (errno: 1 "Operation not permitted")
SET GLOBAL debug_dbug=@old_debug;
SET @@global.debug_dbug=@old_debug;
SHOW BINARY LOGS;
ERROR HY000: You are not using binary logging
CREATE TABLE t5 (a INT);
@ -192,10 +192,10 @@ DROP TABLE t5;
flush tables;
###################### TEST #11
include/rpl_restart_server.inc [server_number=1]
SET GLOBAL debug_dbug="+d,fault_injection_openning_index";
SET @@global.debug_dbug="d,fault_injection_openning_index";
FLUSH LOGS;
ERROR HY000: Can't open file: 'master-bin.index' (errno: 1 "Operation not permitted")
SET GLOBAL debug_dbug=@old_debug;
SET @@global.debug_dbug=@old_debug;
RESET MASTER;
ERROR HY000: Binlog closed, cannot RESET MASTER
CREATE TABLE t5 (a INT);
@ -207,10 +207,10 @@ DROP TABLE t5;
flush tables;
include/rpl_restart_server.inc [server_number=1]
###################### TEST #12
SET GLOBAL debug_dbug="+d,fault_injection_new_file_rotate_event";
SET @@global.debug_dbug="d,fault_injection_new_file_rotate_event";
FLUSH LOGS;
ERROR HY000: Can't open file: 'master-bin' (errno: 2 "No such file or directory")
SET GLOBAL debug_dbug=@old_debug;
SET @@global.debug_dbug=@old_debug;
RESET MASTER;
ERROR HY000: Binlog closed, cannot RESET MASTER
CREATE TABLE t5 (a INT);
@ -237,44 +237,40 @@ call mtr.add_suppression("Could not open .*");
call mtr.add_suppression("MYSQL_BIN_LOG::open failed to sync the index file.");
call mtr.add_suppression("Can't generate a unique log-filename .*");
###################### TEST #13
SET @old_debug=@@global.debug;
SET @saved_debug=@@global.debug_dbug;
include/stop_slave.inc
SET GLOBAL debug_dbug="+d,error_unique_log_filename";
SET @@global.debug_dbug="d,error_unique_log_filename";
START SLAVE io_thread;
include/wait_for_slave_io_error.inc [errno=1595]
Last_IO_Error = 'Relay log write failure: could not queue event from master'
SET GLOBAL debug_dbug="-d,error_unique_log_filename";
SET GLOBAL debug_dbug=@old_debug;
SET @@global.debug_dbug=@saved_debug;
include/rpl_restart_server.inc [server_number=2]
###################### TEST #14
SET @old_debug=@@global.debug;
SET @saved_debug=@@global.debug_dbug;
include/stop_slave.inc
SET GLOBAL debug_dbug="+d,fault_injection_new_file_rotate_event";
SET @@global.debug_dbug="d,fault_injection_new_file_rotate_event";
START SLAVE io_thread;
include/wait_for_slave_io_error.inc [errno=1595]
Last_IO_Error = 'Relay log write failure: could not queue event from master'
SET GLOBAL debug_dbug="-d,fault_injection_new_file_rotate_event";
SET GLOBAL debug_dbug=@old_debug;
SET @@global.debug_dbug=@saved_debug;
include/rpl_restart_server.inc [server_number=2]
###################### TEST #15
SET @old_debug=@@global.debug;
SET @saved_debug=@@global.debug_dbug;
include/stop_slave.inc
SET GLOBAL debug_dbug="+d,fault_injection_registering_index";
SET @@global.debug_dbug="d,fault_injection_registering_index";
START SLAVE io_thread;
include/wait_for_slave_io_error.inc [errno=1595]
Last_IO_Error = 'Relay log write failure: could not queue event from master'
SET GLOBAL debug_dbug="-d,fault_injection_registering_index";
SET GLOBAL debug_dbug=@old_debug;
SET @@global.debug_dbug=@saved_debug;
include/rpl_restart_server.inc [server_number=2]
###################### TEST #16
SET @old_debug=@@global.debug;
SET @saved_debug=@@global.debug_dbug;
include/stop_slave.inc
SET GLOBAL debug_dbug="+d,fault_injection_openning_index";
SET @@global.debug_dbug="d,fault_injection_openning_index";
START SLAVE io_thread;
include/wait_for_slave_io_error.inc [errno=1595]
Last_IO_Error = 'Relay log write failure: could not queue event from master'
SET GLOBAL debug_dbug="-d,fault_injection_openning_index";
SET GLOBAL debug_dbug=@old_debug;
SET @@global.debug_dbug=@saved_debug;
include/rpl_restart_server.inc [server_number=2]
include/stop_slave_sql.inc
Warnings: