1--TEST--
2Bug #47415 PDO_Firebird segfaults when passing lowercased column name to bindColumn()
3--EXTENSIONS--
4pdo_firebird
5--SKIPIF--
6<?php require('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
12require 'testdb.inc';
13
14$dbh = getDbConnection();
15$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
16
17$dbh->exec('CREATE TABLE test47415 (idx int NOT NULL PRIMARY KEY, txt VARCHAR(20))');
18$dbh->exec('INSERT INTO test47415 VALUES(0, \'String0\')');
19
20$query = "SELECT idx, txt FROM test47415 ORDER by idx";
21$idx = $txt = 0;
22$stmt = $dbh->prepare($query);
23$stmt->bindColumn('idx', $idx);
24$stmt->bindColumn('txt', $txt);
25$stmt->execute();
26$rows = $stmt->fetch(PDO::FETCH_BOUND);
27var_dump($stmt->fetch());
28var_dump($stmt->rowCount());
29
30
31$stmt = $dbh->prepare('DELETE FROM test47415');
32$stmt->execute();
33
34unset($stmt);
35unset($dbh);
36?>
37--CLEAN--
38<?php
39require 'testdb.inc';
40$dbh = getDbConnection();
41@$dbh->exec("DROP TABLE test47415");
42unset($dbh);
43?>
44--EXPECT--
45bool(false)
46int(1)
47