|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #53184 PDO_MySQL does not respect type of binded params used more than once in query
Submitted: 2010-10-27 17:02 UTC Modified: 2021-04-18 04:22 UTC
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: an0nym at narod dot ru Assigned:
Status: No Feedback Package: PDO MySQL
PHP Version: 5.3.3 OS: Windows Server 2008 R2 x64
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: an0nym at narod dot ru
New email:
PHP Version: OS:


 [2010-10-27 17:02 UTC] an0nym at narod dot ru
PDO_MySQL does not respect type of binded params that are used more than once in query. 

Test script:
$DB = new PDO("mysql:host=localhost", "root", "");
$statement = $DB->prepare("SELECT SLEEP(50), :bind, :bind");
$bind = 1;
$statement->bindParam(":bind", $bind, PDO::PARAM_INT);

Expected result:
SELECT SLEEP(50), 1, 1

Actual result:
If you review SHOW PROCESSLIST while test script is waiting for response, you'll see SELECT SLEEP(50), 1, '1' instead of expected result. 


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-11-26 13:22 UTC]
This either needs an API change with myslqnd or changes to PDO to use the "new" error mode settings.
 [2011-09-23 18:18 UTC] morrison dot levi at gmail dot com
See bug .  You shouldn't* be using a 
parameter more than once.
 [2011-09-23 18:24 UTC] morrison dot levi at gmail dot com
I meant bug  My apologies.
 [2014-01-01 12:47 UTC]
-Package: PDO related +Package: PDO MySQL
 [2021-04-08 21:04 UTC]
-Status: Open +Status: Feedback
 [2021-04-08 21:04 UTC]
Unfortunately, I can't reproduce it with any of the currently available PHP versions. If you are still encountering this issue with PHP 8 or even PHP 7.4 could you provide more details, please?
 [2021-04-18 04:22 UTC] php-bugs at lists dot php dot net
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.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Wed Aug 04 18:03:39 2021 UTC