diff options
Diffstat (limited to 'sql/sql_partition.cc')
| -rw-r--r-- | sql/sql_partition.cc | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc index 7dff8338079..3cb268aa8b0 100644 --- a/sql/sql_partition.cc +++ b/sql/sql_partition.cc @@ -4423,7 +4423,7 @@ bool set_part_state(Alter_info *alter_info, partition_info *tab_part_info, do { partition_element *part_elem= part_it++; - if ((alter_info->flags & Alter_info::ALTER_ALL_PARTITION) || + if ((alter_info->flags & ALTER_ALL_PARTITION) || (is_name_in_list(part_elem->partition_name, alter_info->partition_names))) { @@ -4442,7 +4442,7 @@ bool set_part_state(Alter_info *alter_info, partition_info *tab_part_info, } while (++part_count < tab_part_info->num_parts); if (num_parts_found != alter_info->partition_names.elements && - !(alter_info->flags & Alter_info::ALTER_ALL_PARTITION)) + !(alter_info->flags & ALTER_ALL_PARTITION)) { /* Not all given partitions found, revert and return failure */ part_it.rewind(); @@ -4533,15 +4533,15 @@ uint prep_alter_part_table(THD *thd, TABLE *table, Alter_info *alter_info, DBUG_ENTER("prep_alter_part_table"); /* Foreign keys on partitioned tables are not supported, waits for WL#148 */ - if (table->part_info && (alter_info->flags & Alter_info::ADD_FOREIGN_KEY || - alter_info->flags & Alter_info::DROP_FOREIGN_KEY)) + if (table->part_info && (alter_info->flags & (ALTER_ADD_FOREIGN_KEY | + ALTER_DROP_FOREIGN_KEY))) { my_error(ER_FOREIGN_KEY_ON_PARTITIONED, MYF(0)); DBUG_RETURN(TRUE); } /* Remove partitioning on a not partitioned table is not possible */ if (!table->part_info && (alter_info->flags & - Alter_info::ALTER_REMOVE_PARTITIONING)) + ALTER_REMOVE_PARTITIONING)) { my_error(ER_PARTITION_MGMT_ON_NONPARTITIONED, MYF(0)); DBUG_RETURN(TRUE); @@ -4561,7 +4561,7 @@ uint prep_alter_part_table(THD *thd, TABLE *table, Alter_info *alter_info, alt_part_info->current_partition->list_val_list.head()-> col_val_array[0].max_value) && alt_part_info->part_type == LIST_PARTITION && - (alter_info->flags & Alter_info::ALTER_ADD_PARTITION); + (alter_info->flags & ALTER_ADD_PARTITION); if (only_default_value_added && !thd->lex->part_info->num_columns) thd->lex->part_info->num_columns= 1; // to make correct clone @@ -4577,17 +4577,17 @@ uint prep_alter_part_table(THD *thd, TABLE *table, Alter_info *alter_info, DBUG_RETURN(TRUE); /* ALTER_ADMIN_PARTITION is handled in mysql_admin_table */ - DBUG_ASSERT(!(alter_info->flags & Alter_info::ALTER_ADMIN_PARTITION)); + DBUG_ASSERT(!(alter_info->flags & ALTER_ADMIN_PARTITION)); partition_info *saved_part_info= NULL; if (alter_info->flags & - (Alter_info::ALTER_ADD_PARTITION | - Alter_info::ALTER_DROP_PARTITION | - Alter_info::ALTER_COALESCE_PARTITION | - Alter_info::ALTER_REORGANIZE_PARTITION | - Alter_info::ALTER_TABLE_REORG | - Alter_info::ALTER_REBUILD_PARTITION)) + (ALTER_ADD_PARTITION | + ALTER_DROP_PARTITION | + ALTER_COALESCE_PARTITION | + ALTER_REORGANIZE_PARTITION | + ALTER_TABLE_REORG | + ALTER_REBUILD_PARTITION)) { partition_info *tab_part_info; ulonglong flags= 0; @@ -4616,7 +4616,7 @@ uint prep_alter_part_table(THD *thd, TABLE *table, Alter_info *alter_info, tab_part_info= table->part_info; - if (alter_info->flags & Alter_info::ALTER_TABLE_REORG) + if (alter_info->flags & ALTER_TABLE_REORG) { uint new_part_no, curr_part_no; /* @@ -4668,7 +4668,7 @@ uint prep_alter_part_table(THD *thd, TABLE *table, Alter_info *alter_info, We will add more partitions, we use the ADD PARTITION without setting the flag for no default number of partitions */ - alter_info->flags|= Alter_info::ALTER_ADD_PARTITION; + alter_info->flags|= ALTER_ADD_PARTITION; thd->work_part_info->num_parts= new_part_no - curr_part_no; } else @@ -4677,7 +4677,7 @@ uint prep_alter_part_table(THD *thd, TABLE *table, Alter_info *alter_info, We will remove hash partitions, we use the COALESCE PARTITION without setting the flag for no default number of partitions */ - alter_info->flags|= Alter_info::ALTER_COALESCE_PARTITION; + alter_info->flags|= ALTER_COALESCE_PARTITION; alter_info->num_parts= curr_part_no - new_part_no; } } @@ -4710,8 +4710,8 @@ uint prep_alter_part_table(THD *thd, TABLE *table, Alter_info *alter_info, DBUG_RETURN(TRUE); } DBUG_PRINT("info", ("*fast_alter_table flags: 0x%llx", flags)); - if ((alter_info->flags & Alter_info::ALTER_ADD_PARTITION) || - (alter_info->flags & Alter_info::ALTER_REORGANIZE_PARTITION)) + if ((alter_info->flags & ALTER_ADD_PARTITION) || + (alter_info->flags & ALTER_REORGANIZE_PARTITION)) { if (thd->work_part_info->part_type != tab_part_info->part_type) { @@ -4779,7 +4779,7 @@ uint prep_alter_part_table(THD *thd, TABLE *table, Alter_info *alter_info, goto err; } } - if (alter_info->flags & Alter_info::ALTER_ADD_PARTITION) + if (alter_info->flags & ALTER_ADD_PARTITION) { if (*fast_alter_table && thd->locked_tables_mode) { @@ -5057,7 +5057,7 @@ that are reorganised. of partitions anymore. We use this code also for Table reorganisations and here we don't set any default flags to FALSE. */ - if (!(alter_info->flags & Alter_info::ALTER_TABLE_REORG)) + if (!(alter_info->flags & ALTER_TABLE_REORG)) { if (!alt_part_info->use_default_partitions) { @@ -5068,7 +5068,7 @@ that are reorganised. tab_part_info->is_auto_partitioned= FALSE; } } - else if (alter_info->flags & Alter_info::ALTER_DROP_PARTITION) + else if (alter_info->flags & ALTER_DROP_PARTITION) { /* Drop a partition from a range partition and list partitioning is @@ -5138,7 +5138,7 @@ that are reorganised. } tab_part_info->num_parts-= num_parts_dropped; } - else if (alter_info->flags & Alter_info::ALTER_REBUILD_PARTITION) + else if (alter_info->flags & ALTER_REBUILD_PARTITION) { set_engine_all_partitions(tab_part_info, tab_part_info->default_engine_type); @@ -5153,7 +5153,7 @@ that are reorganised. goto err; } } - else if (alter_info->flags & Alter_info::ALTER_COALESCE_PARTITION) + else if (alter_info->flags & ALTER_COALESCE_PARTITION) { uint num_parts_coalesced= alter_info->num_parts; uint num_parts_remain= tab_part_info->num_parts - num_parts_coalesced; @@ -5251,13 +5251,13 @@ state of p1. } while (part_count < tab_part_info->num_parts); tab_part_info->num_parts= num_parts_remain; } - if (!(alter_info->flags & Alter_info::ALTER_TABLE_REORG)) + if (!(alter_info->flags & ALTER_TABLE_REORG)) { tab_part_info->use_default_num_partitions= FALSE; tab_part_info->is_auto_partitioned= FALSE; } } - else if (alter_info->flags & Alter_info::ALTER_REORGANIZE_PARTITION) + else if (alter_info->flags & ALTER_REORGANIZE_PARTITION) { /* Reorganise partitions takes a number of partitions that are next @@ -5432,8 +5432,8 @@ the generated partition syntax in a correct manner. } *partition_changed= TRUE; thd->work_part_info= tab_part_info; - if (alter_info->flags & Alter_info::ALTER_ADD_PARTITION || - alter_info->flags & Alter_info::ALTER_REORGANIZE_PARTITION) + if (alter_info->flags & ALTER_ADD_PARTITION || + alter_info->flags & ALTER_REORGANIZE_PARTITION) { if (tab_part_info->use_default_subpartitions && !alt_part_info->use_default_subpartitions) @@ -5452,7 +5452,7 @@ the generated partition syntax in a correct manner. since this function "fixes" the item trees of the new partitions to reorganize into */ - if (alter_info->flags == Alter_info::ALTER_REORGANIZE_PARTITION && + if (alter_info->flags == ALTER_REORGANIZE_PARTITION && tab_part_info->part_type == RANGE_PARTITION && ((is_last_partition_reorged && (tab_part_info->column_list ? @@ -5535,7 +5535,7 @@ the generated partition syntax in a correct manner. if (tab_part_info) { - if (alter_info->flags & Alter_info::ALTER_REMOVE_PARTITIONING) + if (alter_info->flags & ALTER_REMOVE_PARTITIONING) { DBUG_PRINT("info", ("Remove partitioning")); if (!(create_info->used_fields & HA_CREATE_USED_ENGINE)) @@ -5606,7 +5606,7 @@ the generated partition syntax in a correct manner. rebuild). This is to handle KEY (numeric_cols) partitioned tables created in 5.1. For more info, see bug#14521864. */ - if (alter_info->flags != Alter_info::ALTER_PARTITION || + if (alter_info->flags != ALTER_PARTITION || !table->part_info || alter_info->requested_algorithm != Alter_info::ALTER_TABLE_ALGORITHM_INPLACE || @@ -6359,7 +6359,7 @@ static bool write_log_final_change_partition(ALTER_PARTITION_PARAM_TYPE *lpt) goto error; if (write_log_dropped_partitions(lpt, &next_entry, (const char*)path, lpt->alter_info->flags & - Alter_info::ALTER_REORGANIZE_PARTITION)) + ALTER_REORGANIZE_PARTITION)) goto error; if (write_log_replace_delete_frm(lpt, next_entry, shadow_path, path, TRUE)) goto error; @@ -6814,7 +6814,7 @@ uint fast_alter_partition_table(THD *thd, TABLE *table, goto err; } } - else if (alter_info->flags & Alter_info::ALTER_DROP_PARTITION) + else if (alter_info->flags & ALTER_DROP_PARTITION) { /* Now after all checks and setting state on dropped partitions we can @@ -6914,7 +6914,7 @@ uint fast_alter_partition_table(THD *thd, TABLE *table, goto err; } } - else if ((alter_info->flags & Alter_info::ALTER_ADD_PARTITION) && + else if ((alter_info->flags & ALTER_ADD_PARTITION) && (part_info->part_type == RANGE_PARTITION || part_info->part_type == LIST_PARTITION)) { |
