Bug #76012 [NEW]: "Invalid parameter number" error for simple query without placeholder

From: Date: Mon, 26 Feb 2018 16:23:12 +0000
Subject: Bug #76012 [NEW]: "Invalid parameter number" error for simple query without placeholder
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-214114@lists.php.net to get a copy of this message
From: young dot inbox at gmail dot com Operating system: Ubuntu 14 LTS PHP version: 7.2.2 Package: PDO PgSQL Bug Type: Bug Bug description:"Invalid parameter number" error for simple query without placeholder Description: ------------ The simple query like SELECT attribute7 FROM spot2d.client_tt WHERE attribute7 IN (list of values) which doesn't not contain any placeholders give error PDO::query(): SQLSTATE[HY093]: Invalid parameter number: mixed named and positional parameters While PostgreSQL run this query without any errors root@spot2dtest:/home/young# psql -h pgdev.spot2d.com -U dev ddc_scj < 2.sql Password for user dev: attribute7 ------------ (0 rows) If you will remove 10-20 values from any place of the list or some symbols (like ? in the middle of string) - it works all strings quoted with PDO::quote table content doesn't matter and it can even no exist Here is the 2.sql file: https://www.dropbox.com/s/v9lqzk8ht2de5x5/2.sql?dl=0 i wasn't able to reduce size of the file - if you remove 10+ values from beginning or end of list it works Test script: --------------- <?php $dbh = new PDO('pgsql:host=pgdev.spot2d.com;dbname=ddc_scj', 'login_here', 'pass_here'); $sql = file_get_contents("2.sql"); $dbh->query($sql); -- Edit bug report at https://bugs.php.net/bug.php?id=76012&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=76012&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=76012&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=76012&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=76012&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=76012&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=76012&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=76012&r=needscript Try newer version: https://bugs.php.net/fix.php?id=76012&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=76012&r=support Expected behavior: https://bugs.php.net/fix.php?id=76012&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=76012&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=76012&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=76012&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=76012&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=76012&r=dst IIS Stability: https://bugs.php.net/fix.php?id=76012&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=76012&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=76012&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=76012&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=76012&r=mysqlcfg

« previous php.bugs (#214114) next »