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