Edit report at https://bugs.php.net/bug.php?id=46408&edit=1

 ID:                 46408
 Updated by:         [email protected]
 Reported by:        alec at smecher dot bc dot ca
 Summary:            Locale number format settings can cause
                     pg_query_params to break with numerics
 Status:             Open
 Type:               Bug
 Package:            PostgreSQL related
 Operating System:   *
 PHP Version:        5.*, 6
-Assigned To:        
+Assigned To:        yohgaki
 Block user comment: N
 Private report:     N

 New Comment:

I guess setting locale to database locale resolve this issue.


Previous Comments:
------------------------------------------------------------------------
[2010-05-14 12:13:40] lewis at peppermind dot de

This issue also appears with pg_execute(), when passing float values to the 
bind array, with a locale that uses comma as decimal separator (such as de_DE 
and most other european locales).

------------------------------------------------------------------------
[2009-07-26 18:59:12] jerico dot dev at gmail dot com

@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?

------------------------------------------------------------------------
[2008-11-21 13:09:19] [email protected]

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] [email protected]

<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 ..

------------------------------------------------------------------------


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

    https://bugs.php.net/bug.php?id=46408


-- 
Edit this bug report at https://bugs.php.net/bug.php?id=46408&edit=1

Reply via email to