summaryrefslogtreecommitdiff
path: root/sql/item.cc
diff options
context:
space:
mode:
authorunknown <bar@bar.mysql.r18.ru>2003-03-19 17:24:46 +0400
committerunknown <bar@bar.mysql.r18.ru>2003-03-19 17:24:46 +0400
commitdad9f548b7848e4a3b72f0229ee28713f291bdd2 (patch)
tree15bd6d30495327c82d283d95880c51d0110b853b /sql/item.cc
parent5ca52f5a71e67b58c5d0c47bbc638d1d7d540dcd (diff)
downloadmariadb-git-dad9f548b7848e4a3b72f0229ee28713f291bdd2.tar.gz
Produce an error when arguments are not compatible for CONCAT()
Diffstat (limited to 'sql/item.cc')
-rw-r--r--sql/item.cc16
1 files changed, 9 insertions, 7 deletions
diff --git a/sql/item.cc b/sql/item.cc
index b28b390c4a0..f2053c37fb7 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -180,13 +180,10 @@ bool Item::set_charset(CHARSET_INFO *cs1, enum coercion co1,
set_charset(&my_charset_bin, COER_NOCOLL);
return 0;
}
-
+
if (!my_charset_same(cs1,cs2))
- {
- set_charset(&my_charset_bin, COER_NOCOLL);
- return 0;
- }
-
+ return 1;
+
if (co1 < co2)
{
set_charset(cs1, co1);
@@ -198,7 +195,12 @@ bool Item::set_charset(CHARSET_INFO *cs1, enum coercion co1,
else // co2 == co1
{
if (cs1 != cs2)
- set_charset(&my_charset_bin, COER_NOCOLL);
+ {
+ CHARSET_INFO *bin= get_charset_by_csname(cs1->csname, MY_CS_BINSORT,MYF(0));
+ if (!bin)
+ return 1;
+ set_charset(bin, COER_NOCOLL);
+ }
else
set_charset(cs2, co2);
}