Skip to content

Commit b4d3dc5

Browse files
author
Sujatha Sivakumar
committed
Merge from mysql-5.5 to mysql-5.6
2 parents 7f1df39 + 5c6611b commit b4d3dc5

File tree

4 files changed

+16
-1
lines changed

4 files changed

+16
-1
lines changed

mysys/mf_iocache2.c

+4
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ my_b_copy_to_file(IO_CACHE *cache, FILE *file)
6363
DBUG_RETURN(1);
6464
cache->read_pos= cache->read_end;
6565
} while ((bytes_in_cache= my_b_fill(cache)));
66+
if(cache->error == -1)
67+
DBUG_RETURN(1);
6668
DBUG_RETURN(0);
6769
}
6870

@@ -219,6 +221,8 @@ size_t my_b_fill(IO_CACHE *info)
219221
info->error= 0;
220222
return 0; /* EOF */
221223
}
224+
DBUG_EXECUTE_IF ("simulate_my_b_fill_error",
225+
{DBUG_SET("+d,simulate_file_read_error");});
222226
if ((length= my_read(info->file,info->buffer,max_length,
223227
info->myflags)) == (size_t) -1)
224228
{

mysys/my_read.c

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
1+
/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
22
33
This program is free software; you can redistribute it and/or modify
44
it under the terms of the GNU General Public License as published by
@@ -49,6 +49,13 @@ size_t my_read(File Filedes, uchar *Buffer, size_t Count, myf MyFlags)
4949
#else
5050
readbytes= read(Filedes, Buffer, Count);
5151
#endif
52+
DBUG_EXECUTE_IF ("simulate_file_read_error",
53+
{
54+
errno= ENOSPC;
55+
readbytes= (size_t) -1;
56+
DBUG_SET("-d,simulate_file_read_error");
57+
DBUG_SET("-d,simulate_my_b_fill_error");
58+
});
5259

5360
if (readbytes != Count)
5461
{

sql/log_event.cc

+2
Original file line numberDiff line numberDiff line change
@@ -12476,6 +12476,8 @@ Write_rows_log_event::do_exec_row(const Relay_log_info *const rli)
1247612476
#ifdef MYSQL_CLIENT
1247712477
void Write_rows_log_event::print(FILE *file, PRINT_EVENT_INFO* print_event_info)
1247812478
{
12479+
DBUG_EXECUTE_IF("simulate_cache_read_error",
12480+
{DBUG_SET("+d,simulate_my_b_fill_error");});
1247912481
Rows_log_event::print_helper(file, print_event_info, "Write_rows");
1248012482
}
1248112483
#endif

sql/rpl_master.cc

+2
Original file line numberDiff line numberDiff line change
@@ -2043,6 +2043,8 @@ bool show_binlogs(THD* thd)
20432043
goto err;
20442044
}
20452045
}
2046+
if(index_file->error == -1)
2047+
goto err;
20462048
mysql_bin_log.unlock_index();
20472049
my_eof(thd);
20482050
DBUG_RETURN(FALSE);

0 commit comments

Comments
 (0)