Skip to content

Commit bff1f43

Browse files
committed
Bug#17474166 - EXECUTING STATEMENT LIKE 'SHOW ENGINE INNODB'
Merging from 5.5 to 5.6
2 parents 63dc0b1 + 5411549 commit bff1f43

3 files changed

Lines changed: 17 additions & 3 deletions

File tree

sql/handler.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6915,8 +6915,14 @@ bool ha_show_status(THD *thd, handlerton *db_type, enum ha_stat_type stat)
69156915
"", 0, "DISABLED", 8) ? 1 : 0;
69166916
}
69176917
else
6918+
{
6919+
DBUG_EXECUTE_IF("simulate_show_status_failure",
6920+
DBUG_SET("+d,simulate_net_write_failure"););
69186921
result= db_type->show_status &&
69196922
db_type->show_status(db_type, thd, stat_print, stat) ? 1 : 0;
6923+
DBUG_EXECUTE_IF("simulate_show_status_failure",
6924+
DBUG_SET("-d,simulate_net_write_failure"););
6925+
}
69206926
}
69216927

69226928
if (!result)

sql/net_serv.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,12 @@ my_bool my_net_write(NET *net, const uchar *packet, size_t len)
286286

287287
MYSQL_NET_WRITE_START(len);
288288

289+
DBUG_EXECUTE_IF("simulate_net_write_failure", {
290+
my_error(ER_NET_ERROR_ON_WRITE, MYF(0));
291+
return 1;
292+
};
293+
);
294+
289295
/*
290296
Big packets are handled by splitting them in packets of MAX_PACKET_LENGTH
291297
length. The last packet is always a packet that is < MAX_PACKET_LENGTH.

storage/innobase/handler/ha_innodb.cc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12361,6 +12361,7 @@ innodb_show_status(
1236112361
const long MAX_STATUS_SIZE = 1048576;
1236212362
ulint trx_list_start = ULINT_UNDEFINED;
1236312363
ulint trx_list_end = ULINT_UNDEFINED;
12364+
bool ret_val;
1236412365

1236512366
DBUG_ENTER("innodb_show_status");
1236612367
DBUG_ASSERT(hton == innodb_hton_ptr);
@@ -12437,12 +12438,13 @@ innodb_show_status(
1243712438

1243812439
mutex_exit(&srv_monitor_file_mutex);
1243912440

12440-
stat_print(thd, innobase_hton_name, (uint) strlen(innobase_hton_name),
12441-
STRING_WITH_LEN(""), str, flen);
12441+
ret_val= stat_print(thd, innobase_hton_name,
12442+
(uint) strlen(innobase_hton_name),
12443+
STRING_WITH_LEN(""), str, flen);
1244212444

1244312445
my_free(str);
1244412446

12445-
DBUG_RETURN(0);
12447+
DBUG_RETURN(ret_val);
1244612448
}
1244712449

1244812450
/************************************************************************//**

0 commit comments

Comments
 (0)