1--TEST--
2mysqlnd.net_read_timeout = 0
3--EXTENSIONS--
4mysqli
5--SKIPIF--
6<?php
7require_once 'connect.inc';
8
9if (!$link = @my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {
10    die(sprintf('skip Cannot connect to MySQL, [%d] %s.', mysqli_connect_errno(), mysqli_connect_error()));
11}
12if (mysqli_get_server_version($link) <= 50011) {
13    die(sprintf('skip Needs MySQL 5.0.12+, found version %d.', mysqli_get_server_version($link)));
14}
15?>
16--INI--
17default_socket_timeout=10
18max_execution_time=10
19mysqlnd.net_read_timeout=0
20--FILE--
21<?php
22    require_once 'connect.inc';
23
24    if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {
25        printf("[001] Connect failed, [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
26    }
27
28    if (!$res = mysqli_query($link, "SELECT SLEEP(2)"))
29        printf("[002] [%d] %s\n",  mysqli_errno($link), mysqli_error($link));
30
31    var_dump($res->fetch_assoc());
32
33    mysqli_free_result($res);
34    mysqli_close($link);
35
36    print "done!";
37?>
38--EXPECT--
39array(1) {
40  ["SLEEP(2)"]=>
41  string(1) "0"
42}
43done!
44