summaryrefslogtreecommitdiff
path: root/sql/sql_admin.cc
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2016-02-09 11:27:40 +0100
committerSergei Golubchik <serg@mariadb.org>2016-02-09 11:27:40 +0100
commitf3444df4153ccbb9ea8db73c1b5de6d7aa6d1334 (patch)
tree76c059c29ec0caca19a62dbcbe8efcd22e697692 /sql/sql_admin.cc
parentc4cb24006139bb6a619ca9d6b00d00c2275d2c28 (diff)
parent93a6142dd0c0c8b2e0683e4d57082582eac91fdb (diff)
downloadmariadb-git-f3444df4153ccbb9ea8db73c1b5de6d7aa6d1334.tar.gz
Merge branch 'mysql/5.5' into 5.5
reverted about half of commits as either not applicable or outright wrong
Diffstat (limited to 'sql/sql_admin.cc')
-rw-r--r--sql/sql_admin.cc14
1 files changed, 11 insertions, 3 deletions
diff --git a/sql/sql_admin.cc b/sql/sql_admin.cc
index 9827c67065c..12a59fa6ee8 100644
--- a/sql/sql_admin.cc
+++ b/sql/sql_admin.cc
@@ -1,4 +1,5 @@
-/* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+/* 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
@@ -293,7 +294,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);
}
@@ -380,7 +382,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_ADMIN_PARTITION ||
+ view_operator_func == NULL)
{
table->required_type=FRMTYPE_TABLE;
DBUG_ASSERT(!lex->only_view);