From dd68385435e0e7df27b26a8cc13c21195bedbcd9 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 17 Jan 2005 16:13:56 -0800 Subject: 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 --- sql/field_conv.cc | 1 + 1 file changed, 1 insertion(+) (limited to 'sql') 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) -- cgit v1.2.1