xref: /PHP-5.3/ext/mysqli/tests/bug62046.phpt (revision d4afbd48)
1--TEST--
2Bug #62046 	mysqli@mysqlnd can't iterate over stored sets after call to mysqli_stmt_reset()
3--SKIPIF--
4<?php
5require_once('skipif.inc');
6require_once('skipifconnectfailure.inc');
7?>
8--FILE--
9<?php
10	require_once("connect.inc");
11
12	if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {
13		printf("[001] Connect failed, [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
14	}
15	if (FALSE === ($stmt = $link->prepare('SELECT 42'))) {
16		printf("[002] Prepare failed, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
17	}
18	if (FALSE === $stmt->execute()) {
19		printf("[003] Execute failed, [%d] %s\n", $stmt->errorno, $stmt->error);
20	}
21	if (FALSE === $stmt->store_result()) {
22		printf("[004] store_result failed, [%d] %s\n", $stmt->errorno, $stmt->error);
23	}
24	$one = NULL;
25	if (FALSE === $stmt->bind_result($one)) {
26		printf("[005] bind_result failed, [%d] %s\n", $stmt->errorno, $stmt->error);
27	}
28	if (FALSE === $stmt->reset()) {
29		printf("[006] bind_result failed, [%d] %s\n", $stmt->errorno, $stmt->error);
30	}
31	while ($stmt->fetch()) {
32		var_dump($one);
33	}
34	$stmt->close();
35	$link->close();
36	echo "done!";
37?>
38--EXPECT--
39int(42)
40done!