Bug #21355 | Changing DEFAULT CHARACTER SET changes CHAR field size | ||
---|---|---|---|
Submitted: | 31 Jul 2006 5:27 | Modified: | 5 Nov 2006 13:21 |
Reporter: | Peter Lieverdink | Email Updates: | |
Status: | No Feedback | Impact on me: | |
Category: | MySQL Server: Charsets | Severity: | S2 (Serious) |
Version: | 4.1.11a-4sarge5 | OS: | Linux (Debian stable ("Sarge")) |
Assigned to: | CPU Architecture: | Any |
[31 Jul 2006 5:27]
Peter Lieverdink
[31 Jul 2006 13:57]
Valeriy Kravchuk
Thank you for a problem report. Sorry, but I was not able to repeat the behavior described with 4.1.22-BK on Linux: openxs@suse:~/dbs/4.1> bin/mysql -uroot test Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 to server version: 4.1.22 Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> create table tc1(c1 char(16)); Query OK, 0 rows affected (0.02 sec) mysql> show create table tc1; +-------+----------------------------------------------------------------------- -------------------+ | Table | Create Table | +-------+----------------------------------------------------------------------- -------------------+ | tc1 | CREATE TABLE `tc1` ( `c1` char(16) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 | +-------+----------------------------------------------------------------------- -------------------+ 1 row in set (0.00 sec) mysql> insert into tc1 values('abc'); Query OK, 1 row affected (0.01 sec) mysql> alter table tc1 default charset utf8 COLLATE utf8_unicode_ci; Query OK, 1 row affected (0.03 sec) Records: 1 Duplicates: 0 Warnings: 0 mysql> show create table tc1; +-------+----------------------------------------------------------------------- --------------------------------------------------------------+ | Table | Create Table | +-------+----------------------------------------------------------------------- --------------------------------------------------------------+ | tc1 | CREATE TABLE `tc1` ( `c1` char(16) character set latin1 default NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci | +-------+----------------------------------------------------------------------- --------------------------------------------------------------+ 1 row in set (0.00 sec) So, please, check with a newer version, 4.1.21, and inform about the results.
[31 Aug 2006 23: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".
[6 Sep 2006 6:34]
Nick Oostveen
I also ran into this issue, though not by altering a table. This happens when changing the default character set in my.cnf from Latin1 to UTF-8. Any tables which were previously using the old default character set have their char and varchar columns shortened to about 1/3 of the original size, for example varchar(32) changing to varchar(10).
[15 Sep 2006 15:00]
Peter Mason
This caused me a problem using Typo3 on Windows 2003 server/Apache 2 as it truncated the md5 hash keys. Once I updated the be_users table to reset the password field length, everything worked OK
[5 Oct 2006 13:21]
Valeriy Kravchuk
Nick, If you just change the default character set from Latin1 to UTF-8, and do not re-create the table created with Latin1, it is the expected result. See http://bugs.mysql.com/bug.php?id=21208 as yet another example of this behaviour. All reporters: I am still waiting for any test case with ALTER TABLE that demonstrates the behaviour described here in 4.1.21.
[6 Nov 2006 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".