summaryrefslogtreecommitdiff
path: root/sql/sql_union.cc
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.com>2019-04-23 13:45:28 +0400
committerAlexander Barkov <bar@mariadb.com>2019-04-23 13:45:28 +0400
commitbaadbe96019b205164167928d80e836ebbb6bcfe (patch)
tree62e375c4a05bd8a6b699eb86a9757a01655245c5 /sql/sql_union.cc
parenta765b19e5ca31a3d866cdbc8bef3a6f4e5e44688 (diff)
downloadmariadb-git-baadbe96019b205164167928d80e836ebbb6bcfe.tar.gz
MDEV-9234 Add Type_handler::union_element_finalize()10.4-staging
Diffstat (limited to 'sql/sql_union.cc')
-rw-r--r--sql/sql_union.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/sql/sql_union.cc b/sql/sql_union.cc
index 528292e5177..e10c0af2e16 100644
--- a/sql/sql_union.cc
+++ b/sql/sql_union.cc
@@ -1085,12 +1085,12 @@ cont:
while ((type= tp++))
{
- if (type->cmp_type() == STRING_RESULT &&
- type->collation.derivation == DERIVATION_NONE)
- {
- my_error(ER_CANT_AGGREGATE_NCOLLATIONS, MYF(0), "UNION");
+ /*
+ Test if the aggregated data type is OK for a UNION element.
+ E.g. in case of string data, DERIVATION_NONE is not allowed.
+ */
+ if (type->type_handler()->union_element_finalize(type))
goto err;
- }
}
/*