Req #3021 [Com]: have quoteSmart() convert floats to strings

From: Date: Wed, 18 Apr 2012 04:10:18 +0000
Subject: Req #3021 [Com]: have quoteSmart() convert floats to strings
References: 1  Groups: php.pear.bugs 
Request: Send a blank email to pear-bugs+get-8557@lists.php.net to get a copy of this message
Edit report at http://pear.php.net/bugs/bug.php?id=3021&edit=1 ID: 3021 Comment by: asmecher Reported By: alec at smecher dot bc dot ca Summary: have quoteSmart() convert floats to strings Status: Closed Type: Feature/Change Request Package: DB PHP Version: 5.0.3 Assigned To: aharvey New Comment: FYI, roughly the same bug cropped up in PHP's PostgreSQL module but this solution was dismissed as incorrect. https://bugs.php.net/bug.php?id=46408 Previous Comments: ------------------------------------------------------------------------ [2007-01-11 02:44:48] aharvey This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better. Assuming I'm right in interpreting this rather long bug as "float values should be quoted with the . character as the decimal point in all cases, regardless of locale", then this should be fixed. ------------------------------------------------------------------------ [2006-11-03 04:16:52] derernst I also had this error and asked about it in the pear-general mailing list. Maybe Mark Wiesemanns comment can be helpful (the entire text is in http://news.php.net/php.pear.general/25698): "It's a bug in DB that a user of DB_Table some weeks ago noted (and he said that he will open a bug report for DB; MDB2 is not affected because of smarter logic for handling of decimals). If you want to open a bug report: The error is in executeEmulateQuery() in DB/common.php. The string concatenation in line 1003 $realquery .= $this->quoteSmart($value); is responsible for the error (quoteSmart() has the right value, but the concatenation breaks the query)." ------------------------------------------------------------------------ [2006-09-06 16:45:36] florian dot grandel at gmx dot net This bug made us upgrade from DB to MDB2 as it is still not fixed in the current PEAR::DB release. :-( Please could the PEAR::DB team comment on the many postings that clearly state that this is a bug? Why do you not patch PEAR::DB as proposed? ------------------------------------------------------------------------ [2006-05-22 11:23:42] lsmith Actually the fix seems to be buggy. I have updated MDB2 sources and tests accordingly: http://cvs.php.net/viewcvs.cgi/pear/MDB2/MDB2/Driver/Datatype/Common.php?r1=1.69&r2=1.70&diff_format=u http://cvs.php.net/viewcvs.cgi/pear/MDB2/tests/MDB2_datatype_testcase.php?r1=1.6&r2=1.7&diff_format=u ------------------------------------------------------------------------ [2006-05-22 11:12:32] spam at lynweb dot net This is silly, please fix this bug. Some people is offenced a little _too_ much and doesn't see their own faults. I feel with you glideraerobatics. I don't know if I had bothered trying to explain the issue so many times. Just stepped into this problem myself, guess I'll have to manually use your patch for the moment... Just to state this explicitly: PEOPLE THAT USES LOCALE SETTINGS WHERE THE DECIMAL SEPERATOR IS COMMA WILL NOT BE ABLE TO USE PEAR::DB'S PREPARED STATEMENTS WITH FLOAT DATATYPES Come'on ppl, this bug is _OLD_, you have received a patch, patch it in! ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://pear.php.net/bugs/bug.php?id=3021 -- Edit this bug report at http://pear.php.net/bugs/bug.php?id=3021&edit=1

« previous php.pear.bugs (#8557) next »