summaryrefslogtreecommitdiff
path: root/sql/sql_lex.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_lex.cc')
-rw-r--r--sql/sql_lex.cc27
1 files changed, 24 insertions, 3 deletions
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index 3ef45de2e8e..b5f8cf4a886 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -1342,7 +1342,7 @@ void lex_unlock_plugins(LEX *lex)
/* release used plugins */
if (lex->plugins.elements) /* No function call and no mutex if no plugins. */
{
- plugin_unlock_list(0, (plugin_ref*)lex->plugins.buffer,
+ plugin_unlock_list(0, (plugin_ref*)lex->plugins.buffer,
lex->plugins.elements);
}
reset_dynamic(&lex->plugins);
@@ -6042,8 +6042,10 @@ int st_select_lex_unit::save_union_explain_part2(Explain_query *output)
bool LEX::is_partition_management() const
{
return (sql_command == SQLCOM_ALTER_TABLE &&
- (alter_info.partition_flags == ALTER_PARTITION_ADD ||
- alter_info.partition_flags == ALTER_PARTITION_REORGANIZE));
+ (alter_info.partition_flags & (ALTER_PARTITION_ADD |
+ ALTER_PARTITION_CONVERT_IN |
+ ALTER_PARTITION_CONVERT_OUT |
+ ALTER_PARTITION_REORGANIZE)));
}
@@ -11252,6 +11254,25 @@ bool LEX::stmt_alter_table_exchange_partition(Table_ident *table)
}
+bool LEX::stmt_alter_table(Table_ident *table)
+{
+ DBUG_ASSERT(sql_command == SQLCOM_ALTER_TABLE);
+ first_select_lex()->db= table->db;
+ if (first_select_lex()->db.str == NULL &&
+ copy_db_to(&first_select_lex()->db))
+ return true;
+ if (unlikely(check_table_name(table->table.str, table->table.length,
+ false)) ||
+ (table->db.str && unlikely(check_db_name((LEX_STRING*) &table->db))))
+ {
+ my_error(ER_WRONG_TABLE_NAME, MYF(0), table->table.str);
+ return true;
+ }
+ name= table->table;
+ return false;
+}
+
+
void LEX::stmt_purge_to(const LEX_CSTRING &to)
{
type= 0;