Below is the list of changes that have just been committed into a local
4.1 repository of ram. When ram 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.2143 05/03/25 12:11:42 ramil@stripped +3 -0
A fix (#7589: Decimal types are ignored when updating data from another column)
sql/field_conv.cc
1.35 05/03/25 12:11:36 ramil@stripped +3 -0
A fix (#7589: Decimal types are ignored when updating data from another column)
We should use memcpy() only for identical decimals.
mysql-test/t/type_decimal.test
1.19 05/03/25 12:11:36 ramil@stripped +10 -0
A fix (#7589: Decimal types are ignored when updating data from another column)
mysql-test/r/type_decimal.result
1.25 05/03/25 12:11:36 ramil@stripped +9 -0
A fix (#7589: Decimal types are ignored when updating data from another column)
# 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: ramil
# Host: gw.mysql.r18.ru
# Root: /usr/home/ram/work/4.1
--- 1.34/sql/field_conv.cc 2005-01-19 00:22:08 +04:00
+++ 1.35/sql/field_conv.cc 2005-03-25 12:11:36 +04:00
@@ -562,6 +562,9 @@
!(to->flags & UNSIGNED_FLAG && !(from->flags & UNSIGNED_FLAG)) &&
to->real_type() != FIELD_TYPE_ENUM &&
to->real_type() != FIELD_TYPE_SET &&
+ (to->real_type() != FIELD_TYPE_DECIMAL ||
+ (to->field_length == from->field_length &&
+ (((Field_num*) to)->dec == ((Field_num*) from)->dec))) &&
from->charset() == to->charset() &&
to->table->db_low_byte_first == from->table->db_low_byte_first)
{ // Identical fields
--- 1.24/mysql-test/r/type_decimal.result 2004-06-21 12:24:38 +05:00
+++ 1.25/mysql-test/r/type_decimal.result 2005-03-25 12:11:36 +04:00
@@ -646,3 +646,12 @@
9999.999
0000.000
drop table t1;
+create table t1(a decimal(10,5), b decimal(10,1));
+insert into t1 values(123.12345, 123.12345);
+update t1 set b=a;
+Warnings:
+Warning 1265 Data truncated for column 'b' at row 1
+select * from t1;
+a b
+123.12345 123.1
+drop table t1;
--- 1.18/mysql-test/t/type_decimal.test 2004-06-18 06:23:15 +05:00
+++ 1.19/mysql-test/t/type_decimal.test 2005-03-25 12:11:36 +04:00
@@ -265,3 +265,13 @@
--enable_warnings
select * from t1;
drop table t1;
+
+#
+# Bug #7589: a problem with update from column
+#
+
+create table t1(a decimal(10,5), b decimal(10,1));
+insert into t1 values(123.12345, 123.12345);
+update t1 set b=a;
+select * from t1;
+drop table t1;
| Thread |
|---|
| • bk commit into 4.1 tree (ramil:1.2143) | ramil | 25 Mar |