mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Merge branch 'PHP-8.4'
* PHP-8.4: Fixed GH-18276 - persistent connection - "zend_mm_heap corrupted" with setAttribute() (#18280) Closes #18280 Fixes #18276
This commit is contained in:
commit
3b87093bff
1 changed files with 35 additions and 0 deletions
35
ext/pdo_firebird/tests/gh18276.phpt
Normal file
35
ext/pdo_firebird/tests/gh18276.phpt
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
--TEST--
|
||||||
|
GH-18276 (persistent connection - setAttribute(Pdo\Firebird::ATTR_DATE_FORMAT, ..) results in "zend_mm_heap corrupted")
|
||||||
|
--EXTENSIONS--
|
||||||
|
pdo_firebird
|
||||||
|
--SKIPIF--
|
||||||
|
<?php require('skipif.inc'); ?>
|
||||||
|
--XLEAK--
|
||||||
|
A bug in firebird causes a memory leak when calling `isc_attach_database()`.
|
||||||
|
See https://github.com/FirebirdSQL/firebird/issues/7849
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
|
||||||
|
require("testdb.inc");
|
||||||
|
unset($dbh);
|
||||||
|
|
||||||
|
for ($i = 0; $i < 2; $i++) {
|
||||||
|
$dbh = new PDO(
|
||||||
|
PDO_FIREBIRD_TEST_DSN,
|
||||||
|
PDO_FIREBIRD_TEST_USER,
|
||||||
|
PDO_FIREBIRD_TEST_PASS,
|
||||||
|
[
|
||||||
|
PDO::ATTR_PERSISTENT => true,
|
||||||
|
],
|
||||||
|
);
|
||||||
|
// Avoid interned
|
||||||
|
$dbh->setAttribute(PDO::FB_ATTR_DATE_FORMAT, str_repeat('Y----m----d', random_int(1, 1)));
|
||||||
|
$dbh->setAttribute(PDO::FB_ATTR_TIME_FORMAT, str_repeat('H::::i::::s', random_int(1, 1)));
|
||||||
|
$dbh->setAttribute(PDO::FB_ATTR_TIMESTAMP_FORMAT, str_repeat('Y----m----d....H::::i::::s', random_int(1, 1)));
|
||||||
|
unset($dbh);
|
||||||
|
}
|
||||||
|
|
||||||
|
echo 'done!';
|
||||||
|
?>
|
||||||
|
--EXPECT--
|
||||||
|
done!
|
Loading…
Add table
Add a link
Reference in a new issue