From: Operating system: * PHP version: 5.3.6 Package: PDO related Bug Type: Bug Bug description:PDO query processing with postgres standard_conforming_strings and escape chars
Description: ------------ The test script below shows the point best. One thing to notice, is that this bug only happens when you have standard_conforming_strings set to "on" in your postgres.conf file. It seems like the fact that PHP uses '\' as escape char might be messing things up, sd $pdo->quote("\\") return '\' when standard_conforming_strings is set to "on" vs, '\\' when it's off. Test script: --------------- $pdo = new PDO($dns, $username, $password); $statement = $pdo->prepare("SELECT table.* FROM table table WHERE (column ILIKE :db_condition_placeholder_0 ESCAPE " . $pdo->quote("\\") . ") AND (column ILIKE :db_condition_placeholder_1 ESCAPE " . $pdo->quote("\\") . ");"); $statement->execute(array(':db_condition_placeholder_0' => 'test', ':db_condition_placeholder_1' => 'test')); Expected result: ---------------- No errors and query executed: Actual result: -------------- Error produced: Warning: PDOStatement::execute(): SQLSTATE[HY093]: Invalid parameter number: :db_condition_placeholder_1 in -- Edit bug report at https://bugs.php.net/bug.php?id=55335&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=55335&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=55335&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=55335&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=55335&r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=55335&r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=55335&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=55335&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=55335&r=needscript Try newer version: https://bugs.php.net/fix.php?id=55335&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=55335&r=support Expected behavior: https://bugs.php.net/fix.php?id=55335&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=55335&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=55335&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=55335&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=55335&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=55335&r=dst IIS Stability: https://bugs.php.net/fix.php?id=55335&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=55335&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=55335&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=55335&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=55335&r=mysqlcfg