diff options
author | Kristian Nielsen <knielsen@knielsen-hq.org> | 2014-11-17 08:53:42 +0100 |
---|---|---|
committer | Kristian Nielsen <knielsen@knielsen-hq.org> | 2014-11-17 08:53:42 +0100 |
commit | 7671fd70c042c3632d2a4b17b9b827c1aeb581f1 (patch) | |
tree | aca38301c9448db018306ce59bef69f8ec6f039b /sql/log.cc | |
parent | b7d32e053d3d5b80c5be0e0d0e8457141f9d1b47 (diff) | |
download | mariadb-git-7671fd70c042c3632d2a4b17b9b827c1aeb581f1.tar.gz |
MDEV-7080: rpl.rpl_gtid_crash fails sporadically in buildbot
The real problem here was inconsistent handling of entry->commit_errno in
MYSQL_BIN_LOG::write_transaction_or_stmt(). Some return paths were setting it
to the value of errno, some where not. And the setting was redundant anyway,
as it is set consistently by the caller.
Fix by consistently setting it in the caller, and not in each return path in
the function.
The test failure happened because a DBUG_EXECUTE_IF() used in the test case
set an entry->commit_errno that was immediately overwritten in the caller with
whatever happened to be the value of errno. This could lead to different error
message in the .result file.
Diffstat (limited to 'sql/log.cc')
-rw-r--r-- | sql/log.cc | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/sql/log.cc b/sql/log.cc index 34795db66b8..71b1b8728af 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -7437,7 +7437,6 @@ MYSQL_BIN_LOG::write_transaction_or_stmt(group_commit_entry *entry, write_cache(entry->thd, mngr->get_binlog_cache_log(FALSE))) { entry->error_cache= &mngr->stmt_cache.cache_log; - entry->commit_errno= errno; DBUG_RETURN(ER_ERROR_ON_WRITE); } @@ -7458,7 +7457,6 @@ MYSQL_BIN_LOG::write_transaction_or_stmt(group_commit_entry *entry, if (write_cache(entry->thd, mngr->get_binlog_cache_log(TRUE))) { entry->error_cache= &mngr->trx_cache.cache_log; - entry->commit_errno= errno; DBUG_RETURN(ER_ERROR_ON_WRITE); } } @@ -7466,14 +7464,13 @@ MYSQL_BIN_LOG::write_transaction_or_stmt(group_commit_entry *entry, DBUG_EXECUTE_IF("inject_error_writing_xid", { entry->error_cache= NULL; - entry->commit_errno= 28; + errno= 28; DBUG_RETURN(ER_ERROR_ON_WRITE); }); if (entry->end_event->write(&log_file)) { entry->error_cache= NULL; - entry->commit_errno= errno; DBUG_RETURN(ER_ERROR_ON_WRITE); } status_var_add(entry->thd->status_var.binlog_bytes_written, @@ -7484,7 +7481,6 @@ MYSQL_BIN_LOG::write_transaction_or_stmt(group_commit_entry *entry, if (entry->incident_event->write(&log_file)) { entry->error_cache= NULL; - entry->commit_errno= errno; DBUG_RETURN(ER_ERROR_ON_WRITE); } } @@ -7492,13 +7488,11 @@ MYSQL_BIN_LOG::write_transaction_or_stmt(group_commit_entry *entry, if (mngr->get_binlog_cache_log(FALSE)->error) // Error on read { entry->error_cache= &mngr->stmt_cache.cache_log; - entry->commit_errno= errno; DBUG_RETURN(ER_ERROR_ON_WRITE); } if (mngr->get_binlog_cache_log(TRUE)->error) // Error on read { entry->error_cache= &mngr->trx_cache.cache_log; - entry->commit_errno= errno; DBUG_RETURN(ER_ERROR_ON_WRITE); } |