Loading mysql-test/r/type_float.result +9 −0 Original line number Diff line number Diff line Loading @@ -146,6 +146,15 @@ drop table t1; create table t1 (f float(54)); ERROR 42000: Incorrect column specifier for column 'f' drop table if exists t1; create table t1 (d1 double, d2 double unsigned); insert into t1 set d1 = -1.0; update t1 set d2 = d1; Warnings: Warning 1264 Data truncated; out of range for column 'd2' at row 1 select * from t1; d1 d2 -1 0 drop table t1; create table t1 (f float(4,3)); insert into t1 values (-11.0),(-11),("-11"),(11.0),(11),("11"); Warnings: Loading mysql-test/t/type_float.test +7 −0 Original line number Diff line number Diff line Loading @@ -94,6 +94,13 @@ create table t1 (f float(54)); # Should give an error drop table if exists t1; --enable_warnings # Don't allow 'double unsigned' to be set to a negative value (Bug #7700) create table t1 (d1 double, d2 double unsigned); insert into t1 set d1 = -1.0; update t1 set d2 = d1; select * from t1; drop table t1; # Ensure that maximum values as the result of number of decimals # being specified in table schema are enforced (Bug #7361) create table t1 (f float(4,3)); Loading sql/field_conv.cc +1 −0 Original line number Diff line number Diff line Loading @@ -584,6 +584,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 && from->charset() == to->charset() && Loading sql/table.cc +8 −0 Original line number Diff line number Diff line Loading @@ -166,6 +166,14 @@ int openfrm(THD *thd, const char *name, const char *alias, uint db_stat, if (!share->table_charset) { /* unknown charset in head[38] or pre-3.23 frm */ if (use_mb(default_charset_info)) { /* Warn that we may be changing the size of character columns */ sql_print_warning("'%s' had no or invalid character set, " "and default character set is multi-byte, " "so character column sizes may have changed", name); } share->table_charset= default_charset_info; } share->db_record_offset= 1; Loading Loading
mysql-test/r/type_float.result +9 −0 Original line number Diff line number Diff line Loading @@ -146,6 +146,15 @@ drop table t1; create table t1 (f float(54)); ERROR 42000: Incorrect column specifier for column 'f' drop table if exists t1; create table t1 (d1 double, d2 double unsigned); insert into t1 set d1 = -1.0; update t1 set d2 = d1; Warnings: Warning 1264 Data truncated; out of range for column 'd2' at row 1 select * from t1; d1 d2 -1 0 drop table t1; create table t1 (f float(4,3)); insert into t1 values (-11.0),(-11),("-11"),(11.0),(11),("11"); Warnings: Loading
mysql-test/t/type_float.test +7 −0 Original line number Diff line number Diff line Loading @@ -94,6 +94,13 @@ create table t1 (f float(54)); # Should give an error drop table if exists t1; --enable_warnings # Don't allow 'double unsigned' to be set to a negative value (Bug #7700) create table t1 (d1 double, d2 double unsigned); insert into t1 set d1 = -1.0; update t1 set d2 = d1; select * from t1; drop table t1; # Ensure that maximum values as the result of number of decimals # being specified in table schema are enforced (Bug #7361) create table t1 (f float(4,3)); Loading
sql/field_conv.cc +1 −0 Original line number Diff line number Diff line Loading @@ -584,6 +584,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 && from->charset() == to->charset() && Loading
sql/table.cc +8 −0 Original line number Diff line number Diff line Loading @@ -166,6 +166,14 @@ int openfrm(THD *thd, const char *name, const char *alias, uint db_stat, if (!share->table_charset) { /* unknown charset in head[38] or pre-3.23 frm */ if (use_mb(default_charset_info)) { /* Warn that we may be changing the size of character columns */ sql_print_warning("'%s' had no or invalid character set, " "and default character set is multi-byte, " "so character column sizes may have changed", name); } share->table_charset= default_charset_info; } share->db_record_offset= 1; Loading