summaryrefslogtreecommitdiff
path: root/sql/item.cc
diff options
context:
space:
mode:
authorMichael Widenius <monty@mysql.com>2009-04-25 13:05:32 +0300
committerMichael Widenius <monty@mysql.com>2009-04-25 13:05:32 +0300
commite726e587ec6287472dd450dbcbddf07669b3e028 (patch)
treee644a6134bfe892512501c648c938a2e93f08130 /sql/item.cc
parent210a412522b10115d34b431c66acf403faab7bfe (diff)
parent086185089e6c7bef58dde49b02950689af9fee63 (diff)
downloadmariadb-git-e726e587ec6287472dd450dbcbddf07669b3e028.tar.gz
Merged with mysql-5.1 tree.
client/mysqltest.cc: Manually merged configure.in: Manually merged mysql-test/r/variables.result: Manually merged mysql-test/t/variables.test: Manually merged mysys/my_pread.c: Manually merged mysys/my_read.c: Manually merged sql/mysqld.cc: Manually merged storage/csv/ha_tina.h: Manually merged storage/myisam/ha_myisam.cc: Manually merged storage/myisam/mi_check.c: Manually merged storage/myisam/mi_search.c: Manually merged
Diffstat (limited to 'sql/item.cc')
-rw-r--r--sql/item.cc19
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)
{