1
/* Copyright 2005-2008 MySQL AB, 2008 Sun Microsystems, Inc.
1
/* Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
3
3
This program is free software; you can redistribute it and/or modify
4
4
it under the terms of the GNU General Public License as published by
784
Check for duplicate fields in the list.
785
Assuming that there are not many fields in the partition key list.
786
If there were, it would be better to replace the for-loop
787
with a more efficient algorithm.
790
field_name_array[fields_handled] = field_name;
791
for (int i = 0; i < fields_handled; ++i)
793
if (my_strcasecmp(system_charset_info,
794
field_name_array[i], field_name) == 0)
796
my_error(ER_FIELD_NOT_FOUND_PART_ERROR, MYF(0));
780
802
if (is_list_empty)
908
930
const char *save_where;
910
932
char db_name_string[FN_REFLEN];
911
bool save_use_only_table_context;
912
uint8 saved_full_group_by_flag;
913
nesting_map saved_allow_sum_func;
914
933
DBUG_ENTER("fix_fields_part_func");
916
935
if (part_info->fixed)
977
996
of interesting side effects, both desirable and undesirable.
980
save_use_only_table_context= thd->lex->use_only_table_context;
981
thd->lex->use_only_table_context= TRUE;
982
thd->lex->current_select->cur_pos_in_select_list= UNDEF_POS;
983
saved_full_group_by_flag= thd->lex->current_select->full_group_by_flag;
984
saved_allow_sum_func= thd->lex->allow_sum_func;
985
thd->lex->allow_sum_func= 0;
1000
const bool save_use_only_table_context= thd->lex->use_only_table_context;
1001
thd->lex->use_only_table_context= TRUE;
1002
thd->lex->current_select->cur_pos_in_select_list= UNDEF_POS;
1003
const bool save_agg_field= thd->lex->current_select->non_agg_field_used();
1004
const bool save_agg_func= thd->lex->current_select->agg_func_used();
1005
const nesting_map saved_allow_sum_func= thd->lex->allow_sum_func;
1006
thd->lex->allow_sum_func= 0;
987
error= func_expr->fix_fields(thd, (Item**)&func_expr);
990
Restore full_group_by_flag and allow_sum_func,
991
fix_fields should not affect mysql_select later, see Bug#46923.
993
thd->lex->current_select->full_group_by_flag= saved_full_group_by_flag;
994
thd->lex->allow_sum_func= saved_allow_sum_func;
996
thd->lex->use_only_table_context= save_use_only_table_context;
1008
error= func_expr->fix_fields(thd, (Item**)&func_expr);
1011
Restore agg_field/agg_func and allow_sum_func,
1012
fix_fields should not affect mysql_select later, see Bug#46923.
1014
thd->lex->current_select->set_non_agg_field_used(save_agg_field);
1015
thd->lex->current_select->set_agg_func_used(save_agg_func);
1016
thd->lex->allow_sum_func= saved_allow_sum_func;
1017
thd->lex->use_only_table_context= save_use_only_table_context;
998
1020
context->table_list= save_table_list;
999
1021
context->first_name_resolution_table= save_first_table;
1017
We don't allow creating partitions with timezone-dependent expressions as
1018
a (sub)partitioning function, but we want to allow such expressions when
1019
opening existing tables for easier maintenance. This exception should be
1020
deprecated at some point in future so that we always throw an error.
1039
We don't allow creating partitions with expressions with non matching
1040
arguments as a (sub)partitioning function,
1041
but we want to allow such expressions when opening existing tables for
1042
easier maintenance. This exception should be deprecated at some point
1043
in future so that we always throw an error.
1022
if (func_expr->walk(&Item::is_timezone_dependent_processor,
1045
if (func_expr->walk(&Item::check_valid_arguments_processor,
1025
1048
if (is_create_table_ind)
6549
6572
void mem_alloc_error(size_t size)
6551
my_error(ER_OUTOFMEMORY, MYF(0), size);
6574
my_error(ER_OUTOFMEMORY, MYF(0), static_cast<int>(size));
6554
6577
#ifdef WITH_PARTITION_STORAGE_ENGINE