1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

BUG#16806: ALTER TABLE with new field in before position fails

Review fixes


sql/sql_partition.cc:
  Review fixes
sql/sql_table.cc:
  Review fixes
This commit is contained in:
unknown
2006-03-24 18:21:43 -05:00
parent c1038471f5
commit d45ebd7aa2
2 changed files with 27 additions and 13 deletions

View File

@ -2154,24 +2154,22 @@ bool mysql_create_table_internal(THD *thd,
*/
if (part_info->use_default_no_partitions &&
part_info->no_parts &&
part_info->no_parts != file->get_default_no_partitions(0ULL))
(int)part_info->no_parts != file->get_default_no_partitions(0ULL))
{
uint i= 0;
bool first= TRUE;
uint i;
List_iterator<partition_element> part_it(part_info->partitions);
do
{
partition_element *part_elem= part_it++;
if (!first)
part_elem->part_state= PART_TO_BE_DROPPED;
first= FALSE;
} while (++i < part_info->partitions.elements);
part_it++;
DBUG_ASSERT(thd->lex->sql_command != SQLCOM_CREATE_TABLE);
for (i= 1; i < part_info->partitions.elements; i++)
(part_it++)->part_state= PART_TO_BE_DROPPED;
}
else if (part_info->is_sub_partitioned() &&
part_info->use_default_no_subpartitions &&
part_info->no_subparts &&
part_info->no_subparts != file->get_default_no_partitions(0ULL))
(int)part_info->no_subparts !=
file->get_default_no_partitions(0ULL))
{
DBUG_ASSERT(thd->lex->sql_command != SQLCOM_CREATE_TABLE);
part_info->no_subparts= file->get_default_no_partitions(0ULL);
}
}