Home > Archive > MySQL ODBC Connector > September 2005 > Re: possible MySQL bug - insert into 'double' column problem with









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: possible MySQL bug - insert into 'double' column problem with
Roger Baklund

2005-09-19, 7:23 am

Andrew Braithwaite wrote:
> Hi All,
>
> I have a strange error when trying to insert into a table with 2
> 'double' fields. It inserts into the 1st field OK but fills the 2nd one
> with nines. See below for a complete recreate.

[...]
> | lon | double(7,6) | YES | MUL | NULL | |
> | lat | double(7,6) | YES | | NULL | |


From the manual:

DOUBLE[(M,D)] [UNSIGNED] [ZEROFILL]

M is the total number of decimal digits and D is the number of digits
following the decimal point.

<URL: http://dev.mysql.com/doc/mysql/en/n...e-overview.html >

> mysql> INSERT INTO table1VALUES
> (8002,'2a',-0.361080,39.468270,'2005-08- 31','ES052',NULL,NUL
L);
> Query OK, 1 row affected, 1 warning (0.01 sec)
>
> mysql> select * from table1 where id=8002\G
> ********************
******* 1. row ********************
*******
> id: 8002
> GeoQuality: 2a
> lon: -0.361080
> lat: 9.999999


You have created your columns with a max width of 7, out of which 6 are
decimals, but you are trying to insert a number with 8 digits.

--
Roger


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql? unsub...sie.nctu.edu.tw

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2009 droptable.com