-
Notifications
You must be signed in to change notification settings - Fork 7.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mysqlnd: support ER_CLIENT_INTERACTION_TIMEOUT #13618
Merged
SakiTakamachi
merged 3 commits into
php:master
from
Appla:mysqlnd_support_ER_CLIENT_INTERACTION_TIMEOUT
Aug 26, 2024
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--TEST-- | ||
Bug #81335: Packets out of order after connection timeout | ||
--EXTENSIONS-- | ||
mysqli | ||
--SKIPIF-- | ||
<?php | ||
if (PHP_OS === 'WINNT') die('skip on windows'); | ||
if (getenv("SKIP_SLOW_TESTS")) die("skip slow test"); | ||
|
||
require_once 'connect.inc'; | ||
if (!$link = @my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) die("skip cannot connect"); | ||
if (mysqli_get_server_version($link) < 80024 || str_contains(mysqli_get_server_info($link), 'MariaDB')) { | ||
die("skip: Due to many MySQL Server differences, the test requires >= 8.0.24"); | ||
} | ||
?> | ||
--FILE-- | ||
<?php | ||
|
||
require_once 'connect.inc'; | ||
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT); | ||
$mysqli = new my_mysqli($host, $user, $passwd, $db, $port, $socket); | ||
$mysqli->query('SET WAIT_TIMEOUT=1'); | ||
usleep(1000000 * 1.1); | ||
try { | ||
$mysqli->query('SELECT 1 + 1'); | ||
} catch(mysqli_sql_exception $e) { | ||
echo $e->getMessage(); | ||
echo "\n"; | ||
echo $e->getCode(); | ||
} | ||
?> | ||
--EXPECTF-- | ||
The client was disconnected by the server because of inactivity. See wait_timeout and interactive_timeout for configuring this behavior. | ||
4031 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the same reason, I don't think this check should be done either, but is there any reason why
error_no
has to be0
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I consider 0 to mean that no error occurred, but this cannot be guaranteed. so may be compare with CLIENT_INTERACTION_TIMEOUT here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried various things.
There may already be a meaningful error set here, so checking if it's
0
makes sense to me.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it.