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