php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57489 SQLSTATE[HY000]: General error: 2053 Source File
Submitted: 2007-01-22 17:04 UTC Modified: 2013-02-18 00:35 UTC
Votes:2
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: jrags at jasrags dot net Assigned:
Status: No Feedback Package: PDO (PECL)
PHP Version: 5.2.1 OS: OS X
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2007-01-22 17:04 UTC] jrags at jasrags dot net
Description:
------------
getting a sql hydrate issue when attempting to retireive a result set from MySQL 5.0.26 on PHP 5.2.0. Specificly when using PARAM_BOOL. When i search for a specific 1 or 0 i can retrieve data. 

Reproduce code:
---------------
$dbh = new PDO('mysql:host=localhost;dbname=test', $user, $pass);

$sql = 
'SELECT 
     * 
FROM 
     tbl_address 
WHERE 
     tbl_address.is_active = ?';

$sth = $dbh->prepare($sql);
$sth->bindValue(1, true, PDO::PARAM_BOOL);
$sth->execute();
while($row = $sth->fetch(PDO::FETCH_NUM)) {
   print_r($row);
}

Expected result:
----------------
I would expect data to be returned.

Actual result:
--------------
PDOException Description

SQLSTATE[HY000]: General error: 2053 Source File


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-01-24 09:25 UTC] mailing_lists at andersground dot net
The same is true for insert and update statements as well - even worse is that in this case no error is produced, the statement just silently fails. The same behaviour occurs when I bind a boolean variable explicitly with PDO::PARAM_INT - I'd expect that at least in this case typecasting happens:

$sth->bindValue(1, true, PDO::PARAM_INT);

fails in the same way.
 [2007-05-11 10:36 UTC] jrags at jasrags dot net
Just wondering if someone with PDO can at least validate that this is an issue or will be worked on? I has been sitting for 5 months in a Open status. Just curious for what really could be a problem for alot of people.
 [2008-05-15 07:12 UTC] rune at prescriba dot com
workaround that works for php/5.1.6 mysql/5.0.27
------------------------------------------------
$dbh = new PDO('mysql:host=localhost;dbname=test', $user, $pass);
$dbh->setAttribute( PDO::ATTR_EMULATE_PREPARES, true );
 [2008-09-12 10:48 UTC] johannes at schlueters dot de
Please use a current (5.3) snapshot from snaps.php.net, should work now
 [2013-02-18 00:35 UTC] pecl-dev 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 "Open". Thank you.
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Thu Jun 20 21:01:26 2019 UTC