mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 04:53:01 +01:00
Fix error reporting for 'OPTIMIZE TABLE' on InnoDB tables. (Bug #8135)
This commit is contained in:
parent
ed2e508bdd
commit
2fde78052b
1 changed files with 22 additions and 0 deletions
|
@ -2052,6 +2052,28 @@ send_result_message:
|
|||
((result_code= table->table->file->analyze(thd, check_opt)) > 0))
|
||||
result_code= 0; // analyze went ok
|
||||
}
|
||||
if (result_code) // either mysql_recreate_table or analyze failed
|
||||
{
|
||||
const char *err_msg;
|
||||
if ((err_msg= thd->net.last_error))
|
||||
{
|
||||
if (!thd->vio_ok())
|
||||
{
|
||||
sql_print_error(err_msg);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Hijack the row already in-progress. */
|
||||
protocol->store("error", 5, system_charset_info);
|
||||
protocol->store(err_msg, system_charset_info);
|
||||
(void)protocol->write();
|
||||
/* Start off another row for HA_ADMIN_FAILED */
|
||||
protocol->prepare_for_resend();
|
||||
protocol->store(table_name, system_charset_info);
|
||||
protocol->store(operator_name, system_charset_info);
|
||||
}
|
||||
}
|
||||
}
|
||||
result_code= result_code ? HA_ADMIN_FAILED : HA_ADMIN_OK;
|
||||
table->next= save_next;
|
||||
goto send_result_message;
|
||||
|
|
Loading…
Reference in a new issue