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