diff options
author | Alexey Kopytov <Alexey.Kopytov@Sun.com> | 2010-03-18 13:38:29 +0300 |
---|---|---|
committer | Alexey Kopytov <Alexey.Kopytov@Sun.com> | 2010-03-18 13:38:29 +0300 |
commit | aef97cadfaf1ea9947fd9f5dbedae6842412ddef (patch) | |
tree | b9789210c6251e842ccc7cee877d0f3ffa2b0887 /mysql-test/r/sp.result | |
parent | 7c10a8981ce3f5eff59e0f3a73e4f0ad176f8c90 (diff) | |
download | mariadb-git-aef97cadfaf1ea9947fd9f5dbedae6842412ddef.tar.gz |
Bug #8433: Overflow must be an error
All numeric operators and functions on integer, floating point
and DECIMAL values now throw an 'out of range' error rather
than returning an incorrect value or NULL, when the result is
out of supported range for the corresponding data type.
Some test cases in the test suite had to be updated
accordingly either because the test case itself relied on a
value returned in case of a numeric overflow, or because a
numeric overflow was the root cause of the corresponding bugs.
The latter tests are no longer relevant, since the expressions
used to trigger the corresponding bugs are not valid anymore.
However, such test cases have been adjusted and kept "for the
record".
Diffstat (limited to 'mysql-test/r/sp.result')
-rw-r--r-- | mysql-test/r/sp.result | 32 |
1 files changed, 9 insertions, 23 deletions
diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index b656680326b..62981a2a8d5 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -6022,16 +6022,12 @@ select bug20777(9223372036854775810) as '9223372036854775810 2**63+2'; 9223372036854775810 2**63+2 9223372036854775810 select bug20777(-9223372036854775808) as 'lower bounds signed bigint'; -lower bounds signed bigint -0 -Warnings: -Warning 1264 Out of range value for column 'f1' at row 1 +ERROR 22003: BIGINT UNSIGNED value is out of range in '(f1@0 - 10)' select bug20777(9223372036854775807) as 'upper bounds signed bigint'; upper bounds signed bigint 9223372036854775807 select bug20777(0) as 'lower bounds unsigned bigint'; -lower bounds unsigned bigint -0 +ERROR 22003: BIGINT UNSIGNED value is out of range in '(f1@0 - 10)' select bug20777(18446744073709551615) as 'upper bounds unsigned bigint'; upper bounds unsigned bigint 18446744073709551615 @@ -6041,10 +6037,7 @@ upper bounds unsigned bigint + 1 Warnings: Warning 1264 Out of range value for column 'f1' at row 1 select bug20777(-1) as 'lower bounds unsigned bigint - 1'; -lower bounds unsigned bigint - 1 -0 -Warnings: -Warning 1264 Out of range value for column 'f1' at row 1 +ERROR 22003: BIGINT UNSIGNED value is out of range in '(f1@0 - 10)' create table examplebug20777 as select 0 as 'i', bug20777(9223372036854775806) as '2**63-2', @@ -6053,15 +6046,10 @@ bug20777(9223372036854775808) as '2**63', bug20777(9223372036854775809) as '2**63+1', bug20777(18446744073709551614) as '2**64-2', bug20777(18446744073709551615) as '2**64-1', -bug20777(18446744073709551616) as '2**64', -bug20777(0) as '0', -bug20777(-1) as '-1'; +bug20777(18446744073709551616) as '2**64'; Warnings: Warning 1264 Out of range value for column 'f1' at row 1 -Warning 1264 Out of range value for column 'f1' at row 1 -insert into examplebug20777 values (1, 9223372036854775806, 9223372036854775807, 223372036854775808, 9223372036854775809, 18446744073709551614, 18446744073709551615, 8446744073709551616, 0, -1); -Warnings: -Warning 1264 Out of range value for column '-1' at row 1 +insert into examplebug20777 values (1, 9223372036854775806, 9223372036854775807, 223372036854775808, 9223372036854775809, 18446744073709551614, 18446744073709551615, 8446744073709551616); show create table examplebug20777; Table Create Table examplebug20777 CREATE TABLE `examplebug20777` ( @@ -6072,14 +6060,12 @@ examplebug20777 CREATE TABLE `examplebug20777` ( `2**63+1` bigint(20) unsigned DEFAULT NULL, `2**64-2` bigint(20) unsigned DEFAULT NULL, `2**64-1` bigint(20) unsigned DEFAULT NULL, - `2**64` bigint(20) unsigned DEFAULT NULL, - `0` bigint(20) unsigned DEFAULT NULL, - `-1` bigint(20) unsigned DEFAULT NULL + `2**64` bigint(20) unsigned DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 select * from examplebug20777 order by i; -i 2**63-2 2**63-1 2**63 2**63+1 2**64-2 2**64-1 2**64 0 -1 -0 9223372036854775806 9223372036854775807 9223372036854775808 9223372036854775809 18446744073709551614 18446744073709551615 18446744073709551615 0 0 -1 9223372036854775806 9223372036854775807 223372036854775808 9223372036854775809 18446744073709551614 18446744073709551615 8446744073709551616 0 0 +i 2**63-2 2**63-1 2**63 2**63+1 2**64-2 2**64-1 2**64 +0 9223372036854775806 9223372036854775807 9223372036854775808 9223372036854775809 18446744073709551614 18446744073709551615 18446744073709551615 +1 9223372036854775806 9223372036854775807 223372036854775808 9223372036854775809 18446744073709551614 18446744073709551615 8446744073709551616 drop table examplebug20777; select bug20777(18446744073709551613)+1; bug20777(18446744073709551613)+1 |