summaryrefslogtreecommitdiff
path: root/sql/item_func.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2017-12-12 09:35:18 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2017-12-12 09:57:17 +0200
commit34841d2305b6bbe2c0b496add905b1dd478dafbe (patch)
tree85b31de5caf44a9024d73e41fbdbdadb29ff5526 /sql/item_func.cc
parent62eaf7b657fd25bb4457049c81fb929314d6eb1d (diff)
parenta285e68018018ef3959f6381aa61347b73902997 (diff)
downloadmariadb-git-34841d2305b6bbe2c0b496add905b1dd478dafbe.tar.gz
Merge bb-10.2-ext into 10.3
Diffstat (limited to 'sql/item_func.cc')
-rw-r--r--sql/item_func.cc13
1 files changed, 10 insertions, 3 deletions
diff --git a/sql/item_func.cc b/sql/item_func.cc
index a8b4a64856e..55d141b9968 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -153,12 +153,19 @@ void Item_func::sync_with_sum_func_and_with_field(List<Item> &list)
bool Item_func::check_argument_types_like_args0() const
{
- uint cols;
- if (arg_count == 0)
+ if (arg_count < 2)
return false;
- cols= args[0]->cols();
+ uint cols= args[0]->cols();
+ bool is_scalar= args[0]->type_handler()->is_scalar_type();
for (uint i= 1; i < arg_count; i++)
{
+ if (is_scalar != args[i]->type_handler()->is_scalar_type())
+ {
+ my_error(ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION, MYF(0),
+ args[0]->type_handler()->name().ptr(),
+ args[i]->type_handler()->name().ptr(), func_name());
+ return true;
+ }
if (args[i]->check_cols(cols))
return true;
}