mirror of
https://github.com/php/php-src.git
synced 2024-09-22 10:27:25 +00:00
Don't expect a certain server reply, it is undefined what happens.
This commit is contained in:
parent
e9c6830e16
commit
0b474317fd
@ -78,6 +78,13 @@ mysqli.reconnect=0
|
||||
mysqli_connect_errno(), mysqli_connect_error());
|
||||
|
||||
$thread_id_timeout = mysqli_thread_id($link);
|
||||
/*
|
||||
Don't test for the mysqli_query() return value here.
|
||||
It is undefined if the server replies to the query and how.
|
||||
For example, it seems that on Linux when connecting to MySQL 5.1,
|
||||
the server always manages to send a full a reply. Whereas MySQl 5.5
|
||||
may not. The behaviour is undefined. Any return value is fine.
|
||||
*/
|
||||
if ($IS_MYSQLND) {
|
||||
/*
|
||||
mysqlnd is a bit more verbose than libmysql. mysqlnd should print:
|
||||
@ -85,11 +92,9 @@ mysqli.reconnect=0
|
||||
|
||||
Warning: mysqli_query(): Error reading result set's header in %d on line %d
|
||||
*/
|
||||
if (!@mysqli_query($link, sprintf('KILL %d', $thread_id_timeout)))
|
||||
printf("[013] Cannot KILL timeout connection, [%d] %s\n", mysqli_errno($link2), mysqli_error($link2));
|
||||
@mysqli_query($link, sprintf('KILL %d', $thread_id_timeout));
|
||||
} else {
|
||||
if (!mysqli_query($link, sprintf('KILL %d', $thread_id_timeout)))
|
||||
printf("[013] Cannot KILL timeout connection, [%d] %s\n", mysqli_errno($link2), mysqli_error($link2));
|
||||
mysqli_query($link, sprintf('KILL %d', $thread_id_timeout));
|
||||
}
|
||||
// Give the server a second to really kill the other thread...
|
||||
sleep(1);
|
||||
|
Loading…
Reference in New Issue
Block a user