summaryrefslogtreecommitdiff
path: root/ext/pdo_sqlite/tests
diff options
context:
space:
mode:
authorFelipe Pena <felipe@php.net>2010-07-29 23:46:49 +0000
committerFelipe Pena <felipe@php.net>2010-07-29 23:46:49 +0000
commit938265115b8857a81db269b86db5b1f8b6c8d60c (patch)
treee913509e7f63a043bb8df2806f863a9a64da04e9 /ext/pdo_sqlite/tests
parent7b9fe967747e41cef3017c1ea2c08b367ae770dc (diff)
downloadphp-git-938265115b8857a81db269b86db5b1f8b6c8d60c.tar.gz
- New test
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 0000000000..fc65bd3b60
--- /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