php-src/ext/mysqli/tests/bug33491.phpt
Ulf Wendel 974935e6b8 Next set of files which now feature the new environment variable
MYSQL_TEST_SKIP_CONNECT_FAILURE which controls how connection problems
are handled: failure (MYSQL_TEST_SKIP_CONNECT_FAILURE = false, default)
or skip (MYSQL_TEST_SKIP_CONNECT_FAILURE = true)

Also, some minor tweaking of connection parameters in the tests.
2007-08-09 09:43:28 +00:00

30 lines
665 B
PHP

--TEST--
Bug #33491 (extended mysqli class crashes when result is not object)
--INI--
error_reporting=4095
--SKIPIF--
<?php
require_once('skipif.inc');
require_once('skipifconnectfailure.inc');
?>
--FILE--
<?php
class DB extends mysqli
{
public function query_single($query) {
$result = parent::query($query);
$result->fetch_row(); // <- Here be crash
}
}
require_once("connect.inc");
// Segfault when using the DB class which extends mysqli
$DB = new DB($host, $user, $passwd, $db, $port, $socket);
$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