Bug #76012 [Fbk->NoF]: "Invalid parameter number" error for simple query without placeholder

From: Date: Sun, 10 Oct 2021 04:22:13 +0000
Subject: Bug #76012 [Fbk->NoF]: "Invalid parameter number" error for simple query without placeholder
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-237121@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=76012&edit=1 ID: 76012 Updated by: php-bugs@lists.php.net Reported by: young dot inbox at gmail dot com Summary: "Invalid parameter number" error for simple query without placeholder -Status: Feedback +Status: No Feedback Type: Bug Package: PDO PgSQL Operating System: Ubuntu 14 LTS PHP Version: 7.2.2 Assigned To: cmb Private report: N New Comment: No feedback was provided. The bug is being suspended because we assume that you are no longer experiencing the problem. If this is not the case and you are able to provide the information that was requested earlier, please do so and change the status of the bug back to "Re-Opened". Thank you. Previous Comments: ------------------------------------------------------------------------ [2021-09-28 10:49:07] cmb@php.net If this is still an issue with any of the actively supported PHP versions[1], could you please make 2.sql available for download again? [1] <https://www.php.net/supported-versions.php> ------------------------------------------------------------------------ [2018-02-26 16:23:10] young dot inbox at gmail dot com 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 this bug report at https://bugs.php.net/bug.php?id=76012&edit=1

« previous php.bugs (#237121) next »