1--TEST--
2mysqlnd.net_read_timeout > default_socket_timeout
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=1
18mysqlnd.net_read_timeout=12
19max_execution_time=12
20--FILE--
21<?php
22    set_time_limit(12);
23    require_once "connect.inc";
24
25    if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {
26        printf("[001] Connect failed, [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
27    }
28
29    if (!$res = mysqli_query($link, "SELECT SLEEP(6)"))
30        printf("[002] [%d] %s\n",  mysqli_errno($link), mysqli_error($link));
31
32    var_dump($res->fetch_assoc());
33
34    mysqli_free_result($res);
35    mysqli_close($link);
36
37    print "done!";
38?>
39--EXPECT--
40array(1) {
41  ["SLEEP(6)"]=>
42  string(1) "0"
43}
44done!
45