php / php/php-src

max_allowed_packet=16777216 causes test failure on ext/mysqli/tests/mysqli_real_connect_compression_error.phpt

Đang mở
#10,063 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Bug Extension: mysqlnd Status: Verified
Ngôn ngữ chính
C
Star
40.4k
Fork
8.2k
Merge trung bình
2 ngày 13 giờ
Pull request đã merge (30 ngày)
96

Mô tả

Description

From #6136 / #6144

@nikic, I totally agree with "the protocol is pretty ridiculous".

  • smaller than 16M skips as expected
  • max_allowed_packet=16777216 +1024; (the smallest increment is 1k) passes
  • max_allowed_packet=16777216 generates the test output difference.

16777216 happens to be the MariaDB default: https://mariadb.com/kb/en/server-system-variables/#max_allowed_packet

The following code:

$ sapi/cli/php -d mysqli.allow_local_infile=On run-tests.php -P -q           -j$(/usr/bin/nproc)           -g FAIL,XFAIL,BORK,WARN,LEAK,XLEAK,SKIP           --offline           --show-diff           --show-slow 1000           --set-timeout 120 ext/mysqli/tests/mysqli_real_connect_compression_error.phpt

Resulted in this output:

=====================================================================
PHP         : /home/dan/repos/PHP-8.0/sapi/cli/php 
PHP_SAPI    : cli
PHP_VERSION : 8.1.14-dev
ZEND_VERSION: 4.1.14-dev
PHP_OS      : Linux - Linux localhost.localdomain 6.1.0-0.rc7.51.fc38.x86_64 #1 SMP PREEMPT_DYNAMIC Mon Nov 28 15:47:37 UTC 2022 x86_64
INI actual  : /home/dan/repos/PHP-8.0
More .INIs  :  
---------------------------------------------------------------------
PHP         : /home/dan/repos/PHP-8.0/sapi/cgi/php-cgi 
PHP_SAPI    : cgi-fcgi
PHP_VERSION : 8.1.14-dev
ZEND_VERSION: 4.1.14-dev
PHP_OS      : Linux - Linux localhost.localdomain 6.1.0-0.rc7.51.fc38.x86_64 #1 SMP PREEMPT_DYNAMIC Mon Nov 28 15:47:37 UTC 2022 x86_64
INI actual  : /home/dan/repos/PHP-8.0
More .INIs  : 
--------------------------------------------------------------------- 
---------------------------------------------------------------------
PHP         : /home/dan/repos/PHP-8.0/sapi/phpdbg/phpdbg 
PHP_SAPI    : phpdbg
PHP_VERSION : 8.1.14-dev
ZEND_VERSION: 4.1.14-dev
PHP_OS      : Linux - Linux localhost.localdomain 6.1.0-0.rc7.51.fc38.x86_64 #1 SMP PREEMPT_DYNAMIC Mon Nov 28 15:47:37 UTC 2022 x86_64
INI actual  : /home/dan/repos/PHP-8.0
More .INIs  : 
---------------------------------------------------------------------
CWD         : /home/dan/repos/PHP-8.0
Extra dirs  : 
VALGRIND    : Not used
=====================================================================
Running selected tests.

========DIFF========
001+ array(1) {
002+   [0]=>
003+   array(3) {
004+     ["errno"]=>
005+     int(1153)
006+     ["sqlstate"]=>
007+     string(5) "08S01"
008+     ["error"]=>
009+     string(51) "Got a packet bigger than 'max_allowed_packet' bytes"
010+   }
001- array(0) {
     }
012+ 
013+ Warning: Packets out of order. Expected 3 received 2. Packet size=64 in /home/dan/repos/PHP-8.0/ext/mysqli/tests/mysqli_real_connect_compression_error.php on line 27
003- array(0) {
004- }
014+ array(1) {
015+   [0]=>
016+   array(3) {
017+     ["errno"]=>
018+     int(2006)
019+     ["sqlstate"]=>
020+     string(5) "HY000"
021+     ["error"]=>
022+     string(26) "MySQL server has gone away"
023+   }
024+ }
========DONE========
FAIL Bug #80107 mysqli_query() fails for ~16 MB long query when compression is enabled [ext/mysqli/tests/mysqli_real_connect_compression_error.phpt] 

Tested against MariaDB-10.3.38(in dev), and MySQL 5.7.40.

Blocks #10062.

But I expected this output instead:

test pass.

PHP Version

PHP-8.1-2f6b9e6c639c37405e45094bd9c8f2f3b3f377d3

Operating System

Fedora 36

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu bằng cách chạy lệnh run-tests.php được cung cấp cho ext/mysqli/tests/mysqli_real_connect_compression_error.phpt với max_allowed_packet=16777216 trên MariaDB hoặc MySQL. Đọc kết quả kiểm thử cùng với Bug #80107 và các issue liên quan #6136, #6144 và #10062. Được xem là hoàn tất khi kiểm thử lỗi nén tạo ra kết quả "test pass" mong đợi mà không có khác biệt đầu ra đã được báo cáo.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
mysql, php
Lĩnh vực
databases, testing-qa
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.