Skip to content

ext/mysqli: Fixes MySQLi fake server packet reads - #23217

Open
NickSdot wants to merge 1 commit into
php:masterfrom
NickSdot:fix/flaky-mysqli
Open

ext/mysqli: Fixes MySQLi fake server packet reads#23217
NickSdot wants to merge 1 commit into
php:masterfrom
NickSdot:fix/flaky-mysqli

Conversation

@NickSdot

@NickSdot NickSdot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

It seems eb951b3 already tried to fix this by increasing the sleep from 10ms to 20ms for slow ASAN jobs. While working on CI and test batching I ran into it again with ALPINE_X64_ASAN_DEBUG_ZTS.

The server assumed one delayed fread() is one MySQL request, which TCP does not guarantee. Now reads complete packets, including partials.

Edit just caught one in an active PR:
https://github.com/php/php-src/actions/runs/31531428759/job/93912200471?pr=23038.

Test Failure

  ========DIFF========
  --
       [*] Received: 0a00000017010000000001000000
       [*] Sending - Stmt execute data fltval: 01000001023200000203646566087068705f74657374046461746104646174610673747276616c0673747276616c0ce000c8000000fd01100000003200000303646566087068705f746573740464617461046461746106666c7476616c06666c7476616c0c3f000c0000000401101f000005000004fe000022000b000005000004746573743333134005000006fe00002200
       float(2.3)
  016- [*] Received: 050000001901000000200000001653454c4543542073747276616c2c2064626c76616c2046524f4d2064617461
  016+ [*] Received: 050000001901000000
       [*] Sending - Stmt prepare data dblval: 0c0000010001000000020000000000003200000203646566087068705f74657374046461746104646174610673747276616c0673747276616c0ce000c8000000fd01100000003200000303646566087068705f74657374046461746104646174610664626c76616c0664626c76616c0c3f00160000000501101f000005000004fe00000200
  018- [*] Received: 0a00000017010000000001000000
  018+ [*] Received: 200000001653454c4543542073747276616c2c2064626c76616c2046524f4d20646174610a00000017010000000001000000
       [*] Sending - Stmt execute data dblval: 01000001023200000203646566087068705f74657374046461746104646174610673747276616c0673747276616c0ce000c8000000fd01100000003200000303646566087068705f74657374046461746104646174610664626c76616c0664626c76616c0c3f00160000000501101f000005000004fe000022000f00000500000474657374333333333333f33f05000006fe00002200
       float(1.2)
       [*] Received: 050000001901000000200000001653454c4543542073747276616c2c2064617476616c2046524f4d2064617461
  --
  ========DONE========
  FAIL MySQL protocol - statement row data fetch) [ext/mysqli/tests/protocol_stmt_row_fetch_data.phpt] 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant