summaryrefslogtreecommitdiff
path: root/ext/pdo_sqlite/tests
diff options
context:
space:
mode:
authorOndřej Surý <ondrej@sury.org>2011-02-16 10:13:02 +0100
committerOndřej Surý <ondrej@sury.org>2011-02-16 10:13:02 +0100
commitfd5a0b31640419ca63d1ddeaffd6d3cf2a741814 (patch)
treebfd17d84c5181d7b98d7d66f56573f4fc897e31c /ext/pdo_sqlite/tests
parent01fcdff3849c3691d9aaeaab735846ab6d8895ca (diff)
downloadphp-fd5a0b31640419ca63d1ddeaffd6d3cf2a741814.tar.gz
Imported Upstream version 5.3.5upstream/5.3.5
Diffstat (limited to 'ext/pdo_sqlite/tests')
-rw-r--r--ext/pdo_sqlite/tests/bug52487.phpt21
1 files changed, 21 insertions, 0 deletions
diff --git a/ext/pdo_sqlite/tests/bug52487.phpt b/ext/pdo_sqlite/tests/bug52487.phpt
new file mode 100644
index 000000000..fc65bd3b6
--- /dev/null
+++ b/ext/pdo_sqlite/tests/bug52487.phpt
@@ -0,0 +1,21 @@
+--TEST--
+Bug #52487 (PDO::FETCH_INTO leaks memory)
+--SKIPIF--
+<?php # vim:ft=php
+if (!extension_loaded('pdo_sqlite')) print 'skip not loaded';
+?>
+--FILE--
+<?php
+require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
+$db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt');
+
+$stmt = $db->prepare("select 1 as attr");
+for ($i = 0; $i < 10; $i++) {
+ $stmt->setFetchMode(PDO::FETCH_INTO, new stdClass);
+}
+
+print "ok\n";
+
+?>
+--EXPECT--
+ok