Bug #57262 useOldUTF8Behavior fails
Submitted: 5 Oct 2010 20:45 Modified: 6 Oct 2010 14:44
Reporter: Todd Farmer (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / J Severity:S2 (Serious)
Version:5.1.13 OS:Any
Assigned to: Tony Bedford CPU Architecture:Any

[5 Oct 2010 20:45] Todd Farmer
Description:
Using the useOldUTF8Behavior parameter fails to set the connection character set to "latin1" as is required.  In versions prior to 5.1.3, the handshake was done using latin1, and while there was logic in place to explicitly set the character set after the handshake was complete, this was bypassed when useOldUTF8Behavior was true.  This wasn't a problem until 5.1.3, when the handshake was modified to use utf8, but the logic continued to allow the character set configured during that handshake process to be retained for later use.  As a result, useOldUTF8Behavior effectively failed.

How to repeat:
Connect with useOldUTF8Behavior=true, note that character_set_connection is not latin1.

Suggested fix:
Explicitly set character set to latin1 during post-initialization.
[5 Oct 2010 22:23] Todd Farmer
Fixed in 5.1 branch, r981.
[6 Oct 2010 14:44] Tony Bedford
An entry has been added to the 5.1.14 changelog:

Using the useOldUTF8Behavior parameter failed to set the connection character set to latin1 as required.

In versions prior to 5.1.3, the handshake was done using latin1, and while there was logic in place to explicitly set the character set after the handshake was complete, this was bypassed when useOldUTF8Behavior was true. This was not a problem until 5.1.3, when the handshake was modified to use utf8, but the logic continued to allow the character set configured during that handshake process to be retained for later use. As a result, useOldUTF8Behavior effectively failed.