Annotation of embedaddon/php/ext/mysqli/tests/mysqli_mysqlnd_read_timeout.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: mysqlnd.net_read_timeout limit check
                      3: --SKIPIF--
                      4: <?php
                      5: require_once('skipif.inc');
                      6: require_once('skipifconnectfailure.inc');
                      7: require_once('connect.inc');
                      8: if (!$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--
                     13: default_socket_timeout=60
                     14: max_execution_time=60
                     15: mysqlnd.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--
                     32: Warning: mysqli_query(): MySQL server has gone away in %s on line %d
                     33: 
                     34: Warning: mysqli_query(): Error reading result set's header in %s on line %d
                     35: [002] [%d] %s
                     36: done!

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>