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