1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

generalize ER_TABLE_NEEDS_UPGRADE to work for views too

This commit is contained in:
Sergei Golubchik
2015-06-01 16:01:23 +02:00
parent 5091a4ba75
commit fce4ab0ab4
10 changed files with 20 additions and 17 deletions

View File

@ -978,11 +978,13 @@ send_result_message:
{
char buf[MYSQL_ERRMSG_SIZE];
size_t length;
const char *what_to_upgrade= table->view ? "VIEW" :
table->table->file->ha_table_flags() & HA_CAN_REPAIR ? "TABLE" : 0;
protocol->store(STRING_WITH_LEN("error"), system_charset_info);
if (table->table->file->ha_table_flags() & HA_CAN_REPAIR)
if (what_to_upgrade)
length= my_snprintf(buf, sizeof(buf), ER(ER_TABLE_NEEDS_UPGRADE),
table->table_name);
what_to_upgrade, table->table_name);
else
length= my_snprintf(buf, sizeof(buf), ER(ER_TABLE_NEEDS_REBUILD),
table->table_name);