Commit f66e3474 authored by unknown's avatar unknown

MDEV-26: Global transaction ID.

Fix missing error check for applying Gtid_log_event.

Fix a couple compiler warnings.
parent 5fa4c235
...@@ -6235,12 +6235,15 @@ Gtid_log_event::do_apply_event(Relay_log_info const *rli) ...@@ -6235,12 +6235,15 @@ Gtid_log_event::do_apply_event(Relay_log_info const *rli)
/* Finalize server status flags after executing a statement. */ /* Finalize server status flags after executing a statement. */
thd->update_server_status(); thd->update_server_status();
log_slow_statement(thd); log_slow_statement(thd);
if (unlikely(thd->is_fatal_error))
thd->is_slave_error= 1;
else if (likely(!thd->is_slave_error))
general_log_write(thd, COM_QUERY, thd->query(), thd->query_length()); general_log_write(thd, COM_QUERY, thd->query(), thd->query_length());
} }
thd->reset_query(); thd->reset_query();
free_root(thd->mem_root,MYF(MY_KEEP_PREALLOC)); free_root(thd->mem_root,MYF(MY_KEEP_PREALLOC));
return 0; return thd->is_slave_error;
} }
......
...@@ -1088,16 +1088,17 @@ slave_connection_state::update(const rpl_gtid *in_gtid) ...@@ -1088,16 +1088,17 @@ slave_connection_state::update(const rpl_gtid *in_gtid)
void void
slave_connection_state::remove(const rpl_gtid *in_gtid) slave_connection_state::remove(const rpl_gtid *in_gtid)
{ {
bool err;
uchar *rec= my_hash_search(&hash, (const uchar *)(&in_gtid->domain_id), 0); uchar *rec= my_hash_search(&hash, (const uchar *)(&in_gtid->domain_id), 0);
#ifndef DBUG_OFF #ifndef DBUG_OFF
bool err;
rpl_gtid *slave_gtid= (rpl_gtid *)rec; rpl_gtid *slave_gtid= (rpl_gtid *)rec;
DBUG_ASSERT(rec /* We should never try to remove not present domain_id. */); DBUG_ASSERT(rec /* We should never try to remove not present domain_id. */);
DBUG_ASSERT(slave_gtid->server_id == in_gtid->server_id); DBUG_ASSERT(slave_gtid->server_id == in_gtid->server_id);
DBUG_ASSERT(slave_gtid->seq_no == in_gtid->seq_no); DBUG_ASSERT(slave_gtid->seq_no == in_gtid->seq_no);
#endif #endif
err= my_hash_delete(&hash, rec); IF_DBUG(err=, )
my_hash_delete(&hash, rec);
DBUG_ASSERT(!err); DBUG_ASSERT(!err);
} }
......
...@@ -1400,6 +1400,7 @@ void mysql_binlog_send(THD* thd, char* log_ident, my_off_t pos, ...@@ -1400,6 +1400,7 @@ void mysql_binlog_send(THD* thd, char* log_ident, my_off_t pos,
DBUG_PRINT("enter",("log_ident: '%s' pos: %ld", log_ident, (long) pos)); DBUG_PRINT("enter",("log_ident: '%s' pos: %ld", log_ident, (long) pos));
bzero((char*) &log,sizeof(log)); bzero((char*) &log,sizeof(log));
bzero(&error_gtid, sizeof(error_gtid));
/* /*
heartbeat_period from @master_heartbeat_period user variable heartbeat_period from @master_heartbeat_period user variable
*/ */
......
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