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--EXPECT--
32[002] [2006] MySQL server has gone away
33done!
34