]> granicus.if.org Git - php/commitdiff
add test case
authorfoobar <sniper@php.net>
Mon, 27 Jun 2005 19:07:52 +0000 (19:07 +0000)
committerfoobar <sniper@php.net>
Mon, 27 Jun 2005 19:07:52 +0000 (19:07 +0000)
ext/mysqli/tests/bug33491.phpt [new file with mode: 0644]

diff --git a/ext/mysqli/tests/bug33491.phpt b/ext/mysqli/tests/bug33491.phpt
new file mode 100644 (file)
index 0000000..fb25c8e
--- /dev/null
@@ -0,0 +1,24 @@
+--TEST--
+Bug #33491 (extended mysqli class crashes when result is not object)
+--INI--
+error_reporting=4095
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+
+class DB extends mysqli
+{
+  public function query_single($query) {
+    $result = parent::query($query);
+    $result->fetch_row(); // <- Here be crash
+  }
+}
+
+// Segfault when using the DB class which extends mysqli
+$DB = new DB('localhost', 'root', '', '');
+$DB->query_single('SELECT DATE()');
+
+?>
+--EXPECTF--
+Fatal error: Call to a member function fetch_row() on a non-object in %sbug33491.php on line %d