diff options
author | unknown <jimw@mysql.com> | 2005-01-17 16:13:56 -0800 |
---|---|---|
committer | unknown <jimw@mysql.com> | 2005-01-17 16:13:56 -0800 |
commit | dd68385435e0e7df27b26a8cc13c21195bedbcd9 (patch) | |
tree | d4d9c5b300c1006f3cb125675a91727135d84dc0 /sql/field_conv.cc | |
parent | d3ad1a919e8f770852ff661e0401be7fc043efaa (diff) | |
download | mariadb-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.cc | 1 |
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) |