summaryrefslogtreecommitdiff
path: root/sql/field_conv.cc
diff options
context:
space:
mode:
authorunknown <jimw@mysql.com>2005-01-17 16:13:56 -0800
committerunknown <jimw@mysql.com>2005-01-17 16:13:56 -0800
commitdd68385435e0e7df27b26a8cc13c21195bedbcd9 (patch)
treed4d9c5b300c1006f3cb125675a91727135d84dc0 /sql/field_conv.cc
parentd3ad1a919e8f770852ff661e0401be7fc043efaa (diff)
downloadmariadb-git-dd68385435e0e7df27b26a8cc13c21195bedbcd9.tar.gz
Fix over-optimization that could result in an unsigned double field being
set to a negative value. (Bug #7700) sql/field_conv.cc: Don't treat real fields as identical when destination is unsigned and the source is not. mysql-test/t/type_float.test: Add test for setting double unsigned to a negative value from a signed double mysql-test/r/type_float.result: Add test results
Diffstat (limited to 'sql/field_conv.cc')
-rw-r--r--sql/field_conv.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/sql/field_conv.cc b/sql/field_conv.cc
index db0cc71c6bf..7aaabde4f55 100644
--- a/sql/field_conv.cc
+++ b/sql/field_conv.cc
@@ -537,6 +537,7 @@ void field_conv(Field *to,Field *from)
if (to->real_type() == from->real_type())
{
if (to->pack_length() == from->pack_length() &&
+ !(to->flags & UNSIGNED_FLAG && !(from->flags & UNSIGNED_FLAG)) &&
to->real_type() != FIELD_TYPE_ENUM &&
to->real_type() != FIELD_TYPE_SET &&
to->table->db_low_byte_first == from->table->db_low_byte_first)