diff options
author | Luis Soares <luis.soares@oracle.com> | 2010-11-30 23:32:51 +0000 |
---|---|---|
committer | Luis Soares <luis.soares@oracle.com> | 2010-11-30 23:32:51 +0000 |
commit | aaefb52df8e8bcf67faaa5b1cf4b2de6c83f408a (patch) | |
tree | 702184f10f3525d7e537b20ac0b84e2e45a0279c /sql/handler.cc | |
parent | 2419cec9f1ca35053feca7311a2f8d94f4198606 (diff) | |
download | mariadb-git-aaefb52df8e8bcf67faaa5b1cf4b2de6c83f408a.tar.gz |
BUG#46166: MYSQL_BIN_LOG::new_file_impl is not propagating error
when generating new name.
If find_uniq_filename returns an error, then this error is not
being propagated upwards, and execution does not report error to
the user (although a entry in the error log is generated).
Additionally, some more errors were ignored in new_file_impl:
- when writing the rotate event
- when reopening the index and binary log file
This patch addresses this by propagating the error up in the
execution stack. Furthermore, when rotation of the binary log
fails, an incident event is written, because there may be a
chance that some changes for a given statement, were not properly
logged. For example, in SBR, LOAD DATA INFILE statement requires
more than one event to be logged, should rotation fail while
logging part of the LOAD DATA events, then the logged data would
become inconsistent with the data in the storage engine.
Diffstat (limited to 'sql/handler.cc')
-rw-r--r-- | sql/handler.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sql/handler.cc b/sql/handler.cc index 1525ca53bca..18381bc552c 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -1192,7 +1192,11 @@ int ha_commit_trans(THD *thd, bool all) error=ha_commit_one_phase(thd, all) ? (cookie ? 2 : 1) : 0; DBUG_EXECUTE_IF("crash_commit_before_unlog", DBUG_SUICIDE();); if (cookie) - tc_log->unlog(cookie, xid); + if(tc_log->unlog(cookie, xid)) + { + error= 2; + goto end; + } DBUG_EXECUTE_IF("crash_commit_after", DBUG_SUICIDE();); end: if (rw_trans) |