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