diff options
Diffstat (limited to 'sql/item.cc')
-rw-r--r-- | sql/item.cc | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/sql/item.cc b/sql/item.cc index 35a88d10fe0..010e4cb441a 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -1527,7 +1527,8 @@ bool DTCollation::aggregate(DTCollation &dt, uint flags) else { // Cannot apply conversion - set(0, DERIVATION_NONE, 0); + set(&my_charset_bin, DERIVATION_NONE, + (dt.repertoire|repertoire)); return 1; } } @@ -1610,15 +1611,31 @@ bool agg_item_collations(DTCollation &c, const char *fname, { uint i; Item **arg; + bool unknown_cs= 0; + c.set(av[0]->collation); for (i= 1, arg= &av[item_sep]; i < count; i++, arg++) { if (c.aggregate((*arg)->collation, flags)) { + if (c.derivation == DERIVATION_NONE && + c.collation == &my_charset_bin) + { + unknown_cs= 1; + continue; + } my_coll_agg_error(av, count, fname, item_sep); return TRUE; } } + + if (unknown_cs && + c.derivation != DERIVATION_EXPLICIT) + { + my_coll_agg_error(av, count, fname, item_sep); + return TRUE; + } + if ((flags & MY_COLL_DISALLOW_NONE) && c.derivation == DERIVATION_NONE) { |