Skip to content

MySQL adapter silently truncates strings with 4 byte UTF-8 chars #658

Closed
lighthouse-import opened this Issue May 16, 2011 · 4 comments

1 participant

@lighthouse-import

Imported from Lighthouse. Original ticket at: http://rails.lighthouseapp.com/projects/8994/tickets/3983
Created by andreas - 2010-10-02 09:56:33 UTC

MySQL does not support 4 byte characters in UTF-8 strings. If you try to insert/update a row with a string containing a 4 byte character, the statement succeeds, but the string is truncated at the position of the character. Only the warnings indicate that something went wrong:

mysql> set names 'utf8';                                                        Query OK, 0 rows affected (0.00 sec)
mysql> update test set `test` = 'AAAAAAAAAAAAA
@lighthouse-import

Imported from Lighthouse.
Comment by andreas - 2010-09-27 10:09:15 UTC

Confirmed that this is still open with rails 3.0.0 and jdbcmysql.

@lighthouse-import

Imported from Lighthouse.
Comment by David Trasbo - 2010-10-09 14:40:55 UTC

Please provide a patch (https://rails.lighthouseapp.com/projects/8994/sending-patches) with a failing test and/or a fix.

@lighthouse-import

Imported from Lighthouse.
Comment by Santiago Pastorino - 2011-02-02 16:58:06 UTC

This issue has been automatically marked as stale because it has not been commented on for at least three months.

The resources of the Rails core team are limited, and so we are asking for your help. If you can still reproduce this error on the 3-0-stable branch or on master, please reply with all of the information you have about it and add "[state:open]" to your comment. This will reopen the ticket for review. Likewise, if you feel that this is a very important feature for Rails to include, please reply with your explanation so we can consider it.

Thank you for all your contributions, and we hope you will understand this step to focus our efforts where they are most helpful.

@lighthouse-import

Imported from Lighthouse.
Comment by andreas - 2011-04-06 21:11:03 UTC

[state:open]

Still open in latest 3.x.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.