Fix handling of large compressed packets#6144
Closed
nikic wants to merge 3 commits intophp:masterfrom
Closed
Conversation
Member
|
The test fails on default configurations of MySQL 5.6 and 8.0 on Windows, because ext/mysqli/tests/mysqli_real_connect_compression_error.phpt | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/ext/mysqli/tests/mysqli_real_connect_compression_error.phpt b/ext/mysqli/tests/mysqli_real_connect_compression_error.phpt
index 4ce0804bc8..fb876bf449 100644
--- a/ext/mysqli/tests/mysqli_real_connect_compression_error.phpt
+++ b/ext/mysqli/tests/mysqli_real_connect_compression_error.phpt
@@ -4,7 +4,15 @@ Bug #80107 mysqli_query() fails for ~16 MB long query when compression is enable
<?php
require_once('skipif.inc');
require_once('skipifemb.inc');
-require_once('skipifconnectfailure.inc');
+require_once("connect.inc");
+$link = @my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
+if (!$link) {
+ die(sprintf("skip Can't connect to MySQL Server - [%d] %s", mysqli_connect_errno(), mysqli_connect_error()));
+}
+$result = $link->query("SHOW VARIABLES LIKE 'max_allowed_packet'");
+if ($result->fetch_assoc()['Value'] < 0xffffff) {
+ die('skip max_allowed_packet is less than 0xffffff');
+}
?>
--INI--
mysqli.allow_local_infile=1 |
Member
Author
|
@cmb69 I see a couple tests doing |
Member
|
That needs SUPER privilege, and fails otherwise. We could check for that, but given that the test apparently works in CI, I think just skipping is okay. |
737f388 to
eb4e369
Compare
Member
Author
|
Merged into 7.3 up. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fix for https://bugs.php.net/bug.php?id=80107. There's two layers of packet splitting going on. First, packets need to be split into having a payload of exactly 2^24-1 bytes or being the last packet. If the split packet has size between 2^24-5 and 2^24-1 bytes, the compressed packets also needs to be split, though the choice of split doesn't matter here. I'm splitting off the first 8192 bytes, as that's what I observe libmysqlclient to be doing.
If I may say so, the protocol is pretty ridiculous.