1--TEST--
2Bug #47415 PDO_Firebird segfaults when passing lowercased column name to bindColumn()
3--SKIPIF--
4<?php extension_loaded("pdo_firebird") or die("skip"); ?>
5--FILE--
6<?php
7
8require("testdb.inc");
9
10$dbh = new PDO("firebird:dbname=$test_base",$user,$password) or die;
11$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
12$value = '2';
13@$dbh->exec('DROP TABLE testz');
14$dbh->exec('CREATE TABLE testz (idx int NOT NULL PRIMARY KEY, txt VARCHAR(20))');
15$dbh->exec('INSERT INTO testz VALUES(0, \'String0\')');
16$dbh->commit();
17
18$query = "SELECT idx, txt FROM testz ORDER by idx";
19$idx = $txt = 0;
20$stmt = $dbh->prepare($query);
21$stmt->bindColumn('idx', $idx);
22$stmt->bindColumn('txt', $txt);
23$stmt->execute();
24$rows = $stmt->fetch(PDO::FETCH_BOUND);
25var_dump($stmt->fetch());
26var_dump($stmt->rowCount());
27
28
29$stmt = $dbh->prepare('DELETE FROM testz');
30$stmt->execute();
31
32$dbh->commit();
33
34$dbh->exec('DROP TABLE testz');
35
36unset($stmt);
37unset($dbh);
38
39?>
40--EXPECT--
41bool(false)
42int(1)
43