summaryrefslogtreecommitdiff
path: root/sql/item_cmpfunc.h
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.org>2017-05-29 10:29:46 +0400
committerAlexander Barkov <bar@mariadb.org>2017-05-29 10:29:46 +0400
commit8b68263a531bf6926afea71fe6eaf2ffd5a85049 (patch)
tree18f856a87aa714ddc48e292c0bded53faf95e08c /sql/item_cmpfunc.h
parent0f0bced885d6a6e6e494f227ac36419dd7bd3f80 (diff)
downloadmariadb-git-8b68263a531bf6926afea71fe6eaf2ffd5a85049.tar.gz
MDEV-12803 Improve function parameter data type control
Diffstat (limited to 'sql/item_cmpfunc.h')
-rw-r--r--sql/item_cmpfunc.h24
1 files changed, 15 insertions, 9 deletions
diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h
index 3c61a9c1566..e21e074a7a3 100644
--- a/sql/item_cmpfunc.h
+++ b/sql/item_cmpfunc.h
@@ -481,12 +481,14 @@ class Item_bool_rowready_func2 :public Item_bool_func2_with_rev
{
protected:
Arg_comparator cmp;
+ bool check_arguments() const
+ {
+ return check_argument_types_like_args0();
+ }
public:
Item_bool_rowready_func2(THD *thd, Item *a, Item *b):
Item_bool_func2_with_rev(thd, a, b), cmp(tmp_arg, tmp_arg + 1)
- {
- allowed_arg_cols= 0; // Fetch this value from first argument
- }
+ { }
void print(String *str, enum_query_type query_type)
{
Item_func::print_op(str, query_type);
@@ -952,12 +954,14 @@ class Item_func_interval :public Item_long_func
Item_row *row;
bool use_decimal_comparison;
interval_range *intervals;
+ bool check_arguments() const
+ {
+ return check_argument_types_like_args0();
+ }
public:
Item_func_interval(THD *thd, Item_row *a):
Item_long_func(thd, a), row(a), intervals(0)
- {
- allowed_arg_cols= 0; // Fetch this value from first argument
- }
+ { }
longlong val_int();
void fix_length_and_dec();
const char *func_name() const { return "interval"; }
@@ -2117,6 +2121,10 @@ class Item_func_in :public Item_func_opt_neg,
return true;
}
bool prepare_predicant_and_values(THD *thd, uint *found_types);
+ bool check_arguments() const
+ {
+ return check_argument_types_like_args0();
+ }
protected:
SEL_TREE *get_func_mm_tree(RANGE_OPT_PARAM *param,
Field *field, Item *value);
@@ -2141,9 +2149,7 @@ public:
Predicant_to_list_comparator(thd, arg_count - 1),
array(0), have_null(0),
arg_types_compatible(FALSE)
- {
- allowed_arg_cols= 0; // Fetch this value from first argument
- }
+ { }
longlong val_int();
bool fix_fields(THD *, Item **);
void fix_length_and_dec();