Skip to content
Permalink
Browse files

MDEV-9862 Illegal mix of collation, when comparing column with CASE e…

…xpression
  • Loading branch information...
abarkov committed Apr 1, 2016
1 parent 11b77e9 commit 777c2131dd7aeaf25adbbbbb0c213950e852f22b
Showing with 31 additions and 1 deletion.
  1. +14 −0 mysql-test/r/ctype_cp850.result
  2. +16 −0 mysql-test/t/ctype_cp850.test
  3. +1 −1 sql/item.h
@@ -0,0 +1,14 @@
#
# Start of 5.5 tests
#
#
# MDEV-9862 Illegal mix of collation, when comparing column with CASE expression
#
SET NAMES cp850;
CREATE TABLE t1 (a CHAR(1) CHARACTER SET latin1);
SELECT a FROM t1 WHERE CASE a WHEN 'aaaa' THEN 'Y' WHEN 'aaaa' THEN 'Y' ELSE NULL END <> a;
a
DROP TABLE t1;
#
# End of 5.5 tests
#
@@ -0,0 +1,16 @@
--echo #
--echo # Start of 5.5 tests
--echo #

--echo #
--echo # MDEV-9862 Illegal mix of collation, when comparing column with CASE expression
--echo #
SET NAMES cp850;
CREATE TABLE t1 (a CHAR(1) CHARACTER SET latin1);
SELECT a FROM t1 WHERE CASE a WHEN 'aaaa' THEN 'Y' WHEN 'aaaa' THEN 'Y' ELSE NULL END <> a;
DROP TABLE t1;


--echo #
--echo # End of 5.5 tests
--echo #
@@ -2175,7 +2175,7 @@ class Item_null :public Item_basic_constant
max_length= 0;
name= name_par ? name_par : (char*) "NULL";
fixed= 1;
collation.set(&my_charset_bin, DERIVATION_IGNORABLE);
collation.set(&my_charset_bin, DERIVATION_IGNORABLE, MY_REPERTOIRE_ASCII);
}
enum Type type() const { return NULL_ITEM; }
bool eq(const Item *item, bool binary_cmp) const;

0 comments on commit 777c213

Please sign in to comment.
You can’t perform that action at this time.