Skip to content

Commit 258d032

Browse files
author
Mattias Jonsson
committed
Bug#54483: valgrind errors when making warnings for
multiline inserts into partition Bug#57071: EXTRACT(WEEK from date_col) cannot be allowed as partitioning function Renamed function according to reviewers comments. --BZR-- revision-id: [email protected] property-branch-nick: b54483-51-bt_2 property-file-info: ld7:file_id59:sp1f-item.h-19700101030959-rrkb43htudd62batmoteashkebcwykpa7:message33:better name of processor function4:path10:sql/item.hed7:file_id64:sp1f-item_func.h-19700101030959-fbjcbwkg66qubbzptqwh5w5evhnpukze7:message33:better name of processor function4:path15:sql/item_func.hed7:file_id68:sp1f-item_timefunc.h-19700101030959-o34ypz6ggolzqmhgsjnqh6inkvgugi467:message33:better name of processor function4:path19:sql/item_timefunc.hed7:file_id69:sp1f-sql_partition.cc-20050718113038-57h5bzswps6cel2y7k7qideue3ghbg3u7:message50:better name of processor function property-file-info: Updated comment.4:path20:sql/sql_partition.ccee testament3-sha1: c8535a0ff0a298da159a55552460b1f197311c3a
1 parent 53bc68c commit 258d032

File tree

4 files changed

+24
-23
lines changed

4 files changed

+24
-23
lines changed

sql/item.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -970,7 +970,7 @@ class Item {
970970
for date functions. Also used by partitioning code to reject
971971
timezone-dependent expressions in a (sub)partitioning function.
972972
*/
973-
virtual bool is_arguments_valid_processor(uchar *bool_arg)
973+
virtual bool check_valid_arguments_processor(uchar *bool_arg)
974974
{
975975
return FALSE;
976976
}

sql/item_func.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ class Item_func :public Item_result_field
248248
representation of a TIMESTAMP argument verbatim, and thus does not depend on
249249
the timezone.
250250
*/
251-
virtual bool is_arguments_valid_processor(uchar *bool_arg)
251+
virtual bool check_valid_arguments_processor(uchar *bool_arg)
252252
{
253253
return has_timestamp_args();
254254
}

sql/item_timefunc.h

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class Item_func_to_days :public Item_int_func
7070
enum_monotonicity_info get_monotonicity_info() const;
7171
longlong val_int_endpoint(bool left_endp, bool *incl_endp);
7272
bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
73-
bool is_arguments_valid_processor(uchar *int_arg)
73+
bool check_valid_arguments_processor(uchar *int_arg)
7474
{
7575
return !has_date_args();
7676
}
@@ -90,7 +90,7 @@ class Item_func_dayofmonth :public Item_int_func
9090
maybe_null=1;
9191
}
9292
bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
93-
bool is_arguments_valid_processor(uchar *int_arg)
93+
bool check_valid_arguments_processor(uchar *int_arg)
9494
{
9595
return !has_date_args();
9696
}
@@ -119,7 +119,7 @@ class Item_func_month :public Item_func
119119
maybe_null=1;
120120
}
121121
bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
122-
bool is_arguments_valid_processor(uchar *int_arg)
122+
bool check_valid_arguments_processor(uchar *int_arg)
123123
{
124124
return !has_date_args();
125125
}
@@ -152,7 +152,7 @@ class Item_func_dayofyear :public Item_int_func
152152
maybe_null=1;
153153
}
154154
bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
155-
bool is_arguments_valid_processor(uchar *int_arg)
155+
bool check_valid_arguments_processor(uchar *int_arg)
156156
{
157157
return !has_date_args();
158158
}
@@ -172,7 +172,7 @@ class Item_func_hour :public Item_int_func
172172
maybe_null=1;
173173
}
174174
bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
175-
bool is_arguments_valid_processor(uchar *int_arg)
175+
bool check_valid_arguments_processor(uchar *int_arg)
176176
{
177177
return !has_time_args();
178178
}
@@ -192,7 +192,7 @@ class Item_func_minute :public Item_int_func
192192
maybe_null=1;
193193
}
194194
bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
195-
bool is_arguments_valid_processor(uchar *int_arg)
195+
bool check_valid_arguments_processor(uchar *int_arg)
196196
{
197197
return !has_time_args();
198198
}
@@ -212,7 +212,7 @@ class Item_func_quarter :public Item_int_func
212212
maybe_null=1;
213213
}
214214
bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
215-
bool is_arguments_valid_processor(uchar *int_arg)
215+
bool check_valid_arguments_processor(uchar *int_arg)
216216
{
217217
return !has_date_args();
218218
}
@@ -232,7 +232,7 @@ class Item_func_second :public Item_int_func
232232
maybe_null=1;
233233
}
234234
bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
235-
bool is_arguments_valid_processor(uchar *int_arg)
235+
bool check_valid_arguments_processor(uchar *int_arg)
236236
{
237237
return !has_time_args();
238238
}
@@ -266,7 +266,7 @@ class Item_func_yearweek :public Item_int_func
266266
maybe_null=1;
267267
}
268268
bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
269-
bool is_arguments_valid_processor(uchar *int_arg)
269+
bool check_valid_arguments_processor(uchar *int_arg)
270270
{
271271
return !has_date_args();
272272
}
@@ -288,7 +288,7 @@ class Item_func_year :public Item_int_func
288288
maybe_null=1;
289289
}
290290
bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
291-
bool is_arguments_valid_processor(uchar *int_arg)
291+
bool check_valid_arguments_processor(uchar *int_arg)
292292
{
293293
return !has_date_args();
294294
}
@@ -322,7 +322,7 @@ class Item_func_weekday :public Item_func
322322
maybe_null=1;
323323
}
324324
bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
325-
bool is_arguments_valid_processor(uchar *int_arg)
325+
bool check_valid_arguments_processor(uchar *int_arg)
326326
{
327327
return !has_date_args();
328328
}
@@ -355,7 +355,7 @@ class Item_func_unix_timestamp :public Item_int_func
355355
(and thus may not be used as a partitioning function)
356356
when its argument is NOT of the TIMESTAMP type.
357357
*/
358-
bool is_arguments_valid_processor(uchar *int_arg)
358+
bool check_valid_arguments_processor(uchar *int_arg)
359359
{
360360
return !has_timestamp_args();
361361
}
@@ -380,7 +380,7 @@ class Item_func_time_to_sec :public Item_int_func
380380
max_length=10*MY_CHARSET_BIN_MB_MAXLEN;
381381
}
382382
bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
383-
bool is_arguments_valid_processor(uchar *int_arg)
383+
bool check_valid_arguments_processor(uchar *int_arg)
384384
{
385385
return !has_time_args();
386386
}
@@ -637,7 +637,7 @@ class Item_func_from_days :public Item_date
637637
const char *func_name() const { return "from_days"; }
638638
bool get_date(MYSQL_TIME *res, uint fuzzy_date);
639639
bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
640-
bool is_arguments_valid_processor(uchar *int_arg)
640+
bool check_valid_arguments_processor(uchar *int_arg)
641641
{
642642
return has_date_args() || has_time_args();
643643
}
@@ -767,7 +767,7 @@ class Item_extract :public Item_int_func
767767
bool eq(const Item *item, bool binary_cmp) const;
768768
virtual void print(String *str, enum_query_type query_type);
769769
bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
770-
bool is_arguments_valid_processor(uchar *int_arg)
770+
bool check_valid_arguments_processor(uchar *int_arg)
771771
{
772772
switch (int_type) {
773773
case INTERVAL_YEAR:
@@ -1053,7 +1053,7 @@ class Item_func_microsecond :public Item_int_func
10531053
maybe_null=1;
10541054
}
10551055
bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
1056-
bool is_arguments_valid_processor(uchar *int_arg)
1056+
bool check_valid_arguments_processor(uchar *int_arg)
10571057
{
10581058
return !has_time_args();
10591059
}

sql/sql_partition.cc

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1014,12 +1014,13 @@ static bool fix_fields_part_func(THD *thd, Item* func_expr, TABLE *table,
10141014
}
10151015

10161016
/*
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.
1017+
We don't allow creating partitions with expressions with non matching
1018+
arguments as a (sub)partitioning function,
1019+
but we want to allow such expressions when opening existing tables for
1020+
easier maintenance. This exception should be deprecated at some point
1021+
in future so that we always throw an error.
10211022
*/
1022-
if (func_expr->walk(&Item::is_arguments_valid_processor,
1023+
if (func_expr->walk(&Item::check_valid_arguments_processor,
10231024
0, NULL))
10241025
{
10251026
if (is_create_table_ind)

0 commit comments

Comments
 (0)