mirror of
https://github.com/php/php-src.git
synced 2024-10-02 15:26:06 +00:00
b7091aaf01
Per https://wiki.php.net/rfc/mysql_deprecation, connecting to a MySQL database via ext/mysql now generates an E_DEPRECATED error. This commit includes the minimal EXPECTF updates required for the test suite to pass: it may be preferable to refactor some of the tests to suppress deprecation errors in situations where no other error is expected from mysql_[p]connect(), but I'm not enough of a MySQL expert to want to get my hands that dirty in a long standing test suite.
39 lines
927 B
PHP
39 lines
927 B
PHP
--TEST--
|
|
mysqlnd.net_read_timeout > default_socket_timeout
|
|
--SKIPIF--
|
|
<?php
|
|
require_once('skipif.inc');
|
|
require_once('skipifconnectfailure.inc');
|
|
require_once('connect.inc');
|
|
?>
|
|
--INI--
|
|
default_socket_timeout=1
|
|
mysqlnd.net_read_timeout=12
|
|
max_execution_time=12
|
|
--FILE--
|
|
<?php
|
|
set_time_limit(12);
|
|
include ("connect.inc");
|
|
|
|
if (!$link = my_mysql_connect($host, $user, $passwd, $db, $port, $socket)) {
|
|
printf("[001] Connect failed, [%d] %s\n", mysql_errno(), mysqlerror());
|
|
}
|
|
|
|
if (!$res = mysql_query("SELECT SLEEP(6)", $link))
|
|
printf("[002] [%d] %s\n", mysql_errno($link), mysql_error($link));
|
|
|
|
var_dump(mysql_fetch_assoc($res));
|
|
|
|
mysql_free_result($res);
|
|
mysql_close($link);
|
|
|
|
print "done!";
|
|
?>
|
|
--EXPECTF--
|
|
Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d
|
|
array(1) {
|
|
[%u|b%"SLEEP(6)"]=>
|
|
%unicode|string%(1) "0"
|
|
}
|
|
done!
|