1--TEST--
2Fail gracefully on empty result set
3--EXTENSIONS--
4mysqli
5--SKIPIF--
6<?php
7require_once 'skipifconnectfailure.inc';
8?>
9--FILE--
10<?php
11    require_once 'connect.inc';
12    if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {
13        printf("Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n",
14            $host, $user, $db, $port, $socket);
15        exit(1);
16    }
17
18    // Returns only one result set
19    $link->multi_query("SELECT 1");
20    var_dump($link->next_result()); // should return false
21    var_dump($link->store_result()); // now what happens here!?
22
23
24    // Returns only one result set
25    $link->multi_query("SELECT 1");
26    var_dump($link->next_result());
27    var_dump($link->use_result());
28
29    $link->close();
30?>
31--EXPECT--
32bool(false)
33object(mysqli_result)#3 (5) {
34  ["current_field"]=>
35  int(0)
36  ["field_count"]=>
37  int(1)
38  ["lengths"]=>
39  NULL
40  ["num_rows"]=>
41  int(1)
42  ["type"]=>
43  int(0)
44}
45bool(false)
46object(mysqli_result)#3 (5) {
47  ["current_field"]=>
48  int(0)
49  ["field_count"]=>
50  int(1)
51  ["lengths"]=>
52  NULL
53  ["num_rows"]=>
54  int(0)
55  ["type"]=>
56  int(1)
57}
58