[GIT-PULLS] [php-src] PR #23217: ext/mysqli: Fixes MySQLi fake server packet reads

[email protected] (NickSdot)
Newsgroups php.git-pulls
Message-ID <[email protected]>
Pull Request: https://github.com/php/php-src/pull/23217
Author: NickSdot

It seems https://github.com/php/php-src/commit/eb951b3d11109aa16982a2132f8d1fd5129edc9e 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.

### 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] 
```
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.