summaryrefslogtreecommitdiff
path: root/sql/field_conv.cc
diff options
context:
space:
mode:
authorunknown <hf@deer.(none)>2005-02-09 02:50:45 +0400
committerunknown <hf@deer.(none)>2005-02-09 02:50:45 +0400
commit91db48e35a57421c00f65d5ce82e84b843ceec22 (patch)
tree9631c72d46b0fd08479ad02de00e5846cd339cda /sql/field_conv.cc
parent63bcbfc4339ae843dc367d08fff0760da4d484c3 (diff)
downloadmariadb-git-91db48e35a57421c00f65d5ce82e84b843ceec22.tar.gz
Precision Math implementation
BitKeeper/etc/ignore: Added client/decimal.c client/my_decimal.cc client/my_decimal.h to the ignore list
Diffstat (limited to 'sql/field_conv.cc')
-rw-r--r--sql/field_conv.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/sql/field_conv.cc b/sql/field_conv.cc
index 002f059f70b..57161a7063e 100644
--- a/sql/field_conv.cc
+++ b/sql/field_conv.cc
@@ -586,6 +586,9 @@ void field_conv(Field *to,Field *from)
!(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_NEWDECIMAL ||
+ (to->field_length == from->field_length &&
+ (((Field_num*)to)->dec == ((Field_num*)from)->dec))) &&
from->charset() == to->charset() &&
to->table->s->db_low_byte_first == from->table->s->db_low_byte_first)
{ // Identical fields
@@ -623,6 +626,11 @@ void field_conv(Field *to,Field *from)
}
else if (from->result_type() == REAL_RESULT)
to->store(from->val_real());
+ else if (from->result_type() == DECIMAL_RESULT)
+ {
+ my_decimal buff;
+ to->store_decimal(from->val_decimal(&buff));
+ }
else
to->store(from->val_int());
}