Details
-
Task
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
Description
There is a code in sql_union.cc which checks that an Item is OK as a UNION field.
while ((type= tp++))
|
{
|
if (type->cmp_type() == STRING_RESULT &&
|
type->collation.derivation == DERIVATION_NONE)
|
{
|
my_error(ER_CANT_AGGREGATE_NCOLLATIONS, MYF(0), "UNION");
|
goto err;
|
}
|
}
|
Currently, this code has only one purpose: In case of character string data types it makes sure that the aggregated data type has a non-conflicting collation, to disallow this:
mysql> (SELECT 'a' COLLATE utf8_general_ci) UNION (SELECT 'b' COLLATE utf8_unicode_ci);
|
ERROR 1267 (HY000): Illegal mix of collations (utf8_general_ci,EXPLICIT) and (utf8_unicode_ci,EXPLICIT) for operation 'UNION'
|
All other built-in data types have no additional requirements on the aggregated data type.
But user defined data types may want to have their own requirements.
This code should go into a new virtual method in Type_handler.
Attachments
Issue Links
- blocks
-
MDEV-4912 Data type plugin API version 1
- Closed
- relates to
-
MDEV-12775 Reuse data type aggregation code for hybrid functions and UNION
- Closed