diff --git a/sql/handler.cc b/sql/handler.cc index c3ad1cade99..6307e95a194 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -4921,8 +4921,14 @@ bool ha_show_status(THD *thd, handlerton *db_type, enum ha_stat_type stat) "", 0, "DISABLED", 8) ? 1 : 0; } else + { + DBUG_EXECUTE_IF("simulate_show_status_failure", + DBUG_SET("+d,simulate_net_write_failure");); result= db_type->show_status && db_type->show_status(db_type, thd, stat_print, stat) ? 1 : 0; + DBUG_EXECUTE_IF("simulate_show_status_failure", + DBUG_SET("-d,simulate_net_write_failure");); + } } if (!result) diff --git a/sql/net_serv.cc b/sql/net_serv.cc index 1a79679ed7c..8b44c7d443f 100644 --- a/sql/net_serv.cc +++ b/sql/net_serv.cc @@ -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 @@ -370,6 +370,12 @@ my_net_write(NET *net,const uchar *packet,size_t len) MYSQL_NET_WRITE_START(len); + DBUG_EXECUTE_IF("simulate_net_write_failure", { + my_error(ER_NET_ERROR_ON_WRITE, MYF(0)); + return 1; + }; + ); + /* Big packets are handled by splitting them in packets of MAX_PACKET_LENGTH length. The last packet is always a packet that is < MAX_PACKET_LENGTH. diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index cabea01c95a..7d0a363be69 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -9526,6 +9526,7 @@ innodb_show_status( const long MAX_STATUS_SIZE = 1048576; ulint trx_list_start = ULINT_UNDEFINED; ulint trx_list_end = ULINT_UNDEFINED; + bool ret_val; DBUG_ENTER("innodb_show_status"); DBUG_ASSERT(hton == innodb_hton_ptr); @@ -9590,12 +9591,13 @@ innodb_show_status( mutex_exit(&srv_monitor_file_mutex); - stat_print(thd, innobase_hton_name, (uint) strlen(innobase_hton_name), - STRING_WITH_LEN(""), str, flen); + ret_val= stat_print(thd, innobase_hton_name, + (uint) strlen(innobase_hton_name), + STRING_WITH_LEN(""), str, flen); my_free(str); - DBUG_RETURN(FALSE); + DBUG_RETURN(ret_val); } /************************************************************************//**