Commit a3f651d0 authored by unknown's avatar unknown

MDEV-26: Global transaction ID.

Fix checksums for the new GTID events (reported by Pavel Ivanov).
Fix printing of GTID_LIST_EVENT.
parent f1f9c4e4
......@@ -17,16 +17,16 @@ SHOW BINLOG EVENTS;
ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Wrong offset or I/O error
SET GLOBAL debug_dbug="-d,corrupt_read_log_event_char";
# 3. Master read a corrupted event from binlog and send the error to slave
SET GLOBAL debug_dbug="+d,corrupt_read_log_event2";
SET GLOBAL debug_dbug="+d,corrupt_read_log_event2_set";
START SLAVE IO_THREAD;
include/wait_for_slave_io_error.inc [errno=1236]
SET GLOBAL debug_dbug="-d,corrupt_read_log_event2";
SET GLOBAL debug_dbug="-d,corrupt_read_log_event2_set";
# 4. Master read a corrupted event from binlog and send it to slave
SET GLOBAL master_verify_checksum=0;
SET GLOBAL debug_dbug="+d,corrupt_read_log_event2";
SET GLOBAL debug_dbug="+d,corrupt_read_log_event2_set";
START SLAVE IO_THREAD;
include/wait_for_slave_io_error.inc [errno=1595,1913]
SET GLOBAL debug_dbug="-d,corrupt_read_log_event2";
SET GLOBAL debug_dbug="-d,corrupt_read_log_event2_set";
SET GLOBAL debug_dbug= "";
SET GLOBAL master_verify_checksum=1;
# 5. Slave. Corruption in network
......
......@@ -100,19 +100,20 @@ let $wait_condition=
SELECT COUNT(*)=0 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE command = 'Binlog Dump';
--source include/wait_condition.inc
SET GLOBAL debug_dbug="+d,corrupt_read_log_event2";
SET GLOBAL debug_dbug="+d,corrupt_read_log_event2_set";
--connection slave
START SLAVE IO_THREAD;
let $slave_io_errno= 1236;
--let $slave_timeout= 10
--source include/wait_for_slave_io_error.inc
--connection master
SET GLOBAL debug_dbug="-d,corrupt_read_log_event2";
SET GLOBAL debug_dbug="-d,corrupt_read_log_event2_set";
# Emulate corruption on master without crc checking on master
--echo # 4. Master read a corrupted event from binlog and send it to slave
--connection master
SET GLOBAL master_verify_checksum=0;
SET GLOBAL debug_dbug="+d,corrupt_read_log_event2";
SET GLOBAL debug_dbug="+d,corrupt_read_log_event2_set";
--connection slave
START SLAVE IO_THREAD;
# When the checksum error is detected, the slave sets error code 1913
......@@ -122,7 +123,7 @@ START SLAVE IO_THREAD;
let $slave_io_errno= 1595,1913;
--source include/wait_for_slave_io_error.inc
--connection master
SET GLOBAL debug_dbug="-d,corrupt_read_log_event2";
SET GLOBAL debug_dbug="-d,corrupt_read_log_event2_set";
SET GLOBAL debug_dbug= "";
SET GLOBAL master_verify_checksum=1;
......
......@@ -6126,6 +6126,7 @@ Gtid_log_event::Gtid_log_event(THD *thd_arg, uint64 seq_no_arg,
seq_no(seq_no_arg), domain_id(domain_id_arg),
flags2(standalone ? FL_STANDALONE : 0)
{
cache_type= Log_event::EVENT_NO_CACHE;
}
......@@ -6354,6 +6355,7 @@ Gtid_list_log_event::Gtid_list_log_event(const char *buf, uint event_len,
Gtid_list_log_event::Gtid_list_log_event(rpl_binlog_state *gtid_set)
: count(gtid_set->count()), list(0)
{
cache_type= EVENT_NO_CACHE;
/* Failure to allocate memory will be caught by is_valid() returning false. */
if (count < (1<<28) &&
(list = (rpl_gtid *)my_malloc(count * sizeof(*list) + (count == 0),
......@@ -6419,16 +6421,16 @@ Gtid_list_log_event::print(FILE *file, PRINT_EVENT_INFO *print_event_info)
uint32 i;
print_header(&cache, print_event_info, FALSE);
my_b_printf(&cache, "\tGtid list [");
for (i= 0; i < count; ++i)
{
longlong10_to_str(list[i].seq_no, buf, 10);
my_b_printf(&cache, "%u-%u-%s", list[i].domain_id,
list[i].server_id, buf);
if (i < count-1)
my_b_printf(&cache, "\n# ");
else
my_b_printf(&cache, "\n");
my_b_printf(&cache, ",\n# ");
}
my_b_printf(&cache, "]\n");
}
}
......
......@@ -1420,6 +1420,17 @@ void mysql_binlog_send(THD* thd, char* log_ident, my_off_t pos,
connect_gtid_state.length(0);
using_gtid_state= get_slave_connect_state(thd, &connect_gtid_state);
DBUG_EXECUTE_IF("simulate_non_gtid_aware_master", using_gtid_state= false;);
/*
We want to corrupt the first event, in Log_event::read_log_event().
But we do not want the corruption to happen early, eg. when client does
BINLOG_GTID_POS(). So test case sets a DBUG trigger which causes us to
set the real DBUG injection here.
*/
DBUG_EXECUTE_IF("corrupt_read_log_event2_set",
{
DBUG_SET("-d,corrupt_read_log_event2_set");
DBUG_SET("+d,corrupt_read_log_event2");
});
if (global_system_variables.log_warnings > 1)
sql_print_information("Start binlog_dump to slave_server(%d), pos(%s, %lu)",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment