List:MySQL and Perl« Previous MessageNext Message »
From:Gisbert W. Selke Date:December 2 2005 4:37pm
Subject:Re: DECIMAL col type bug in DBD::mysql w/mysql 5
View as plain text  
> -----Ursprüngliche Nachricht-----
> Von: Ray Zimmerman [mailto:rz10@stripped]
> Gesendet: Donnerstag, 1. Dezember 2005 20:22
> I believe I have discovered a bug (I'm guessing it's in DBD::mysql).  
> When connecting to mysql 5, it returns the type of a decimal column  
> as SQL_VARCHAR, as opposed to SQL_DECIMAL returned when the mysql  
> server is version 4.1.
I don't think it's DBD::mysql. http://bugs.mysql.com/bug.php?id=14923 has an
entry from the MySQL people that may be an explanation. Base line: "There is
no standard C type for fixed point numeric type, so MySQL server
returns decimal as a string." This comes also up in MySQL QueryBrowser, so
it's not just DBD::mysql.

As a workaround, the entry suggests to cast the decimal to some other type
(like double). Which may, of course, lead to loss of accuracy.

\Gisbert
Thread
DECIMAL col type bug in DBD::mysql w/mysql 5Ray Zimmerman1 Dec
Re: DECIMAL col type bug in DBD::mysql w/mysql 5Gisbert W. Selke2 Dec
  • Re: DECIMAL col type bug in DBD::mysql w/mysql 5Ray Zimmerman2 Dec
    • Re: DECIMAL col type bug in DBD::mysql w/mysql 5Patrick Galbraith13 Dec
      • Re: DECIMAL col type bug in DBD::mysql w/mysql 5Ray Zimmerman13 Dec