Bug #4254 INSERT truncates scientific notation
Submitted: 22 Jun 2004 23:23 Modified: 23 Jun 2004 17:17
Reporter: Mark Rummell Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server Severity:S1 (Critical)
Version:4.0.1 OS:Windows (WIN NT)
Assigned to: Per-Erik Martin CPU Architecture:Any

[22 Jun 2004 23:23] Mark Rummell
Description:
If a field of type float with value small enough to display in Scientific notation is selected in an INSERT/SELECT statement, the scientific notation is
truncated.  This leaves a value in the resultant table many orders of magnitude incorrect.

How to repeat:

Given a row in table A:
     "hi" | "bye" | 5.0113 E - 19 | 16

The following SQL statement
    INSERT INTO B
    SELECT * FROM TABLE A

Produces the following row in table B
     "hi" | "bye" | 5.0113 | 16

Suggested fix:
When performing an INSERT/SELECT statement and a field is in scientific notation in the original table, have the inserted value in the resultant table not be truncated.
[23 Jun 2004 17:17] Per-Erik Martin
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.mysql.com/how-to-report.php

If you can provide more information, feel free to add it
to this bug and change the status back to 'Open'.

Thank you for your interest in MySQL.

Additional info:

I tried to repeat this as follows with the latest source version on Linux,
and with 4.0.17 on Windows Server 2003, but it seems to work ok:

create table a ( s1 char(10), s2 char(20), f float, i int );
create table b ( s1 char(10), s2 char(20), f float, i int );
insert into a values ( "hi", "bye", 5.0113E-19, 16 );
insert into b select * from a;
select * from b;