diff options
author | Sujatha Sivakumar <sujatha.sivakumar@oracle.com> | 2013-03-28 14:18:51 +0530 |
---|---|---|
committer | Sujatha Sivakumar <sujatha.sivakumar@oracle.com> | 2013-03-28 14:18:51 +0530 |
commit | 5c6611b5462ddd35c47b7c2c2b65e1edc090fd8d (patch) | |
tree | 924361342b42d301d8cdc1a60c902782b44c7961 /mysys | |
parent | 61bb634be69ff2e4904f6ca5d81771f92f6ca1c5 (diff) | |
parent | c78c1fe52dbc1034a143c5114ddf43c1d33c9d3b (diff) | |
download | mariadb-git-5c6611b5462ddd35c47b7c2c2b65e1edc090fd8d.tar.gz |
Merge from mysql-5.1 to mysql-5.5
Diffstat (limited to 'mysys')
-rw-r--r-- | mysys/mf_iocache2.c | 6 | ||||
-rw-r--r-- | mysys/my_read.c | 9 |
2 files changed, 13 insertions, 2 deletions
diff --git a/mysys/mf_iocache2.c b/mysys/mf_iocache2.c index 6339532fa16..6790489e786 100644 --- a/mysys/mf_iocache2.c +++ b/mysys/mf_iocache2.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -63,6 +63,8 @@ my_b_copy_to_file(IO_CACHE *cache, FILE *file) DBUG_RETURN(1); cache->read_pos= cache->read_end; } while ((bytes_in_cache= my_b_fill(cache))); + if(cache->error == -1) + DBUG_RETURN(1); DBUG_RETURN(0); } @@ -219,6 +221,8 @@ size_t my_b_fill(IO_CACHE *info) info->error= 0; return 0; /* EOF */ } + DBUG_EXECUTE_IF ("simulate_my_b_fill_error", + {DBUG_SET("+d,simulate_file_read_error");}); if ((length= my_read(info->file,info->buffer,max_length, info->myflags)) == (size_t) -1) { diff --git a/mysys/my_read.c b/mysys/my_read.c index ca5fbfaeef6..680e13b8391 100644 --- a/mysys/my_read.c +++ b/mysys/my_read.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify 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) #else readbytes= read(Filedes, Buffer, Count); #endif + DBUG_EXECUTE_IF ("simulate_file_read_error", + { + errno= ENOSPC; + readbytes= (size_t) -1; + DBUG_SET("-d,simulate_file_read_error"); + DBUG_SET("-d,simulate_my_b_fill_error"); + }); if (readbytes != Count) { |