Bug #27473 | ARCHIVE: silently converts column type in 5.0/5.1 | ||
---|---|---|---|
Submitted: | 27 Mar 2007 14:29 | Modified: | 10 Dec 2007 5:47 |
Reporter: | Paul DuBois | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: Data Types | Severity: | S3 (Non-critical) |
Version: | 5.0, 5.1 | OS: | Any (all) |
Assigned to: | Ramil Kalimullin | CPU Architecture: | Any |
[27 Mar 2007 14:29]
Paul DuBois
[27 Mar 2007 14:45]
MySQL Verification Team
Thank you for the bug report. Verified as described on FC 6.0 32-bit.
[2 Dec 2007 19:45]
Brian Aker
The maximum length of all rows combined can not be larger then 4gigs.
[10 Dec 2007 5:47]
Ramil Kalimullin
Hi, Paul. We have two different length checks in the code (create table phase): 1. all non-blob fields bigger than MAX_FIELD_VARCHARLENGTH (65535) are converted to blobs: mysql> create table t1(a varchar(65536)); Query OK, 0 rows affected, 1 warning (0.00 sec) mysql> show warnings; +-------+------+--------------------------------------------+ | Level | Code | Message | +-------+------+--------------------------------------------+ | Note | 1246 | Converting column 'a' from VARCHAR to TEXT | +-------+------+--------------------------------------------+ We have a note (maybe not enough clear) in the 5.0 documentation at http://dev.mysql.com/doc/refman/5.0/en/silent-column-changes.html But in the 5.1 docs it's missed, I will file a bug. Actually, we have another bug (will file it as well), one cannot create a table with a varchar(65535) field as the real maximum length of varchar fields is 65535 - 2 (2 byte lenght we store in the field): mysql> create table t1(a varchar(65534)); ERROR 1118 (42000): Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535. You have to change some columns to TEXT or BLOBs Moreover, one even cannot create a table t1(a varchar(65533)) as we have to store 1 bit for "row deleted" in the record. 2. if the total record length is bigger than HA_MAX_REC_LENGTH (65535 in most cases), we raise an ER_TOO_BIG_ROWSIZE error: mysql> create table t1(a varchar(40000), b varchar(40000)); ERROR 1118 (42000): Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535. You have to change some columns to TEXT or BLOBs So, it's different cases and expected behaviour, I'm closing this one as not a bug. Please, let me know if you violently disagree and/or have any questions. Thanks.
[10 Dec 2007 5:56]
Ramil Kalimullin
See Bug #33105: "Silent Column Specification Changes" page misses some conversions
[10 Dec 2007 6:13]
Ramil Kalimullin
See Bug #19871(Not a Bug): varchar(65535) column cannot CREATE. Bug #7417(Not a Bug): VARCHAR(65535) doesn't work.
[23 May 2008 14:32]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/47000 ChangeSet@1.2610, 2008-05-23 18:31:53+04:00, kaa@kaamos.(none) +5 -0 Fix for bug #27473: Casting 'scientific notation type' to 'unsigned bigint' fails on windows. Visual Studio does not take into account some x86 hardware limitations which leads to incorrect results when converting some DOUBLE values to BIGINT UNSIGNED. Fixed by adding a workaround for double->ulonglong conversion on Windows.