From: shellgen at gmail dot com
Operating system: Linux
PHP version: 5.4.4
Package: PDO related
Bug Type: Feature/Change Request
Bug description:Need alternative to Perl DBH::pg_placeholder_dollaronly
Description:
------------
Sometimes statements for pgsql may contain operators that contain symbols
'?' or '::', would be really great to have an option like Perl
`pg_placeholder_dollaronly` and not to treat those symbols as placeholders.
Test script:
---------------
Create some_table in Postgres:
CREATE TYPE some_type AS (
some_column hstore
);
CREATE TABLE some_table OF some_type;
<?php
$dbh = new PDO("pgsql:dbname=some_database;host=some_host", 'some_user',
'some_password' );
$sth = $dbh->prepare('SELECT * FROM some_table WHERE some_column ?
:some_param');
$sth->execute(array(':some_param' => 'some_criteria'));
...
And right here we get of course
Fatal error: Uncaught exception 'PDOException' with message
'SQLSTATE[HY093]: Invalid parameter number: mixed named and positional
parameters'
Expected result:
----------------
For statement like
SELECT * FROM some_table WHERE some_column ? :some_param
would be great to be able to tell PDO not to parse '?' and ':' as
placeholders in some cases
--
Edit bug report at https://bugs.php.net/bug.php?id=62493&edit=1
--
Try a snapshot (PHP 5.4):
https://bugs.php.net/fix.php?id=62493&r=trysnapshot54
Try a snapshot (PHP 5.3):
https://bugs.php.net/fix.php?id=62493&r=trysnapshot53
Try a snapshot (trunk):
https://bugs.php.net/fix.php?id=62493&r=trysnapshottrunk
Fixed in SVN:
https://bugs.php.net/fix.php?id=62493&r=fixed
Fixed in SVN and need be documented:
https://bugs.php.net/fix.php?id=62493&r=needdocs
Fixed in release:
https://bugs.php.net/fix.php?id=62493&r=alreadyfixed
Need backtrace:
https://bugs.php.net/fix.php?id=62493&r=needtrace
Need Reproduce Script:
https://bugs.php.net/fix.php?id=62493&r=needscript
Try newer version:
https://bugs.php.net/fix.php?id=62493&r=oldversion
Not developer issue:
https://bugs.php.net/fix.php?id=62493&r=support
Expected behavior:
https://bugs.php.net/fix.php?id=62493&r=notwrong
Not enough info:
https://bugs.php.net/fix.php?id=62493&r=notenoughinfo
Submitted twice:
https://bugs.php.net/fix.php?id=62493&r=submittedtwice
register_globals:
https://bugs.php.net/fix.php?id=62493&r=globals
PHP 4 support discontinued:
https://bugs.php.net/fix.php?id=62493&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=62493&r=dst
IIS Stability:
https://bugs.php.net/fix.php?id=62493&r=isapi
Install GNU Sed:
https://bugs.php.net/fix.php?id=62493&r=gnused
Floating point limitations:
https://bugs.php.net/fix.php?id=62493&r=float
No Zend Extensions:
https://bugs.php.net/fix.php?id=62493&r=nozend
MySQL Configuration Error:
https://bugs.php.net/fix.php?id=62493&r=mysqlcfg