summaryrefslogtreecommitdiff
path: root/ext/pdo_firebird
diff options
context:
space:
mode:
authorPopa Adrian Marius <mariuz@php.net>2011-12-28 09:53:15 +0000
committerPopa Adrian Marius <mariuz@php.net>2011-12-28 09:53:15 +0000
commit503540a4e444fe1f8bd1f5ef652d456589bda5b0 (patch)
treeb98a5a30d5c31e275f4a1e79280e8ba591c1cd57 /ext/pdo_firebird
parent28878d390fef24c35feba92716677b5bfa8687e0 (diff)
downloadphp-git-503540a4e444fe1f8bd1f5ef652d456589bda5b0.tar.gz
added testcase for Bug 47415
Diffstat (limited to 'ext/pdo_firebird')
-rw-r--r--ext/pdo_firebird/tests/bug_47415.phpt42
1 files changed, 42 insertions, 0 deletions
diff --git a/ext/pdo_firebird/tests/bug_47415.phpt b/ext/pdo_firebird/tests/bug_47415.phpt
new file mode 100644
index 0000000000..396233640f
--- /dev/null
+++ b/ext/pdo_firebird/tests/bug_47415.phpt
@@ -0,0 +1,42 @@
+--TEST--
+Bug #47415 PDO_Firebird segfaults when passing lowercased column name to bindColumn()
+--SKIPIF--
+<?php extension_loaded("pdo_firebird") or die("skip"); ?>
+--FILE--
+<?php
+
+require("testdb.inc");
+
+$dbh = new PDO("firebird:dbname=$test_base",$user,$password) or die;
+$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
+$value = '2';
+@$dbh->exec('DROP TABLE testz');
+$dbh->exec('CREATE TABLE testz (idx int NOT NULL PRIMARY KEY, txt VARCHAR(20))');
+$dbh->exec('INSERT INTO test VALUES(0, \'String0\')');
+$dbh->commit();
+
+$query = "SELECT idx, txt FROM test ORDER by idx";
+$idx = $txt = 0;
+$stmt = $dbh->prepare($query);
+$stmt->bindColumn('idx', $idx);
+$stmt->bindColumn('txt', $txt);
+$stmt->execute();
+$rows = $stmt->fetch(PDO::FETCH_BOUND);
+var_dump($stmt->fetch());
+var_dump($stmt->rowCount());
+
+
+$stmt = $dbh->prepare('DELETE FROM testz');
+$stmt->execute();
+
+$dbh->commit();
+
+$dbh->exec('DROP TABLE testz');
+
+unset($stmt);
+unset($dbh);
+
+?>
+--EXPECT--
+bool(false)
+int(1)