Bug #40698 | after binary to varchar convertion varchar isn't variable | ||
---|---|---|---|
Submitted: | 13 Nov 2008 13:43 | Modified: | 17 Nov 2008 17:13 |
Reporter: | Susanne Ebrecht | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Documentation | Severity: | S3 (Non-critical) |
Version: | OS: | Any | |
Assigned to: | Paul DuBois | CPU Architecture: | Any |
[13 Nov 2008 13:43]
Susanne Ebrecht
[13 Nov 2008 13:46]
Susanne Ebrecht
This is related to http://bugs.mysql.com/bug.php?id=21508. There you will read that you should use VARBINARY instead of BINARY. The documentation is confusing here: http://dev.mysql.com/doc/refman/5.1/en/charset-conversion.html http://dev.mysql.com/doc/refman/5.0/en/charset-conversion.html It would be nice when there would not only be an example for BINARY and CHAR. An example for VARBINARY and VARCHAR would help here to not confuse the users.
[17 Nov 2008 17:13]
Paul DuBois
Thank you for your bug report. This issue has been addressed in the documentation. The updated documentation will appear on our website shortly, and will be included in the next release of the relevant products. I've done two things: 1) Updated the examples to use variable-length binary types, thus not introducing the pad-with-0x00 problem in the first place. 2) Pointed out that if you do use BINARY, you can remove trailing 0x00 after the conversion like this: UPDATE t SET col1 = TRIM(TRAILING 0x00 FROM col1);