summaryrefslogtreecommitdiff
path: root/sql/sql_admin.cc
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2016-02-23 21:35:05 +0100
committerSergei Golubchik <serg@mariadb.org>2016-02-23 21:35:05 +0100
commita5679af1b13bb0c7c4eaa75f27551072dc18fb7d (patch)
tree7d039fb5e83c331daa75f9b9b67625b0469f6a9b /sql/sql_admin.cc
parent20c4dfd4a9e7c5f2f570488a7ead0b7c74e61817 (diff)
parent5f2f3c4fa81851b45dcee33601f14e05f6407333 (diff)
downloadmariadb-git-a5679af1b13bb0c7c4eaa75f27551072dc18fb7d.tar.gz
Merge branch '10.0' into 10.1
Diffstat (limited to 'sql/sql_admin.cc')
-rw-r--r--sql/sql_admin.cc15
1 files changed, 11 insertions, 4 deletions
diff --git a/sql/sql_admin.cc b/sql/sql_admin.cc
index d8ca8633baa..8ac68bff308 100644
--- a/sql/sql_admin.cc
+++ b/sql/sql_admin.cc
@@ -1,5 +1,5 @@
-/* Copyright (c) 2010, 2014, Oracle and/or its affiliates.
- Copyright (c) 2012, 2015, MariaDB
+/* Copyright (c) 2010, 2015, Oracle and/or its affiliates.
+ Copyright (c) 2011, 2016, MariaDB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -288,7 +288,8 @@ static inline bool table_not_corrupt_error(uint sql_errno)
sql_errno == ER_LOCK_WAIT_TIMEOUT ||
sql_errno == ER_LOCK_DEADLOCK ||
sql_errno == ER_CANT_LOCK_LOG_TABLE ||
- sql_errno == ER_OPEN_AS_READONLY);
+ sql_errno == ER_OPEN_AS_READONLY ||
+ sql_errno == ER_WRONG_OBJECT);
}
@@ -399,7 +400,13 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
lex->query_tables_last= &table->next_global;
lex->query_tables_own_last= 0;
- if (view_operator_func == NULL)
+ /*
+ CHECK TABLE command is allowed for views as well. Check on alter flags
+ to differentiate from ALTER TABLE...CHECK PARTITION on which view is not
+ allowed.
+ */
+ if (lex->alter_info.flags & Alter_info::ALTER_ADMIN_PARTITION ||
+ view_operator_func == NULL)
{
table->required_type=FRMTYPE_TABLE;
DBUG_ASSERT(!lex->only_view);