summaryrefslogtreecommitdiff
path: root/sql/sql_admin.cc
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2015-06-01 16:01:23 +0200
committerSergei Golubchik <serg@mariadb.org>2015-06-01 16:01:23 +0200
commitfce4ab0ab405e112035bda98176c5834200d26df (patch)
tree97ccac45b59d1523c22408427f701353284d66ec /sql/sql_admin.cc
parent5091a4ba755250ed8e35f4f5a39a118d476cd8f1 (diff)
downloadmariadb-git-fce4ab0ab405e112035bda98176c5834200d26df.tar.gz
generalize ER_TABLE_NEEDS_UPGRADE to work for views too
Diffstat (limited to 'sql/sql_admin.cc')
-rw-r--r--sql/sql_admin.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/sql/sql_admin.cc b/sql/sql_admin.cc
index cbcdf083291..5b64a792016 100644
--- a/sql/sql_admin.cc
+++ b/sql/sql_admin.cc
@@ -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);