diff options
author | Luis Soares <luis.soares@oracle.com> | 2010-12-17 01:17:03 +0000 |
---|---|---|
committer | Luis Soares <luis.soares@oracle.com> | 2010-12-17 01:17:03 +0000 |
commit | 9e161d30218ec367a1398c723d0234820a5f7c55 (patch) | |
tree | 048e787c1ee43f37c8087727db3d097cc2846288 /sql/log.cc | |
parent | 60f650069b7bf02a312991e99dedab4c3fba2ad8 (diff) | |
download | mariadb-git-9e161d30218ec367a1398c723d0234820a5f7c55.tar.gz |
BUG#46166
Post-push fixes:
- fixed platform dependent result files
- appeasing valgrind warnings:
Fault injection was also uncovering a previously existing
potential mem leaks. For BUG#46166 testing purposes, fixed
by forcing handling the leak when injecting faults.
Diffstat (limited to 'sql/log.cc')
-rw-r--r-- | sql/log.cc | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/sql/log.cc b/sql/log.cc index 5fcb5fe0367..f3d3420194c 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -2599,6 +2599,23 @@ bool MYSQL_BIN_LOG::open(const char *log_name, sync_purge_index_file() || DBUG_EVALUATE_IF("fault_injection_registering_index", 1, 0)) { + /** + TODO: although this was introduced to appease valgrind + when injecting emulated faults using fault_injection_registering_index + it may be good to consider what actually happens when + open_purge_index_file succeeds but register or sync fails. + + Perhaps we might need the code below in MYSQL_LOG_BIN::cleanup + for "real life" purposes as well? + */ + DBUG_EXECUTE_IF("fault_injection_registering_index", { + if (my_b_inited(&purge_index_file)) + { + end_io_cache(&purge_index_file); + my_close(purge_index_file.file, MYF(0)); + } + }); + sql_print_error("MSYQL_BIN_LOG::open failed to sync the index file."); DBUG_RETURN(1); } @@ -3827,6 +3844,7 @@ int MYSQL_BIN_LOG::new_file_impl(bool need_lock) if(DBUG_EVALUATE_IF("fault_injection_new_file_rotate_event", (error=close_on_error=TRUE), FALSE) || (error= r.write(&log_file))) { + DBUG_EXECUTE_IF("fault_injection_new_file_rotate_event", errno=2;); close_on_error= TRUE; my_printf_error(ER_ERROR_ON_WRITE, ER(ER_CANT_OPEN_FILE), MYF(ME_FATALERROR), name, errno); goto end; |