===== sql/sql_table.cc 1.274 vs edited ===== --- 1.274/sql/sql_table.cc 2005-02-02 10:27:58 -08:00 +++ edited/sql/sql_table.cc 2005-02-04 18:54:50 -08:00 @@ -2046,6 +2046,31 @@ ((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)) + goto no_special_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); + if (protocol->write()) + sql_print_error("Failed on my_net_write, " + "writing to stderr instead: %s\n", + err_msg); + /* 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); + } + } +no_special_error: result_code= result_code ? HA_ADMIN_FAILED : HA_ADMIN_OK; table->next= save_next; goto send_result_message;