diff options
author | Georgi Kodinov <Georgi.Kodinov@Oracle.com> | 2011-05-11 14:11:57 +0300 |
---|---|---|
committer | Georgi Kodinov <Georgi.Kodinov@Oracle.com> | 2011-05-11 14:11:57 +0300 |
commit | 5a2ccea2e763952eeca3ea3ecb3b652743271f04 (patch) | |
tree | 2856c25fe5117516cd87405eab55ed1e0f32f256 /mysql-test/r/ctype_cp1251.result | |
parent | 5ebd07b0f6e3e6a37b8847a0e05753edc5025f59 (diff) | |
download | mariadb-git-5a2ccea2e763952eeca3ea3ecb3b652743271f04.tar.gz |
Bug #11744875: 4082: integer lengths cause truncation with distinct concat
and innodb
The 5.5 version of the patch.
The server doesn't restrict the data that can be inserted into integer columns
with explicitly specified length that's smaller than what the type can handle,
e.g. 1234 can be inserted into an INT(2) column just fine.
Thus, when calcualting the maximum width of expressions involving such
restricted integer columns we need to use the implicit maximum width of
the field instead of the explicitly speficied one.
Fixed the server to use the implicit maximum in such cases and made sure
the implicit maximum is addjusted the same way as the explicit one wrt
signedness.
Fixed several test case results (ctype_*.result, metadata.result and
type_ranges.result) to reflect the extended column widths.
Added a regression test case in distinct.test.
Note : this is the behavior preserving fix that makes 5.5 behave as 5.1 and
earlier. In the mysql trunk we'll add a insert time check for the explict
maximum size.
Diffstat (limited to 'mysql-test/r/ctype_cp1251.result')
-rw-r--r-- | mysql-test/r/ctype_cp1251.result | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mysql-test/r/ctype_cp1251.result b/mysql-test/r/ctype_cp1251.result index 58f023b2b79..cff4f6b7442 100644 --- a/mysql-test/r/ctype_cp1251.result +++ b/mysql-test/r/ctype_cp1251.result @@ -2438,7 +2438,7 @@ create table t2 as select concat(a) from t1; show create table t2; Table Create Table t2 CREATE TABLE `t2` ( - `concat(a)` varchar(2) CHARACTER SET cp1251 DEFAULT NULL + `concat(a)` varchar(4) CHARACTER SET cp1251 DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1, t2; create table t1 (a year); @@ -2747,7 +2747,7 @@ insert into t1 values (1); create view v1(a) as select concat(a) from t1; show columns from v1; Field Type Null Key Default Extra -a varchar(2) YES NULL +a varchar(4) YES NULL select hex(a) from v1; hex(a) 3031 |