summaryrefslogtreecommitdiff
path: root/sql/sql_table.cc
diff options
context:
space:
mode:
authorsvoj@june.mysql.com <>2007-06-07 12:07:41 +0500
committersvoj@june.mysql.com <>2007-06-07 12:07:41 +0500
commitc45b4cf893b45f44006ae0edba3293666be1abe0 (patch)
tree37f6a1dedde1283cc37cc15edf554f5731db2b90 /sql/sql_table.cc
parentaab34271314d08a9bc6a00ede9d369997933dca7 (diff)
parentbd8f81f470d285b27fb52924aa2c3de57ce25592 (diff)
downloadmariadb-git-c45b4cf893b45f44006ae0edba3293666be1abe0.tar.gz
Merge 81.176.158.240:devel/mysql/BUG26976/mysql-5.0-engines
into mysql.com:/home/svoj/devel/mysql/BUG26976/mysql-5.0-engines
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r--sql/sql_table.cc49
1 files changed, 24 insertions, 25 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 202882d9a48..8f2fa69432b 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -2284,33 +2284,16 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
*/
if (!table->table)
{
- char buf[ERRMSGSIZE+ERRMSGSIZE+2];
- const char *err_msg;
- protocol->prepare_for_resend();
- protocol->store(table_name, system_charset_info);
- protocol->store(operator_name, system_charset_info);
- protocol->store(STRING_WITH_LEN("error"), system_charset_info);
- if (!(err_msg=thd->net.last_error))
- err_msg=ER(ER_CHECK_NO_SUCH_TABLE);
+ if (!thd->warn_list.elements)
+ push_warning(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
+ ER_CHECK_NO_SUCH_TABLE, ER(ER_CHECK_NO_SUCH_TABLE));
/* if it was a view will check md5 sum */
if (table->view &&
view_checksum(thd, table) == HA_ADMIN_WRONG_CHECKSUM)
- {
- strxmov(buf, err_msg, "; ", ER(ER_VIEW_CHECKSUM), NullS);
- err_msg= (const char *)buf;
- }
- protocol->store(err_msg, system_charset_info);
- lex->cleanup_after_one_table_open();
- thd->clear_error();
- /*
- View opening can be interrupted in the middle of process so some
- tables can be left opening
- */
- close_thread_tables(thd);
- lex->reset_query_tables_list(FALSE);
- if (protocol->write())
- goto err;
- continue;
+ push_warning(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
+ ER_VIEW_CHECKSUM, ER(ER_VIEW_CHECKSUM));
+ result_code= HA_ADMIN_CORRUPT;
+ goto send_result;
}
if (table->view)
@@ -2392,6 +2375,22 @@ send_result:
lex->cleanup_after_one_table_open();
thd->clear_error(); // these errors shouldn't get client
+ {
+ List_iterator_fast<MYSQL_ERROR> it(thd->warn_list);
+ MYSQL_ERROR *err;
+ while ((err= it++))
+ {
+ protocol->prepare_for_resend();
+ protocol->store(table_name, system_charset_info);
+ protocol->store((char*) operator_name, system_charset_info);
+ protocol->store(warning_level_names[err->level],
+ warning_level_length[err->level], system_charset_info);
+ protocol->store(err->msg, system_charset_info);
+ if (protocol->write())
+ goto err;
+ }
+ mysql_reset_errors(thd, true);
+ }
protocol->prepare_for_resend();
protocol->store(table_name, system_charset_info);
protocol->store(operator_name, system_charset_info);
@@ -2918,7 +2917,7 @@ bool mysql_check_table(THD* thd, TABLE_LIST* tables,HA_CHECK_OPT* check_opt)
DBUG_ENTER("mysql_check_table");
DBUG_RETURN(mysql_admin_table(thd, tables, check_opt,
"check", lock_type,
- 0, HA_OPEN_FOR_REPAIR, 0, 0,
+ 0, 0, HA_OPEN_FOR_REPAIR, 0,
&handler::ha_check, &view_checksum));
}