Below is the list of changes that have just been committed into a local
5.1 repository of hf. When hf does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2007-05-11 13:13:29+05:00, holyfoot@hfmain.(none) +7 -0
Merge mysql.com:/home/hf/work/27957/my50-27957
into mysql.com:/home/hf/work/27957/my51-27957
MERGE: 1.1810.2868.33
include/decimal.h@stripped, 2007-05-11 13:12:16+05:00, holyfoot@hfmain.(none) +0 -1
Auto merged
MERGE: 1.15.1.2
mysql-test/r/cast.result@stripped, 2007-05-11 13:13:03+05:00, holyfoot@hfmain.(none) +0 -3
merging
MERGE: 1.39.1.11
mysql-test/r/type_newdecimal.result@stripped, 2007-05-11 13:12:16+05:00,
holyfoot@hfmain.(none) +0 -0
Auto merged
MERGE: 1.36.1.10
mysql-test/t/type_newdecimal.test@stripped, 2007-05-11 13:12:16+05:00,
holyfoot@hfmain.(none) +0 -0
Auto merged
MERGE: 1.33.1.11
sql/item_func.cc@stripped, 2007-05-11 13:12:17+05:00, holyfoot@hfmain.(none) +0 -23
Auto merged
MERGE: 1.270.1.68
sql/my_decimal.h@stripped, 2007-05-11 13:13:23+05:00, holyfoot@hfmain.(none) +0 -8
merging
MERGE: 1.10.1.4
strings/decimal.c@stripped, 2007-05-11 13:12:17+05:00, holyfoot@hfmain.(none) +0 -8
Auto merged
MERGE: 1.65.1.13
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: holyfoot
# Host: hfmain.(none)
# Root: /home/hf/work/27957/my51-27957/RESYNC
--- 1.54/mysql-test/r/type_newdecimal.result 2007-05-11 13:13:35 +05:00
+++ 1.55/mysql-test/r/type_newdecimal.result 2007-05-11 13:13:35 +05:00
@@ -1440,6 +1440,41 @@ select * from t1;
a
123456789012345678
drop table t1;
+select cast(11.1234 as DECIMAL(3,2));
+cast(11.1234 as DECIMAL(3,2))
+9.99
+Warnings:
+Error 1264 Out of range value adjusted for column 'cast(11.1234 as DECIMAL(3,2))' at row
1
+select * from (select cast(11.1234 as DECIMAL(3,2))) t;
+cast(11.1234 as DECIMAL(3,2))
+9.99
+Warnings:
+Error 1264 Out of range value adjusted for column 'cast(11.1234 as DECIMAL(3,2))' at row
1
+select cast(a as DECIMAL(3,2))
+from (select 11.1233 as a
+UNION select 11.1234
+UNION select 12.1234
+) t;
+cast(a as DECIMAL(3,2))
+9.99
+9.99
+9.99
+Warnings:
+Error 1264 Out of range value adjusted for column 'cast(a as DECIMAL(3,2))' at row 1
+Error 1264 Out of range value adjusted for column 'cast(a as DECIMAL(3,2))' at row 1
+Error 1264 Out of range value adjusted for column 'cast(a as DECIMAL(3,2))' at row 1
+select cast(a as DECIMAL(3,2)), count(*)
+from (select 11.1233 as a
+UNION select 11.1234
+UNION select 12.1234
+) t group by 1;
+cast(a as DECIMAL(3,2)) count(*)
+9.99 3
+Warnings:
+Error 1264 Out of range value adjusted for column 'cast(a as DECIMAL(3,2))' at row 1
+Error 1264 Out of range value adjusted for column 'cast(a as DECIMAL(3,2))' at row 1
+Error 1264 Out of range value adjusted for column 'cast(a as DECIMAL(3,2))' at row 1
+Error 1264 Out of range value adjusted for column 'cast(a as DECIMAL(3,2))' at row 1
End of 5.0 tests
select cast(143.481 as decimal(4,1));
cast(143.481 as decimal(4,1))
--- 1.49/mysql-test/t/type_newdecimal.test 2007-05-11 13:13:35 +05:00
+++ 1.50/mysql-test/t/type_newdecimal.test 2007-05-11 13:13:35 +05:00
@@ -1140,6 +1140,25 @@ alter table t1 modify column a decimal(1
select * from t1;
drop table t1;
+#
+# Bug #27957 cast as decimal does not check overflow, also inconsistent with group,
subselect
+#
+
+select cast(11.1234 as DECIMAL(3,2));
+select * from (select cast(11.1234 as DECIMAL(3,2))) t;
+
+select cast(a as DECIMAL(3,2))
+ from (select 11.1233 as a
+ UNION select 11.1234
+ UNION select 12.1234
+ ) t;
+
+select cast(a as DECIMAL(3,2)), count(*)
+ from (select 11.1233 as a
+ UNION select 11.1234
+ UNION select 12.1234
+ ) t group by 1;
+
--echo End of 5.0 tests
#
| Thread |
|---|
| • bk commit into 5.1 tree (holyfoot:1.2510) | holyfoot | 11 May |