Below is the list of changes that have just been committed into a local
5.0 repository of jimw. When jimw 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
1.2132 06/05/18 10:34:01 jimw@stripped +3 -0
Bug #13975: "same string" + 0 has 2 different results
The 'decimals' member of Item_func was being improperly initialized,
which resulted in improper results when handling large numeric values.
sql/item_strfunc.h
1.106 06/05/18 10:33:57 jimw@stripped +1 -1
Remove unnecessary reset of decimals in Item_func_conv::fix_length_and_dec().
mysql-test/t/func_str.test
1.87 06/05/18 10:33:57 jimw@stripped +6 -0
Add new regression test
mysql-test/r/func_str.result
1.113 06/05/18 10:33:57 jimw@stripped +6 -0
Add test results
# 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: jimw
# Host: rama.(none)
# Root: /home/jimw/my/mysql-5.0-13975
--- 1.105/sql/item_strfunc.h 2006-03-14 02:03:38 -08:00
+++ 1.106/sql/item_strfunc.h 2006-05-18 10:33:57 -07:00
@@ -542,7 +542,7 @@
void fix_length_and_dec()
{
collation.set(default_charset());
- decimals=0; max_length=64;
+ max_length= 64;
}
};
--- 1.112/mysql-test/r/func_str.result 2006-05-12 01:27:14 -07:00
+++ 1.113/mysql-test/r/func_str.result 2006-05-18 10:33:57 -07:00
@@ -1046,4 +1046,10 @@
select cast(rtrim(ltrim(' 20.06 ')) as decimal(19,2));
cast(rtrim(ltrim(' 20.06 ')) as decimal(19,2))
20.06
+select conv("18383815659218730760",10,10) + 0;
+conv("18383815659218730760",10,10) + 0
+1.8383815659219e+19
+select "18383815659218730760" + 0;
+"18383815659218730760" + 0
+1.8383815659219e+19
End of 5.0 tests
--- 1.86/mysql-test/t/func_str.test 2006-05-12 01:27:14 -07:00
+++ 1.87/mysql-test/t/func_str.test 2006-05-18 10:33:57 -07:00
@@ -698,4 +698,10 @@
select cast(ltrim(' 20.06 ') as decimal(19,2));
select cast(rtrim(ltrim(' 20.06 ')) as decimal(19,2));
+#
+# Bug #13975: "same string" + 0 has 2 different results
+#
+select conv("18383815659218730760",10,10) + 0;
+select "18383815659218730760" + 0;
+
--echo End of 5.0 tests
| Thread |
|---|
| • bk commit into 5.0 tree (jimw:1.2132) BUG#13975 | Jim Winstead | 18 May |