Commit 4b4af1c1 authored by unknown's avatar unknown

A fix (Bug #5291: float -> string, truncation, sometimes without warning).

parent c1f29705
......@@ -137,6 +137,8 @@ t1 CREATE TABLE `t1` (
drop table t1;
create table t1 (c20 char);
insert into t1 values (5000.0);
Warnings:
Warning 1265 Data truncated for column 'c20' at row 1
drop table t1;
create table t1 (f float(54));
ERROR 42000: Incorrect column specifier for column 'f'
......
......@@ -4297,7 +4297,7 @@ if (field_length < 32 && fabs(nr) < log_10[field_length]-1)
like inserting 500.0 in char(1)
*/
DBUG_ASSERT(field_length < 5 || length <= field_length+1);
return store((const char *)buff, min(length, field_length), charset());
return store((const char *) buff, length, charset());
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment