Bug #30619 | Length for CHAR and VARCHAR supposed to be a number of chars, not bytes | ||
---|---|---|---|
Submitted: | 24 Aug 2007 9:20 | Modified: | 24 Aug 2007 10:19 |
Reporter: | Roland Bouman | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: Data Types | Severity: | S2 (Serious) |
Version: | 5.0.45 | OS: | Linux (kubuntu feistt) |
Assigned to: | CPU Architecture: | Any |
[24 Aug 2007 9:20]
Roland Bouman
[24 Aug 2007 10:04]
Sveta Smirnova
Thank you for the report. Please provide output of SHOW VARIABLES LIKE '%char%';
[24 Aug 2007 10:09]
Roland Bouman
mysql> show variables like '%char%'; +--------------------------+-----------------------------------------------------------------------------+ | Variable_name | Value | +--------------------------+-----------------------------------------------------------------------------+ | character_set_client | latin1 | | character_set_connection | latin1 | | character_set_database | latin1 | | character_set_filesystem | binary | | character_set_results | latin1 | | character_set_server | latin1 | | character_set_system | utf8 | | character_sets_dir | /opt/mysql/5.0/45/mysql-5.0.45-linux-i686-icc-glibc23/share/mysql/charsets/ | +--------------------------+-----------------------------------------------------------------------------+ 8 rows in set (0.00 sec)
[24 Aug 2007 10:19]
Sveta Smirnova
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://dev.mysql.com/doc/ and the instructions on how to report a bug at http://bugs.mysql.com/how-to-report.php Provided output shows values of character_set_client, character_set_connection and character_set_results are latin1, but character_set_system is utf8. So truncation of values is expected. You have to use SET NAMES before running such queries.