diff options
author | Sujatha Sivakumar <sujatha.sivakumar@oracle.com> | 2013-03-28 14:14:39 +0530 |
---|---|---|
committer | Sujatha Sivakumar <sujatha.sivakumar@oracle.com> | 2013-03-28 14:14:39 +0530 |
commit | d054027c4bfabdfa1cdbb58ee9aa34557eacbb45 (patch) | |
tree | ce642fb92d15c30186ac36f364dd7c70ea141344 /sql | |
parent | f4b97d10a7ee6d2f9d05cbfd05360635329d452b (diff) | |
download | mariadb-git-d054027c4bfabdfa1cdbb58ee9aa34557eacbb45.tar.gz |
Bug#14324766:PARTIALLY WRITTEN INSERT STATEMENT IN BINLOG
NO ERRORS REPORTED
Problem:
=======
Errors from my_b_fill are ignored. MYSQL_BIN_LOG::write_cache
code assumes that 0 returned from my_b_fill always means
end-of-cache, but that is incorrect. It can result in error
and the error is ignored. Other callers of my_b_fill don't
check for error: my_b_copy_to_file, maybe my_b_gets.
Fix:
===
An error handler is already present to check the "cache"
error that is reported during "MYSQL_BIN_LOG::write_cache"
call. Hence error handlers are added for "my_b_copy_to_file"
and "my_b_gets".
During my_b_fill() function call, when the cache read fails
info->error= -1 is set. Hence a check for "info->error"
is added for the above to callers upon their return.
mysys/mf_iocache2.c:
Added a check for "cache->error" and simulation of cache read failure
mysys/my_read.c:
Simulation of read failure
sql/log_event.cc:
Added debug simulation
sql/sql_repl.cc:
Added a check for cache error
Diffstat (limited to 'sql')
-rw-r--r-- | sql/log_event.cc | 2 | ||||
-rw-r--r-- | sql/sql_repl.cc | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/sql/log_event.cc b/sql/log_event.cc index fe93eb665cf..16388fbbef7 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -9196,6 +9196,8 @@ Write_rows_log_event::do_exec_row(const Relay_log_info *const rli) #ifdef MYSQL_CLIENT void Write_rows_log_event::print(FILE *file, PRINT_EVENT_INFO* print_event_info) { + DBUG_EXECUTE_IF("simulate_cache_read_error", + {DBUG_SET("+d,simulate_my_b_fill_error");}); Rows_log_event::print_helper(file, print_event_info, "Write_rows"); } #endif diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc index 6894eaa48b5..06c25c324c7 100644 --- a/sql/sql_repl.cc +++ b/sql/sql_repl.cc @@ -1732,6 +1732,8 @@ bool show_binlogs(THD* thd) if (protocol->write()) goto err; } + if(index_file->error == -1) + goto err; mysql_bin_log.unlock_index(); my_eof(thd); DBUG_RETURN(FALSE); |