|
|
@ -721,9 +721,11 @@ static bool handle_list_of_fields(THD *thd, List_iterator<const char> it, |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
if (table->s->db_type()->partition_flags && |
|
|
|
(table->s->db_type()->partition_flags() & HA_USE_AUTO_PARTITION) && |
|
|
|
(table->s->db_type()->partition_flags() & HA_CAN_PARTITION)) |
|
|
|
handlerton *ht= table->s->db_type(); |
|
|
|
if (ht->partition_flags && |
|
|
|
((ht->partition_flags() & |
|
|
|
(HA_USE_AUTO_PARTITION | HA_CAN_PARTITION)) == |
|
|
|
(HA_USE_AUTO_PARTITION | HA_CAN_PARTITION))) |
|
|
|
{ |
|
|
|
/*
|
|
|
|
This engine can handle automatic partitioning and there is no |
|
|
@ -1927,6 +1929,7 @@ bool fix_partition_func(THD *thd, TABLE *table, bool is_create_table_ind) |
|
|
|
bool result= TRUE; |
|
|
|
partition_info *part_info= table->part_info; |
|
|
|
enum_column_usage saved_column_usage= thd->column_usage; |
|
|
|
handlerton *ht; |
|
|
|
DBUG_ENTER("fix_partition_func"); |
|
|
|
|
|
|
|
if (part_info->fixed) |
|
|
@ -2056,8 +2059,9 @@ bool fix_partition_func(THD *thd, TABLE *table, bool is_create_table_ind) |
|
|
|
goto end; |
|
|
|
if (unlikely(check_primary_key(table))) |
|
|
|
goto end; |
|
|
|
if (unlikely((!(table->s->db_type()->partition_flags && |
|
|
|
(table->s->db_type()->partition_flags() & HA_CAN_PARTITION_UNIQUE))) && |
|
|
|
ht= table->s->db_type(); |
|
|
|
if (unlikely((!(ht->partition_flags && |
|
|
|
(ht->partition_flags() & HA_CAN_PARTITION_UNIQUE))) && |
|
|
|
check_unique_keys(table))) |
|
|
|
goto end; |
|
|
|
if (unlikely(set_up_partition_bitmaps(thd, part_info))) |
|
|
@ -2713,12 +2717,14 @@ bool partition_key_modified(TABLE *table, const MY_BITMAP *fields) |
|
|
|
{ |
|
|
|
Field **fld; |
|
|
|
partition_info *part_info= table->part_info; |
|
|
|
handlerton *ht; |
|
|
|
DBUG_ENTER("partition_key_modified"); |
|
|
|
|
|
|
|
if (!part_info) |
|
|
|
DBUG_RETURN(FALSE); |
|
|
|
if (table->s->db_type()->partition_flags && |
|
|
|
(table->s->db_type()->partition_flags() & HA_CAN_UPDATE_PARTITION_KEY)) |
|
|
|
ht= table->s->db_type(); |
|
|
|
if (ht->partition_flags && |
|
|
|
(ht->partition_flags() & HA_CAN_UPDATE_PARTITION_KEY)) |
|
|
|
DBUG_RETURN(FALSE); |
|
|
|
for (fld= part_info->full_part_field_array; *fld; fld++) |
|
|
|
if (bitmap_is_set(fields, (*fld)->field_index)) |
|
|
@ -4927,11 +4933,10 @@ uint prep_alter_part_table(THD *thd, TABLE *table, Alter_info *alter_info, |
|
|
|
if default partitioning is used. |
|
|
|
*/ |
|
|
|
|
|
|
|
handlerton *ht= table->s->db_type(); |
|
|
|
if (tab_part_info->part_type != HASH_PARTITION || |
|
|
|
((table->s->db_type()->partition_flags() & HA_USE_AUTO_PARTITION) && |
|
|
|
!tab_part_info->use_default_num_partitions) || |
|
|
|
((!(table->s->db_type()->partition_flags() & HA_USE_AUTO_PARTITION)) && |
|
|
|
tab_part_info->use_default_num_partitions)) |
|
|
|
!(ht->partition_flags() & HA_USE_AUTO_PARTITION) == |
|
|
|
tab_part_info->use_default_num_partitions) |
|
|
|
{ |
|
|
|
my_error(ER_REORG_NO_PARAM_ERROR, MYF(0)); |
|
|
|
goto err; |
|
|
|