diff options
Diffstat (limited to 'sql/handler.cc')
-rw-r--r-- | sql/handler.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sql/handler.cc b/sql/handler.cc index b5c9716bbbf..9ded738055e 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -4800,10 +4800,14 @@ bool ha_show_status(THD *thd, handlerton *db_type, enum ha_stat_type stat) db_type->show_status(db_type, thd, stat_print, stat) ? 1 : 0; } - if (!result) + /* + We also check thd->is_error() as Innodb may return 0 even if + there was an error. + */ + if (!result && !thd->is_error()) my_eof(thd); else if (!thd->is_error()) - my_error(ER_GET_ERRNO, MYF(0), 0); + my_error(ER_GET_ERRNO, MYF(0), errno); return result; } |