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-20 21:56:56+05:00, holyfoot@hfmain.(none) +3 -0
Merge mysql.com:/home/hf/work/28361/my50-28361
into mysql.com:/home/hf/work/28361/my51-28361
MERGE: 1.1810.2870.50
mysql-test/r/type_newdecimal.result@stripped, 2007-05-20 21:56:49+05:00, holyfoot@hfmain.(none) +3 -3
merging
MERGE: 1.36.1.11
mysql-test/t/type_newdecimal.test@stripped, 2007-05-20 21:55:53+05:00, holyfoot@hfmain.(none) +0 -0
Auto merged
MERGE: 1.33.1.12
sql/my_decimal.h@stripped, 2007-05-20 21:55:53+05:00, holyfoot@hfmain.(none) +0 -0
Auto merged
MERGE: 1.10.1.7
# 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/28361/my51-28361/RESYNC
--- 1.56/mysql-test/r/type_newdecimal.result 2007-05-20 21:57:01 +05:00
+++ 1.57/mysql-test/r/type_newdecimal.result 2007-05-20 21:57:01 +05:00
@@ -1475,6 +1475,9 @@ Error 1264 Out of range value for column
Error 1264 Out of range value for column 'cast(a as DECIMAL(3,2))' at row 1
Error 1264 Out of range value for column 'cast(a as DECIMAL(3,2))' at row 1
Error 1264 Out of range value for column 'cast(a as DECIMAL(3,2))' at row 1
+create table t1 (s varchar(100));
+insert into t1 values (0.00000000010000000000000000364321973154977415791655470655996396089904010295867919921875);
+drop table t1;
End of 5.0 tests
select cast(143.481 as decimal(4,1));
cast(143.481 as decimal(4,1))
--- 1.50/mysql-test/t/type_newdecimal.test 2007-05-20 21:57:01 +05:00
+++ 1.51/mysql-test/t/type_newdecimal.test 2007-05-20 21:57:01 +05:00
@@ -1159,6 +1159,14 @@ select cast(a as DECIMAL(3,2)), count(*)
UNION select 12.1234
) t group by 1;
+#
+# Bug #28361 Buffer overflow in DECIMAL code on Windows
+#
+
+create table t1 (s varchar(100));
+insert into t1 values (0.00000000010000000000000000364321973154977415791655470655996396089904010295867919921875);
+drop table t1;
+
--echo End of 5.0 tests
#
--- 1.20/sql/my_decimal.h 2007-05-20 21:57:01 +05:00
+++ 1.21/sql/my_decimal.h 2007-05-20 21:57:01 +05:00
@@ -36,13 +36,17 @@ C_MODE_END
/* maximum length of buffer in our big digits (uint32) */
#define DECIMAL_BUFF_LENGTH 9
+
+/* the number of digits that my_decimal can possibly contain */
+#define DECIMAL_MAX_POSSIBLE_PRECISION (DECIMAL_BUFF_LENGTH * 9)
+
/*
maximum guaranteed precision of number in decimal digits (number of our
digits * number of decimal digits in one our big digit - number of decimal
- digits in one our big digit decreased on 1 (because we always put decimal
+ digits in one our big digit decreased by 1 (because we always put decimal
point on the border of our big digits))
*/
-#define DECIMAL_MAX_PRECISION ((DECIMAL_BUFF_LENGTH * 9) - 8*2)
+#define DECIMAL_MAX_PRECISION (DECIMAL_MAX_POSSIBLE_PRECISION - 8*2)
#define DECIMAL_MAX_SCALE 30
#define DECIMAL_NOT_SPECIFIED 31
@@ -50,7 +54,7 @@ C_MODE_END
maximum length of string representation (number of maximum decimal
digits + 1 position for sign + 1 position for decimal point)
*/
-#define DECIMAL_MAX_STR_LENGTH (DECIMAL_MAX_PRECISION + 2)
+#define DECIMAL_MAX_STR_LENGTH (DECIMAL_MAX_POSSIBLE_PRECISION + 2)
/*
maximum size of packet length
*/
| Thread |
|---|
| • bk commit into 5.1 tree (holyfoot:1.2526) | holyfoot | 20 May |