1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Bug #6139 UNION doesn't understand collate in the column of second select

This commit is contained in:
bar@mysql.com
2004-10-18 17:56:25 +05:00
parent f687608e1c
commit 47f638054e
4 changed files with 152 additions and 2 deletions

View File

@ -264,6 +264,23 @@ int st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result,
}
}
{
/*
Check that it was possible to aggregate all collations together.
*/
List_iterator_fast<Item> tp(types);
Item *type;
while ((type= tp++))
{
if (type->result_type() == STRING_RESULT &&
type->collation.derivation == DERIVATION_NONE)
{
my_error(ER_CANT_AGGREGATE_NCOLLATIONS, MYF(0), "UNION");
goto err;
}
}
}
// it is not single select
if (first_select->next_select())
{