mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Manual merge from mysql-trunk-merge.
Conflicts: - extra/comp_err.c - mysql-test/collections/default.experimental - mysql-test/r/archive.result - mysql-test/r/select.result - mysql-test/suite/binlog/r/binlog_unsafe.result - mysql-test/suite/binlog/t/binlog_unsafe.test - mysql-test/suite/rpl/t/disabled.def - mysql-test/t/archive.test - mysql-test/t/select.test - sql/item.cc - sql/item.h - sql/item_timefunc.cc - sql/sql_base.cc - sql/sql_delete.cc - sql/sql_load.cc - sql/sql_partition.cc - sql/sql_table.cc - storage/innobase/handler/ha_innodb.cc - vio/vio.c
This commit is contained in:
@@ -238,26 +238,27 @@ bool partition_default_handling(TABLE *table, partition_info *part_info,
|
||||
{
|
||||
DBUG_ENTER("partition_default_handling");
|
||||
|
||||
if (part_info->use_default_num_partitions)
|
||||
if (!is_create_table_ind)
|
||||
{
|
||||
if (!is_create_table_ind &&
|
||||
table->file->get_no_parts(normalized_path, &part_info->num_parts))
|
||||
if (part_info->use_default_num_partitions)
|
||||
{
|
||||
DBUG_RETURN(TRUE);
|
||||
if (table->file->get_no_parts(normalized_path, &part_info->num_parts))
|
||||
{
|
||||
DBUG_RETURN(TRUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (part_info->is_sub_partitioned() &&
|
||||
part_info->use_default_num_subpartitions)
|
||||
{
|
||||
uint num_parts;
|
||||
if (!is_create_table_ind &&
|
||||
(table->file->get_no_parts(normalized_path, &num_parts)))
|
||||
else if (part_info->is_sub_partitioned() &&
|
||||
part_info->use_default_num_subpartitions)
|
||||
{
|
||||
DBUG_RETURN(TRUE);
|
||||
uint num_parts;
|
||||
if (table->file->get_no_parts(normalized_path, &num_parts))
|
||||
{
|
||||
DBUG_RETURN(TRUE);
|
||||
}
|
||||
DBUG_ASSERT(part_info->num_parts > 0);
|
||||
DBUG_ASSERT((num_parts % part_info->num_parts) == 0);
|
||||
part_info->num_subparts= num_parts / part_info->num_parts;
|
||||
}
|
||||
DBUG_ASSERT(part_info->num_parts > 0);
|
||||
part_info->num_subparts= num_parts / part_info->num_parts;
|
||||
DBUG_ASSERT((num_parts % part_info->num_parts) == 0);
|
||||
}
|
||||
part_info->set_up_defaults_for_partitioning(table->file,
|
||||
(ulonglong)0, (uint)0);
|
||||
@@ -1056,6 +1057,8 @@ static bool fix_fields_part_func(THD *thd, Item* func_expr, TABLE *table,
|
||||
const char *save_where;
|
||||
LEX *old_lex= thd->lex;
|
||||
LEX lex;
|
||||
uint8 saved_full_group_by_flag;
|
||||
nesting_map saved_allow_sum_func;
|
||||
DBUG_ENTER("fix_fields_part_func");
|
||||
|
||||
if (init_lex_with_single_table(thd, table, &lex))
|
||||
@@ -1081,8 +1084,19 @@ static bool fix_fields_part_func(THD *thd, Item* func_expr, TABLE *table,
|
||||
This is a tricky call to prepare for since it can have a large number
|
||||
of interesting side effects, both desirable and undesirable.
|
||||
*/
|
||||
saved_full_group_by_flag= thd->lex->current_select->full_group_by_flag;
|
||||
saved_allow_sum_func= thd->lex->allow_sum_func;
|
||||
thd->lex->allow_sum_func= 0;
|
||||
|
||||
error= func_expr->fix_fields(thd, (Item**)&func_expr);
|
||||
|
||||
/*
|
||||
Restore full_group_by_flag and allow_sum_func,
|
||||
fix_fields should not affect mysql_select later, see Bug#46923.
|
||||
*/
|
||||
thd->lex->current_select->full_group_by_flag= saved_full_group_by_flag;
|
||||
thd->lex->allow_sum_func= saved_allow_sum_func;
|
||||
|
||||
if (unlikely(error))
|
||||
{
|
||||
DBUG_PRINT("info", ("Field in partition function not part of table"));
|
||||
@@ -1793,8 +1807,8 @@ bool fix_partition_func(THD *thd, TABLE *table,
|
||||
if (((part_info->part_type != HASH_PARTITION ||
|
||||
part_info->list_of_part_fields == FALSE) &&
|
||||
(!part_info->column_list &&
|
||||
check_part_func_fields(part_info->part_field_array, TRUE))) ||
|
||||
(part_info->list_of_part_fields == FALSE &&
|
||||
check_part_func_fields(part_info->part_field_array, TRUE))) ||
|
||||
(part_info->list_of_subpart_fields == FALSE &&
|
||||
part_info->is_sub_partitioned() &&
|
||||
check_part_func_fields(part_info->subpart_field_array, TRUE)))
|
||||
{
|
||||
|
Reference in New Issue
Block a user