1--TEST--
2mysqlnd.net_read_timeout limit check
3--SKIPIF--
4<?php
5require_once('skipif.inc');
6require_once('skipifconnectfailure.inc');
7require_once('connect.inc');
8if (!$IS_MYSQLND)
9	/* The libmysql read_timeout limit default is 365 * 24 * 3600 seconds. It cannot be altered through PHP API calls */
10	die("skip mysqlnd only test");
11?>
12--INI--
13default_socket_timeout=60
14max_execution_time=60
15mysqlnd.net_read_timeout=1
16--FILE--
17<?php
18	include ("connect.inc");
19
20	if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {
21		printf("[001] Connect failed, [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
22	}
23
24	if (!$res = mysqli_query($link, "SELECT SLEEP(5)"))
25		printf("[002] [%d] %s\n",  mysqli_errno($link), mysqli_error($link));
26
27	mysqli_close($link);
28
29	print "done!";
30?>
31--EXPECTF--
32Warning: mysqli_query(): MySQL server has gone away in %s on line %d
33
34Warning: mysqli_query(): Error reading result set's header in %s on line %d
35[002] [%d] %s
36done!
37