From: sinisa Date: November 18 2003 1:58pm Subject: bk commit into 4.0 tree (Sinisa:1.1621) List-Archive: http://lists.mysql.com/internals/10888 Message-Id: <200311181358.hAIDwapC024264@sinisa.nasamreza.org> Below is the list of changes that have just been committed into a local 4.0 repository of Sinisa. When Sinisa 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://www.mysql.com/doc/I/n/Installing_source_tree.html ChangeSet 1.1621 03/11/18 15:58:27 Sinisa@stripped +3 -0 Fix for bug when zeros are to be prepended to decimal field sql/field.cc 1.78 03/11/18 15:57:47 Sinisa@stripped +2 -2 Fix for bug when zeros are to be prepended to decimal field mysql-test/t/type_decimal.test 1.11 03/11/18 15:57:47 Sinisa@stripped +6 -0 Fix for bug when zeros are to be prepended to decimal field mysql-test/r/type_decimal.result 1.13 03/11/18 15:57:46 Sinisa@stripped +6 -0 Fix for bug when zeros are to be prepended to decimal field # 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: Sinisa # Host: sinisa.nasamreza.org # Root: /mnt/work/mysql-4.0 --- 1.77/sql/field.cc Fri Aug 22 04:07:38 2003 +++ 1.78/sql/field.cc Tue Nov 18 15:57:47 2003 @@ -632,7 +632,7 @@ if (zerofill) { left_wall=to-1; - while (pos != left_wall) // Fill with zeros + while (pos > left_wall) // Fill with zeros *pos--='0'; } else @@ -640,7 +640,7 @@ left_wall=to+(sign_char != 0)-1; if (!expo_sign_char) // If exponent was specified, ignore prezeros { - for (;pos != left_wall && pre_zeros_from !=pre_zeros_end; + for (;pos > left_wall && pre_zeros_from !=pre_zeros_end; pre_zeros_from++) *pos--= '0'; } --- 1.12/mysql-test/r/type_decimal.result Wed May 14 22:12:54 2003 +++ 1.13/mysql-test/r/type_decimal.result Tue Nov 18 15:57:46 2003 @@ -363,3 +363,9 @@ Too big column length for column 'a_dec' (max = 255). Use BLOB instead CREATE TABLE t1 (a_dec DECIMAL(-1,1)); Too big column length for column 'a_dec' (max = 255). Use BLOB instead +create table t1(a decimal(10,4)); +insert into t1 values ("+0000100000000"); +select * from t1; +a +9999999.9999 +drop table t1; --- 1.10/mysql-test/t/type_decimal.test Wed May 14 22:12:54 2003 +++ 1.11/mysql-test/t/type_decimal.test Tue Nov 18 15:57:47 2003 @@ -240,3 +240,9 @@ CREATE TABLE t1 (a_dec DECIMAL(-2,1)); --error 1074 CREATE TABLE t1 (a_dec DECIMAL(-1,1)); + +# Zero prepend overflow bug +create table t1(a decimal(10,4)); +insert into t1 values ("+0000100000000"); +select * from t1; +drop table t1;