#46408 [Com]: Locale number format settings can cause pg_query_params to break with numerics
| From: | jerico dot dev at gmail dot com | Date: | Sun, 26 Jul 2009 18:59:12 +0000 |
| Subject: | #46408 [Com]: Locale number format settings can cause pg_query_params to break with numerics | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-140277@lists.php.net to get a copy of this message | ||
ID: 46408
Comment by: jerico dot dev at gmail dot com
Reported By: alec at smecher dot bc dot ca
Status: Open
Bug Type: PostgreSQL related
Operating System: *
PHP Version: 5CVS, 6CVS
New Comment:
@jani: When I pass in a double, I expect pg_query_params() to prepare
it in a way that can be understood by the database independent of my
locale settings. AFAIK the implementation of pg_query_params() is also
inconsistent with that of the mysql driver which correctly accepts
double typed parameters independent of locale.
I guess you were not entirely serious when you proposed that one should
switch the locale before using pg_query_params(), were you?
Previous Comments:
------------------------------------------------------------------------
[2008-11-21 13:09:19] jani@php.net
I guess it's an issue always if extension does 'convert_to_string()'.
Easily avoided in code: Only do setlocale() prior to outputting stuff.
And then restore the locale right after output. :)
------------------------------------------------------------------------
[2008-11-18 23:16:44] alec at smecher dot bc dot ca
Thanks, lsmith and RhodiumToad. FYI, this bug also exists in PDO (I can
post reproduce code if it's helpful).
------------------------------------------------------------------------
[2008-11-18 22:59:44] lsmith@php.net
<RhodiumToad> lsmith: in a parameterized query it's always wrong to use
locale-specific delimiters
RhodiumToad is also known as Andrew Gierth and is a highly respected
expert on #postgresql on freenode.
As such I will reopen the bug ..
------------------------------------------------------------------------
[2008-10-31 18:28:57] alec at smecher dot bc dot ca
FYI, there's a discussion of the same bug, which also appeared (in a
separate implementation) in the implementation of the Pear::DB package:
<http://pear.php.net/bugs/bug.php?id=3021>
------------------------------------------------------------------------
[2008-10-28 22:54:37] alec at smecher dot bc dot ca
In case it wasn't clear, the bug IMO is that pg_query_params is using a
means to convert doubles to strings that is potentially incompatible
with the database.
------------------------------------------------------------------------
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://bugs.php.net/46408
--
Edit this bug report at http://bugs.php.net/?id=46408&edit=1