Skip to content

Commit 3b87093

Browse files
committed
Merge branch 'PHP-8.4'
* PHP-8.4: Fixed GH-18276 - persistent connection - "zend_mm_heap corrupted" with setAttribute() (#18280) Closes #18280 Fixes #18276
2 parents 0f5372d + bd9f03a commit 3b87093

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

Diff for: ext/pdo_firebird/tests/gh18276.phpt

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
--TEST--
2+
GH-18276 (persistent connection - setAttribute(Pdo\Firebird::ATTR_DATE_FORMAT, ..) results in "zend_mm_heap corrupted")
3+
--EXTENSIONS--
4+
pdo_firebird
5+
--SKIPIF--
6+
<?php require('skipif.inc'); ?>
7+
--XLEAK--
8+
A bug in firebird causes a memory leak when calling `isc_attach_database()`.
9+
See https://github.com/FirebirdSQL/firebird/issues/7849
10+
--FILE--
11+
<?php
12+
13+
require("testdb.inc");
14+
unset($dbh);
15+
16+
for ($i = 0; $i < 2; $i++) {
17+
$dbh = new PDO(
18+
PDO_FIREBIRD_TEST_DSN,
19+
PDO_FIREBIRD_TEST_USER,
20+
PDO_FIREBIRD_TEST_PASS,
21+
[
22+
PDO::ATTR_PERSISTENT => true,
23+
],
24+
);
25+
// Avoid interned
26+
$dbh->setAttribute(PDO::FB_ATTR_DATE_FORMAT, str_repeat('Y----m----d', random_int(1, 1)));
27+
$dbh->setAttribute(PDO::FB_ATTR_TIME_FORMAT, str_repeat('H::::i::::s', random_int(1, 1)));
28+
$dbh->setAttribute(PDO::FB_ATTR_TIMESTAMP_FORMAT, str_repeat('Y----m----d....H::::i::::s', random_int(1, 1)));
29+
unset($dbh);
30+
}
31+
32+
echo 'done!';
33+
?>
34+
--EXPECT--
35+
done!

0 commit comments

Comments
 (0)