summaryrefslogtreecommitdiff
path: root/sql/ha_partition.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/ha_partition.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/ha_partition.cc')
-rw-r--r--sql/ha_partition.cc24
1 files changed, 18 insertions, 6 deletions
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc
index ff1b26126bd..1d910e1e225 100644
--- a/sql/ha_partition.cc
+++ b/sql/ha_partition.cc
@@ -1380,7 +1380,7 @@ int ha_partition::handle_opt_partitions(THD *thd, HA_CHECK_OPT *check_opt,
when ALTER TABLE <CMD> PARTITION ...
it should only do named partitions, otherwise all partitions
*/
- if (!(thd->lex->alter_info.flags & ALTER_ADMIN_PARTITION) ||
+ if (!(thd->lex->alter_info.partition_flags & ALTER_PARTITION_ADMIN) ||
part_elem->part_state == PART_ADMIN)
{
if (m_is_sub_partitioned)
@@ -9664,7 +9664,7 @@ void ha_partition::print_error(int error, myf errflag)
/* Should probably look for my own errors first */
if ((error == HA_ERR_NO_PARTITION_FOUND) &&
- ! (thd->lex->alter_info.flags & ALTER_TRUNCATE_PARTITION))
+ ! (thd->lex->alter_info.partition_flags & ALTER_PARTITION_TRUNCATE))
{
m_part_info->print_no_partition_found(table, errflag);
DBUG_VOID_RETURN;
@@ -9880,8 +9880,11 @@ ha_partition::check_if_supported_inplace_alter(TABLE *altered_table,
Any other change would set partition_changed in
prep_alter_part_table() in mysql_alter_table().
*/
- if (ha_alter_info->alter_info->flags == ALTER_PARTITION)
+ if (ha_alter_info->alter_info->partition_flags == ALTER_PARTITION_INFO)
+ {
+ DBUG_ASSERT(ha_alter_info->alter_info->flags == 0);
DBUG_RETURN(HA_ALTER_INPLACE_NO_LOCK);
+ }
part_inplace_ctx=
new (thd->mem_root) ha_partition_inplace_ctx(thd, m_tot_parts);
@@ -9947,8 +9950,11 @@ bool ha_partition::prepare_inplace_alter_table(TABLE *altered_table,
Changing to similar partitioning, only update metadata.
Non allowed changes would be catched in prep_alter_part_table().
*/
- if (ha_alter_info->alter_info->flags == ALTER_PARTITION)
+ if (ha_alter_info->alter_info->partition_flags == ALTER_PARTITION_INFO)
+ {
+ DBUG_ASSERT(ha_alter_info->alter_info->flags == 0);
DBUG_RETURN(false);
+ }
part_inplace_ctx=
static_cast<class ha_partition_inplace_ctx*>(ha_alter_info->handler_ctx);
@@ -9980,8 +9986,11 @@ bool ha_partition::inplace_alter_table(TABLE *altered_table,
Changing to similar partitioning, only update metadata.
Non allowed changes would be catched in prep_alter_part_table().
*/
- if (ha_alter_info->alter_info->flags == ALTER_PARTITION)
+ if (ha_alter_info->alter_info->partition_flags == ALTER_PARTITION_INFO)
+ {
+ DBUG_ASSERT(ha_alter_info->alter_info->flags == 0);
DBUG_RETURN(false);
+ }
part_inplace_ctx=
static_cast<class ha_partition_inplace_ctx*>(ha_alter_info->handler_ctx);
@@ -10020,8 +10029,11 @@ bool ha_partition::commit_inplace_alter_table(TABLE *altered_table,
Changing to similar partitioning, only update metadata.
Non allowed changes would be catched in prep_alter_part_table().
*/
- if (ha_alter_info->alter_info->flags == ALTER_PARTITION)
+ if (ha_alter_info->alter_info->partition_flags == ALTER_PARTITION_INFO)
+ {
+ DBUG_ASSERT(ha_alter_info->alter_info->flags == 0);
DBUG_RETURN(false);
+ }
part_inplace_ctx=
static_cast<class ha_partition_inplace_ctx*>(ha_alter_info->handler_ctx);