summaryrefslogtreecommitdiff
path: root/sql/sql_alter.cc
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2018-02-19 11:23:20 +0200
committerMonty <monty@mariadb.org>2018-02-19 11:23:20 +0200
commit2ba0785ae6b692feefe97c81aa06427724ce197b (patch)
treec2d3203c38442f167831b5d326ea09bcc9269089 /sql/sql_alter.cc
parent778f76a2c6898a45a6c89799ddaad6650ffd0a47 (diff)
downloadmariadb-git-10.3-alter.tar.gz
Move alter partition flags to alter_info->partition_flags10.3-alter
This is done to get more free flag bits for alter_info->flags Renamed all ALTER PARTITION defines to start with ALTER_PARTITION_ Renamed ALTER_PARTITION to ALTER_PARTITION_INFO Renamed ALTER_TABLE_REORG to ALTER_PARTITION_TABLE_REORG Other things: - Shifted some ALTER_xxx defines to get empty bits at end
Diffstat (limited to 'sql/sql_alter.cc')
-rw-r--r--sql/sql_alter.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/sql/sql_alter.cc b/sql/sql_alter.cc
index fac0e43d499..77e0c9d5298 100644
--- a/sql/sql_alter.cc
+++ b/sql/sql_alter.cc
@@ -27,7 +27,7 @@ Alter_info::Alter_info(const Alter_info &rhs, MEM_ROOT *mem_root)
key_list(rhs.key_list, mem_root),
create_list(rhs.create_list, mem_root),
check_constraint_list(rhs.check_constraint_list, mem_root),
- flags(rhs.flags),
+ flags(rhs.flags), partition_flags(rhs.partition_flags),
keys_onoff(rhs.keys_onoff),
partition_names(rhs.partition_names, mem_root),
num_parts(rhs.num_parts),
@@ -225,13 +225,14 @@ bool Sql_cmd_alter_table::execute(THD *thd)
We also require DROP priv for ALTER TABLE ... DROP PARTITION, as well
as for RENAME TO, as being done by SQLCOM_RENAME_TABLE
*/
- if (alter_info.flags & (ALTER_DROP_PARTITION | ALTER_RENAME))
+ if ((alter_info.partition_flags & ALTER_PARTITION_DROP) ||
+ (alter_info.flags & ALTER_RENAME))
priv_needed|= DROP_ACL;
/* Must be set in the parser */
DBUG_ASSERT(select_lex->db.str);
- DBUG_ASSERT(!(alter_info.flags & ALTER_EXCHANGE_PARTITION));
- DBUG_ASSERT(!(alter_info.flags & ALTER_ADMIN_PARTITION));
+ DBUG_ASSERT(!(alter_info.partition_flags & ALTER_PARTITION_EXCHANGE));
+ DBUG_ASSERT(!(alter_info.partition_flags & ALTER_PARTITION_ADMIN));
if (check_access(thd, priv_needed, first_table->db.str,
&first_table->grant.privilege,
&first_table->grant.m_internal,