1--TEST--
2PDO_firebird subclass basic
3--EXTENSIONS--
4pdo_firebird
5--SKIPIF--
6<?php require(__DIR__ . '/skipif.inc'); ?>
7--XLEAK--
8A bug in firebird causes a memory leak when calling `isc_attach_database()`.
9See https://github.com/FirebirdSQL/firebird/issues/7849
10--FILE--
11<?php
12
13require_once __DIR__ . "/testdb.inc";
14
15$db = getDbConnection();
16
17$db->query('CREATE TABLE pdofirebird_001 (idx INT NOT NULL PRIMARY KEY, name VARCHAR(20))');
18$db->query("INSERT INTO pdofirebird_001 VALUES (1, 'PHP')");
19$db->query("INSERT INTO pdofirebird_001 VALUES (2, 'PHP6')");
20
21foreach ($db->query('SELECT name FROM pdofirebird_001') as $row) {
22    var_dump($row);
23}
24
25echo "Fin.";
26?>
27--CLEAN--
28<?php
29require_once __DIR__ . '/testdb.inc';
30$dbh = getDbConnection();
31@$dbh->exec("DROP TABLE pdofirebird_001");
32unset($dbh);
33?>
34--EXPECT--
35array(2) {
36  ["NAME"]=>
37  string(3) "PHP"
38  [0]=>
39  string(3) "PHP"
40}
41array(2) {
42  ["NAME"]=>
43  string(4) "PHP6"
44  [0]=>
45  string(4) "PHP6"
46}
47Fin.
48