Bug #45183 | Prepared statement with eucjpms made wrong strings for binlog. | ||
---|---|---|---|
Submitted: | 29 May 2009 9:40 | Modified: | 4 Sep 2012 12:30 |
Reporter: | Meiji KIMURA | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: Prepared statements | Severity: | S2 (Serious) |
Version: | 5.0.44 5.0.82 | OS: | Linux |
Assigned to: | CPU Architecture: | Any |
[29 May 2009 9:40]
Meiji KIMURA
[31 May 2009 8:24]
Meiji KIMURA
binlog for this problem.
Attachment: mysql-bin.000001 (application/octet-stream, text), 1.32 KiB.
[14 Oct 2009 7:05]
Meiji KIMURA
I did two mistakes. 1) This problem for Server-side prepared statement. These procedure uses old interface, but not client-side prepared statement. It's 'Server-side prepared' statement. 2) It seems that strings of prepared statement for binlog are affected by character_set_connection. not character_set_client, so if I use 'SET NAMES eucjpms;' instead of 'SET CHARACTER SET eucjpms; ', it works well. [New work around] Use 'SET NAMES eucjpms;' instead of 'SET CHARACTER SET eucjpms;'
[19 Oct 2009 8:03]
Meiji KIMURA
I supposed that the specification is not good. It is difficult to understand these behaviors. Especially, the read data are different from binlog data. They should be the same, so I hope that it will be improved.
[18 Feb 2011 0:00]
Bugs System
No feedback was provided for this bug for over a month, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open".
[4 Sep 2012 12:30]
Praveenkumar Hulakund
"SET CHARACTER SET eucjpms" affects the following connection-related character set variables SET character_set_client = eucjpms; SET character_set_results = eucjpms; SET collation_connection = @@collation_database; collection_connection is important for the literals used. Here, collation_connection is set to character set of collation_database. As we are not setting collation_database explicitly, the value of collation_database is set to default character set type. Because of this, the value of @0 is converted to default character set(collation_connection) type while inserting tuple into the table using prepared statements (thats why binlog contains converted value). And while sending result of the query to client character_set_results(i.e. eucjpms) is used. Set collation_connection to "eucjpms" explicitly to avoid conversion of string literal value(@0) used in prepared statement or as mentioned in Workaround, use "SET NAMES eucjpms". "SET NAMES eucjpms" affects the following connection-related character set variables SET character_set_client = eucjpms; SET character_set_results = eucjpms; SET character_set_connection = eucjpms; Setting character_set_connection to "eucjpms" also implicitly sets collation_connection to the default collation for "eucjpms". Please refer following link for more information http://dev.mysql.com/doc/refman/5.6/en/charset-connection.html MySQL is behaving properly with character set. Improper setting of character set resulted in the behavior mentioned above. After discussing this with Sveta, setting this bug status to "No Bug".