MySQL Bugs: #3611: Illegal mix of collations error

发表于:2007-05-25来源:作者:点击数: 标签:MySQLbugs#3611Illegalmix
http://bugs.mysql.com/bug.php?id=3611 [30 Apr 2004 2:24pm] Oleg Ivanov Description: After migrating from 3.0.9 driver to 3.1.1alpha some SELECTS could not be executed due to error: Illegal mix of collations.. If it is a bug it must be solv
http://bugs.mysql.com/bug.php?id=3611

[30 Apr 2004 2:24pm] Oleg Ivanov
Description:
After migrating from 3.0.9 driver to 3.1.1alpha some SELECTS could not be
executed due to error: "Illegal mix of collations.."
If it is a bug it must be solved, because jdbc driver are COMPLETELY broken. If
it is a "feature", it must be documented. It is not a good practice when
switching a jdbc drivers goes application unusable.

How to repeat:
Simple query:
rset = stmt.executeQuery("SELECT A, B, C FROM TABS WHERE
EMAIL=LOWER('"+user+"')");

return an exception:
General error message from server: "Illegal mix of collations
(cp1251_bulgarian_ci,IMPLICIT) and (latin1_swedish_ci,COERCIBLE) for operation
'='"

The same error is reported in list http://lists.mysql.com/java/7373

Suggested fix:
[30 Apr 2004 3:23pm] Mark Matthews
This is a duplicate of #2177.

The error is caused by changes needed to support MySQL-4.1, which were made when
the charsets functionality in MySQL-4.1 was still in flux.

You will need to download the latest nightly snapshot of Connector/J 3.1 from
http://downloads.mysql.com/snapshots.php to see the fix, or wait for the release
of Connector/J 3.1.2.

原文转自:http://www.ltesting.net