php-src/ext/pdo_mysql/tests/construct_persistent_failure.phpt
Nikita Popov c02aa46126 Fix leak when persistent PDO connection fails
As we don't register the resource, the resource dtor is not called
and will not decrement the refcount.
2021-11-16 16:14:29 +01:00

16 lines
298 B
PHP

--TEST--
Failure when creating persistent connection
--EXTENSIONS--
pdo_mysql
--FILE--
<?php
try {
$pdo = new PDO('mysql:host=localhost', 'invalid_user', 'invalid_password', [
PDO::ATTR_PERSISTENT => true,
]);
} catch (PDOException $e) {
echo "Caught\n";
}
?>
--EXPECT--
Caught