Skip to content

Commit cef1b7e

Browse files
committed
Added a test
1 parent e96a35b commit cef1b7e

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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+
$dbh = new PDO(
17+
PDO_FIREBIRD_TEST_DSN,
18+
PDO_FIREBIRD_TEST_USER,
19+
PDO_FIREBIRD_TEST_PASS,
20+
[
21+
PDO::ATTR_PERSISTENT => true,
22+
],
23+
);
24+
unset($dbh);
25+
26+
$dbh = new PDO(
27+
PDO_FIREBIRD_TEST_DSN,
28+
PDO_FIREBIRD_TEST_USER,
29+
PDO_FIREBIRD_TEST_PASS,
30+
[
31+
PDO::ATTR_PERSISTENT => true,
32+
],
33+
);
34+
$dbh->setAttribute(Pdo\firebird::ATTR_DATE_FORMAT, 'Y----m----d');
35+
$dbh->setAttribute(Pdo\firebird::ATTR_TIME_FORMAT, 'H::::i::::s');
36+
$dbh->setAttribute(Pdo\firebird::ATTR_TIMESTAMP_FORMAT, 'Y----m----d....H::::i::::s');
37+
38+
echo 'done!';
39+
?>
40+
--EXPECT--
41+
done!

0 commit comments

Comments
 (0)