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/distinct.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/distinct.result')
-rw-r--r-- | mysql-test/r/distinct.result | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/mysql-test/r/distinct.result b/mysql-test/r/distinct.result index b1cb70fa43c..74f2c19c8fe 100644 --- a/mysql-test/r/distinct.result +++ b/mysql-test/r/distinct.result @@ -794,3 +794,14 @@ DROP TABLE t1; SET @@sort_buffer_size = @old_sort_buffer_size; SET @@max_heap_table_size = @old_max_heap_table_size; End of 5.1 tests +# +# Bug #11744875: 4082: integer lengths cause truncation with distinct concat and innodb +# +CREATE TABLE t1 (a INT(1), b INT(1)); +INSERT INTO t1 VALUES (1111, 2222), (3333, 4444); +SELECT DISTINCT CONCAT(a,b) AS c FROM t1 ORDER BY 1; +c +11112222 +33334444 +DROP TABLE t1; +End of 5.5 tests |