summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <bar@mysql.com>2006-03-28 18:32:58 +0500
committerunknown <bar@mysql.com>2006-03-28 18:32:58 +0500
commita8c9bbd4bea5587f930e6029d26e1aac6bbef21c (patch)
tree1802499d74dc3f5c116bc4e3711fda25016c915b /mysql-test
parent7130316d15cc4f745a56aab2e308b6ae6f690749 (diff)
parent4ccd3761004caa83004558c5999052414d4d2df4 (diff)
downloadmariadb-git-a8c9bbd4bea5587f930e6029d26e1aac6bbef21c.tar.gz
Merge abarkov@bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/usr/home/bar/mysql-4.1.b15098 sql/field.cc: Auto merged
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/cast.result8
-rw-r--r--mysql-test/t/cast.test9
2 files changed, 17 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;
diff --git a/mysql-test/t/cast.test b/mysql-test/t/cast.test
index ea0a0e4b352..4d73783dd52 100644
--- a/mysql-test/t/cast.test
+++ b/mysql-test/t/cast.test
@@ -152,4 +152,13 @@ select cast(repeat('1',20) as signed);
#
select cast(1.0e+300 as signed int);
+#
+# Bugs: #15098: CAST(column double TO signed int), wrong result
+#
+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;
+DROP TABLE t1;
+
# End of 4.1 tests