Bug #35793 [Com]: General error: 2050

From: Date: Wed, 29 Apr 2015 01:38:26 +0000
Subject: Bug #35793 [Com]: General error: 2050
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-192389@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=35793&edit=1

 ID:                 35793
 Comment by:         jefrey at jefrey dot ml
 Reported by:        deadman_great at mail dot ru
 Summary:            General error: 2050
 Status:             No Feedback
 Type:               Bug
 Package:            PDO related
 Operating System:   RH Fedora Core 2
 PHP Version:        5CVS-2005-12-25 (snap)
 Assigned To:        Wez
 Block user comment: N
 Private report:     N

 New Comment:

It's 2015 and I'm still facing this bug...


Previous Comments:
------------------------------------------------------------------------
[2011-04-27 18:30:18] danizobin at gmail dot com

On WinXP no problem, on CentOs I see the bug

------------------------------------------------------------------------
[2009-07-04 07:57:31] ben at ecoland dot com dot au

This needs to be fixed - C'mon guys.

I'm using PHP under CentOS 5.0 and shocked it exists

------------------------------------------------------------------------
[2009-04-29 17:15:02] brice dot laurencin at gmail dot com

I ran against the very bug just now. I lost half a day with a bug referenced 3 years and a half ago.
Nice.
And more, just a simple affectation ain't possible? What?!?

I hate PHP more and more every day.

/rant OFF

The bug didn't occurred on Ubuntu Jaunty (PHP 5.2.6), it smashed me on the Red Hat 4.1.1-52
(PHP 5.1.6) production server.

------------------------------------------------------------------------
[2009-03-26 15:00:18] maxlemans at free dot fr

The problem seems to be still unsolved. I reproduced it today when using the statement variable
twice or more for different queries

Code :

// Request writting
$strSQL = " 
SELECT  id
FROM    mybase.mytable
";

// Request running 
$objStatement = $oPDO->query($strSQL);

// Results browsing
while ($arrRow = $objStatement->fetch(PDO::FETCH_NUM))
{
        array_push($arrData, $arrRow[0]);
}

// Cursor closing
$objStatement->closeCursor();


// Request writting
$strSQL = " 
SELECT  id
FROM    mybase.myOTHERtable
";

// Request running 
$objStatement = $oPDO->query($strSQL);

// Results browsing
while ($arrRow = $objStatement->fetch(PDO::FETCH_NUM))
{
        array_push($arrData, $arrRow[0]);
}

// Cursor closing
$objStatement->closeCursor();


To solve this problem I use the following after $objStatement->closeCursor() :

unset($objStatement);

As $objStatement is affected an new PDOStatement instance, I think it would be nice if PHP could
remove the previous PDOStatement instance as it is no longer usable.

------------------------------------------------------------------------
[2008-10-30 05:35:13] post-christian at freenet dot de

I think we need to rethink about how mysql works. If you don't use mysql_stmt_store_result(),
which make sense when loading long data, mysql seems to allow only one active statement per
connection. puhh. hard to believe but could be true. I'm having the same problem with a mysql
driver for perl.

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=35793


--
Edit this bug report at https://bugs.php.net/bug.php?id=35793&edit=1


Thread (43 messages)

« previous php.bugs (#192389) next »