php-src/ext/mysqli/tests/bug36802.phpt
Georg Richter b3a437fcc4 Fix for bug #36802 (server crashes with invalid/not opened connections)
Added status to mysqli_resource:
		MYSQLI_STATUS_UNKNOWN
		MYSQLI_STATUS_CLEARED (for future use)
		MYSQLI_STATUS_INITIALIZED (after mysqli_init and mysqli_stmt_init)
		MYSQLI_STATUS_VALID (for valid objects)
	removed valid flag
	changed MYSQLI_FETCH_RESOURCE
		added last parameter __check which specifies the status
2006-03-24 09:32:24 +00:00

43 lines
649 B
PHP

--TEST--
bug #36802 : crashes with mysql_init
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
class my_mysqli extends mysqli {
function __construct()
{
}
}
include "connect.inc";
$mysql = mysqli_init();
/* following operations should not work */
$x[0] = @$mysql->set_charset('utf8');
$x[1] = @$mysql->query("SELECT 'foo' FROM DUAL");
/* following operations should work */
$x[2] = ($mysql->client_version > 0);
$x[3] = $mysql->errno;
$mysql->close();
var_dump($x);
?>
--EXPECT--
array(4) {
[0]=>
NULL
[1]=>
NULL
[2]=>
bool(true)
[3]=>
int(0)
}