summaryrefslogtreecommitdiff
path: root/ext/pdo_firebird
diff options
context:
space:
mode:
authorPopa Adrian Marius <mariuz@php.net>2011-12-28 09:53:15 (GMT)
committerPopa Adrian Marius <mariuz@php.net>2011-12-28 09:53:15 (GMT)
commit39a973a0c516a12ce6cbf84955421b450f6b7b1c (patch)
tree6d66f405f9dc9b63cc957253e7577f4849658777 /ext/pdo_firebird
parenta1952e19f9bb72d54f7bb7e3f2580f4a0cd0d1ae (diff)
downloadphp-39a973a0c516a12ce6cbf84955421b450f6b7b1c.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 0000000..3962336
--- /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)