Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 118642 - MySQL 5.0.18 - Illegal mix of collations
Summary: MySQL 5.0.18 - Illegal mix of collations
Status: RESOLVED TEST-REQUEST
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High blocker
Assignee: Gentoo Linux MySQL bugs team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-11 03:47 UTC by Kristaps Kaupe
Modified: 2006-03-18 04:35 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kristaps Kaupe 2006-01-11 03:47:47 UTC
After upgrading from MySQL 5.0.17 to 5.0.18, stored procedures which used VARCHAR fields in WHERE clause does not work anymore. When I call such procedure I get error "ERROR 1267 (HY000): Illegal mix of collations (utf8_unicode_ci,IMPLICIT) and (utf8_general_ci,IMPLICIT) for operation '='". Only solution I have found for now is to mask MySQL 5.0.18 and downgrade back to 5.0.17. If that matters, data is stored in InnoDB tables.

My make.conf:
-------------
CFLAGS="-O2 -march=pentium4 -fomit-frame-pointer -pipe"
CHOST="i686-pc-linux-gnu"
CXXFLAGS="${CFLAGS}"
MAKEOPTS="-j2"
LINGUAS="lv"
USE="gtk -gnome qt kde dvd alsa cdr dvdr apache2 mysql pam ssl xml xml2 berkdb innodb use cups foomaticdb ppds usb win32codecs mmx sse gd bash-completion unicode svg"
FEATURES="distlocks parallel-fetch confcache fixpackages"
Comment 1 Francesco R. (RETIRED) gentoo-dev 2006-01-11 07:36:38 UTC
This may be related to upstream bug 16211.

Anyway could you create a test case, an example follow:

===============================
mysql> use test ;
Database changed
mysql> delimiter //
mysql> CREATE FUNCTION hello (s CHAR(20)) RETURNS CHAR(50)
    -> NO SQL
    -> RETURN CONCAT('Hello, ',s,'!');
    -> //
Query OK, 0 rows affected (0.00 sec)

mysql> delimiter ;
mysql>
mysql> select charset(hello('world'));
+-------------------------+
| charset(hello('world')) |
+-------------------------+
| binary                  |
+-------------------------+
1 row in set (0.00 sec)

mysql> CREATE TABLE `t1` (
    ->   `f1` varchar(100) default NULL
    -> ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
Query OK, 0 rows affected (0.82 sec)

mysql> insert into t1 values ("alpha"), ("Hello, world!"), ("beta"), ("gamma");
Query OK, 4 rows affected (0.00 sec)
Records: 4  Duplicates: 0  Warnings: 0

mysql> SELECT * FROM t1
    -> WHERE t1.f1 = hello('world') ;
+---------------+
| f1            |
+---------------+
| Hello, world! |
+---------------+
1 row in set (0.00 sec)
===============================

As you can see this case is working, the test case should be able to reproduce the error.
Comment 2 Jakub Moc (RETIRED) gentoo-dev 2006-01-12 05:32:08 UTC
Please read http://blog.stuartherbert.com/gentoo.php/2006/01/11/fun_with_collations 
Comment 3 Francesco R. (RETIRED) gentoo-dev 2006-01-12 07:03:04 UTC
(In reply to comment #2)
> Please read
> http://blog.stuartherbert.com/gentoo.php/2006/01/11/fun_with_collations 
> 

I think this is a different bug, does --[skip-]character-set-client-handshake option help in your case ?

http://dev.mysql.com/doc/refman/5.0/en/mysqld-safe.html
http://bugs.mysql.com/bug.php?id=9948

Comment 4 Francesco R. (RETIRED) gentoo-dev 2006-03-18 04:35:52 UTC
fixed in 5.0.19 ?