mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 04:53:01 +01:00
BUG#38826
Merge from 5.0-bugteam. Additional fix for unused ret variable warning.
This commit is contained in:
commit
a0869f7cc6
3 changed files with 7 additions and 78 deletions
|
@ -1,14 +0,0 @@
|
|||
stop slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
reset master;
|
||||
reset slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
start slave;
|
||||
stop slave;
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1 (id INT);
|
||||
start slave;
|
||||
SET GLOBAL debug= "+d,crash_before_purge_logs";
|
||||
FLUSH LOGS;
|
||||
ERROR HY000: Lost connection to MySQL server during query
|
||||
start slave;
|
|
@ -1,57 +0,0 @@
|
|||
--source include/master-slave.inc
|
||||
--source include/have_debug.inc
|
||||
--disable_reconnect
|
||||
|
||||
# We have to sync with master, to ensure slave had time to start properly
|
||||
# # before we stop it. If not, we get errors about UNIX_TIMESTAMP() in the
|
||||
# log.
|
||||
sync_slave_with_master;
|
||||
stop slave;
|
||||
--source include/wait_for_slave_to_stop.inc
|
||||
|
||||
# ON MASTER
|
||||
|
||||
connection master;
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1;
|
||||
--enable_warnings
|
||||
|
||||
CREATE TABLE t1 (id INT);
|
||||
|
||||
let $1=100;
|
||||
disable_query_log;
|
||||
begin;
|
||||
while ($1)
|
||||
{
|
||||
eval INSERT INTO t1 VALUES( $1 );
|
||||
dec $1;
|
||||
}
|
||||
DROP TABLE t1;
|
||||
save_master_pos;
|
||||
|
||||
enable_query_log;
|
||||
|
||||
## ON SLAVE
|
||||
|
||||
connection slave;
|
||||
start slave;
|
||||
--source include/wait_for_slave_to_start.inc
|
||||
sync_with_master 0;
|
||||
connection master;
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
|
||||
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/slave0.expect
|
||||
SET GLOBAL debug= "+d,crash_before_purge_logs";
|
||||
|
||||
--error 2013
|
||||
# try to rotate logs
|
||||
FLUSH LOGS;
|
||||
|
||||
--enable_reconnect
|
||||
--source include/wait_until_connected_again.inc
|
||||
start slave;
|
||||
--source include/wait_for_slave_to_start.inc
|
||||
|
||||
sync_with_master 0;
|
14
sql/log.cc
14
sql/log.cc
|
@ -2978,7 +2978,7 @@ int MYSQL_BIN_LOG::purge_first_log(Relay_log_info* rli, bool included)
|
|||
* Need to update the log pos because purge logs has been called
|
||||
* after fetching initially the log pos at the begining of the method.
|
||||
*/
|
||||
if(error=find_log_pos(&rli->linfo, rli->event_relay_log_name, 0))
|
||||
if((error=find_log_pos(&rli->linfo, rli->event_relay_log_name, 0)))
|
||||
{
|
||||
char buff[22];
|
||||
sql_print_error("next log error: %d offset: %s log: %s included: %d",
|
||||
|
@ -3044,7 +3044,6 @@ int MYSQL_BIN_LOG::purge_logs(const char *to_log,
|
|||
ulonglong *decrease_log_space)
|
||||
{
|
||||
int error;
|
||||
int ret = 0;
|
||||
bool exit_loop= 0;
|
||||
LOG_INFO log_info;
|
||||
THD *thd= current_thd;
|
||||
|
@ -3067,8 +3066,8 @@ int MYSQL_BIN_LOG::purge_logs(const char *to_log,
|
|||
*/
|
||||
if (!my_b_inited(&purge_temp))
|
||||
{
|
||||
if (error=open_cached_file(&purge_temp, mysql_tmpdir, TEMP_PREFIX,
|
||||
DISK_BUFFER_SIZE, MYF(MY_WME)))
|
||||
if ((error=open_cached_file(&purge_temp, mysql_tmpdir, TEMP_PREFIX,
|
||||
DISK_BUFFER_SIZE, MYF(MY_WME))))
|
||||
{
|
||||
sql_print_error("MYSQL_LOG::purge_logs failed to open purge_temp");
|
||||
goto err;
|
||||
|
@ -3076,7 +3075,7 @@ int MYSQL_BIN_LOG::purge_logs(const char *to_log,
|
|||
}
|
||||
else
|
||||
{
|
||||
if (error=reinit_io_cache(&purge_temp, WRITE_CACHE, 0, 0, 1))
|
||||
if ((error=reinit_io_cache(&purge_temp, WRITE_CACHE, 0, 0, 1)))
|
||||
{
|
||||
sql_print_error("MYSQL_LOG::purge_logs failed to reinit purge_temp "
|
||||
"for write");
|
||||
|
@ -3107,7 +3106,7 @@ int MYSQL_BIN_LOG::purge_logs(const char *to_log,
|
|||
}
|
||||
|
||||
/* We know how many files to delete. Update index file. */
|
||||
if (error=update_log_index(&log_info, need_update_threads))
|
||||
if ((error=update_log_index(&log_info, need_update_threads)))
|
||||
{
|
||||
sql_print_error("MSYQL_LOG::purge_logs failed to update the index file");
|
||||
goto err;
|
||||
|
@ -3116,7 +3115,7 @@ int MYSQL_BIN_LOG::purge_logs(const char *to_log,
|
|||
DBUG_EXECUTE_IF("crash_after_update_index", abort(););
|
||||
|
||||
/* Switch purge_temp for read. */
|
||||
if (error=reinit_io_cache(&purge_temp, READ_CACHE, 0, 0, 0))
|
||||
if ((error=reinit_io_cache(&purge_temp, READ_CACHE, 0, 0, 0)))
|
||||
{
|
||||
sql_print_error("MSYQL_LOG::purge_logs failed to reinit purge_temp "
|
||||
"for read");
|
||||
|
@ -3251,6 +3250,7 @@ int MYSQL_BIN_LOG::purge_logs(const char *to_log,
|
|||
}
|
||||
|
||||
err:
|
||||
close_cached_file(&purge_temp);
|
||||
if (need_mutex)
|
||||
pthread_mutex_unlock(&LOCK_index);
|
||||
DBUG_RETURN(error);
|
||||
|
|
Loading…
Reference in a new issue