Bug #62847 [Ver->Csd]: PDO not released (or disconnect) if last query was error.

From: Date: Fri, 11 Dec 2020 15:40:39 +0000
Subject: Bug #62847 [Ver->Csd]: PDO not released (or disconnect) if last query was error.
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-231026@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=62847&edit=1 ID: 62847 Updated by: nikic@php.net Reported by: softwareelves at gmail dot com Summary: PDO not released (or disconnect) if last query was error. -Status: Verified +Status: Closed Type: Bug Package: PDO related Operating System: OSX 10.8 PHP Version: 5.3.16 -Assigned To: +Assigned To: nikic Block user comment: N Private report: N New Comment: Closing per previous comment by cmb. Previous Comments: ------------------------------------------------------------------------ [2016-07-01 14:35:50] cmb@php.net Apparently, this issue has been resolved as of PHP 7.0.0 (tested with 7.0.0 and 7.0.7 on Windows and current master on Linux). ------------------------------------------------------------------------ [2016-07-01 09:56:20] cmb@php.net There is already request #62065, which suggests to add a disconnect() method. I don't mark this ticket as duplicate, though, because this issue might be fixable without adding a new method. ------------------------------------------------------------------------ [2016-07-01 09:13:09] cmb@php.net Related To: Bug #69730 ------------------------------------------------------------------------ [2016-04-06 21:44:42] doug at opendns dot com This is still reproducible in 5.6.19, and I can confirm that the attached test script still works (or, more accurately, doesn't work). Since PDO lacks an explicit disconnect method, this bug is kind of a pain. ------------------------------------------------------------------------ [2013-06-08 04:26:51] rgagnon24 at gmail dot com Similar but different stuff happens under PHP5.4.14 It seems the PDOStatement object gets a reference to the PDO it was executed on, but when the PDOStatement errors or causes a PDOException (depending on the PDO::ATTR_ERROR_MODE), then the reference to the PDO object is not released, and you end up with a live database connection, but no way to close or control it. ------------------------------------------------------------------------ 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=62847 -- Edit this bug report at https://bugs.php.net/bug.php?id=62847&edit=1

« previous php.bugs (#231026) next »