summaryrefslogtreecommitdiff
path: root/mysql-test/r
diff options
context:
space:
mode:
authorunknown <bar@mysql.com>2005-12-06 16:54:13 +0400
committerunknown <bar@mysql.com>2005-12-06 16:54:13 +0400
commit4ccd3761004caa83004558c5999052414d4d2df4 (patch)
tree9276c1e68940cdd05cea49e7896b452006f3f65b /mysql-test/r
parent966ab524a336bb22088d4adbb7db7a090762551e (diff)
downloadmariadb-git-4ccd3761004caa83004558c5999052414d4d2df4.tar.gz
Bug#15098 CAST(column double TO signed int), wrong result
field.cc: Adding longlong range checking to return LONGLONG_MIN or LONGLONG_MAX when out of range. Using (longlong) cast only when range is ok. cast.test: Adding test case. cast.result: Fixing results accordingly. sql/field.cc: Bug#15098 CAST(column double TO signed int), wrong result Adding longlong range checking. mysql-test/t/cast.test: Bug#15098 CAST(column double TO signed int), wrong result Adding longlong range checking. mysql-test/r/cast.result: Fixing results accordingly.
Diffstat (limited to 'mysql-test/r')
-rw-r--r--mysql-test/r/cast.result8
1 files changed, 8 insertions, 0 deletions
diff --git a/mysql-test/r/cast.result b/mysql-test/r/cast.result
index 69a4cb24276..68687670e17 100644
--- a/mysql-test/r/cast.result
+++ b/mysql-test/r/cast.result
@@ -267,3 +267,11 @@ Warning 1105 Cast to signed converted positive out-of-range integer to it's nega
select cast(1.0e+300 as signed int);
cast(1.0e+300 as signed int)
9223372036854775807
+CREATE TABLE t1 (f1 double);
+INSERT INTO t1 SET f1 = -1.0e+30 ;
+INSERT INTO t1 SET f1 = +1.0e+30 ;
+SELECT f1 AS double_val, CAST(f1 AS SIGNED INT) AS cast_val FROM t1;
+double_val cast_val
+-1e+30 -9223372036854775808
+1e+30 9223372036854775807
+DROP TABLE t1;