[php-src] PR #24041: ext/pdo: Defer persistent handle cleanup to the last owner

From: Date: Thu, 01 Oct 2026 10:27:15 +0000
Subject: [php-src] PR #24041: ext/pdo: Defer persistent handle cleanup to the last owner
Groups: php.git-pulls 
Request: Send a blank email to git-pulls+get-39029@lists.php.net to get a copy of this message
Pull Request: https://github.com/php/php-src/pull/24041 Author: iliaal GH-23962 (#23963) made pdo_dbh_free_storage() skip the rollback while another PDO instance still holds the persistent connection, but the same teardown still runs the driver's persistent_shutdown handler and releases the handle's failed query statement. Destroying one of two persistent SQLite instances therefore unregisters the functions and collations the other one relies on, and resets its errorCode()/errorInfo() to 00000. Both now use the same last-owner check as the rollback, so they run once when the final instance is freed. Drivers whose persistent_shutdown is NULL (pgsql, odbc, firebird, dblib) are unaffected, and mysqlnd's end_psession is deferred the same way.

« previous php.git-pulls (#39029) next »