summaryrefslogtreecommitdiff
path: root/ext/mysqli/tests/bug33491.phpt
blob: 7e994bc4d0bb43993af85b830ad87718f3ad2ce8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
--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 boolean in %sbug33491.php on line %d