|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #77597 mysqli_fetch_field hangs scripts in PHP 7.3.2
Submitted: 2019-02-11 02:30 UTC Modified: 2019-02-21 12:24 UTC
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: ryan dot brothers at gmail dot com Assigned: nikic (profile)
Status: Closed Package: MySQLi related
PHP Version: 7.3.2 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
21 + 8 = ?
Subscribe to this entry?

 [2019-02-11 02:30 UTC] ryan dot brothers at gmail dot com
I am running into an issue with PHP 7.3.2 where calling mysqli_fetch_field hangs the script.  The same script in PHP 7.2.15 runs successfully.

It only occurs when calling store_result() with MYSQLI_STORE_RESULT_COPY_DATA

It could be related to bug #68548 that I submitted a few years ago, but something changed in PHP 7.3.2 that causes the call to hang completely now.

For the below test script, I'm using SQL:

CREATE TABLE a (b int);
INSERT INTO a VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9);

Test script:
$mysqli = new mysqli('localhost', 'test', 'test', 'test');

$mysqli->real_query("SELECT * FROM a");

$result = $mysqli->store_result(MYSQLI_STORE_RESULT_COPY_DATA);

$field = $result->fetch_field();

Expected result:
Script runs and instantly exits.

Actual result:
In PHP 7.3.2 with MYSQLI_STORE_RESULT_COPY_DATA, the script hangs.

In PHP 7.2.15 with MYSQLI_STORE_RESULT_COPY_DATA, the script runs and instantly exits.

In PHP 7.3.2 without MYSQLI_STORE_RESULT_COPY_DATA, the script runs and instantly exits.

In PHP 7.2.15 without MYSQLI_STORE_RESULT_COPY_DATA, the script runs and instantly exits.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2019-02-21 12:08 UTC]
-Status: Open +Status: Verified
 [2019-02-21 12:08 UTC]
From the debug trace, there's an infinite loop of php_mysqlnd_rowp_read_text_protocol_c calls:

<mysqlnd_conn_data::store_result (total=5397 own=237 in_calls=5160)
| info : We have decode the whole result set to be able to satisfy this meta request
| >mysqlnd_result_buffered_c::initialize_result_set_rest
| | >php_mysqlnd_rowp_read_text_protocol_c
| | | >php_mysqlnd_rowp_read_text_protocol_aux
| | | <php_mysqlnd_rowp_read_text_protocol_aux (total=0 own=0 in_calls=0)
| | <php_mysqlnd_rowp_read_text_protocol_c (total=38 own=38 in_calls=0)
| | >php_mysqlnd_rowp_read_text_protocol_c
| | | >php_mysqlnd_rowp_read_text_protocol_aux
| | | <php_mysqlnd_rowp_read_text_protocol_aux (total=0 own=0 in_calls=0)
| | <php_mysqlnd_rowp_read_text_protocol_c (total=37 own=37 in_calls=0)
 [2019-02-21 12:24 UTC]
-Status: Verified +Status: Assigned -Assigned To: +Assigned To: nikic
 [2019-02-21 12:52 UTC]
Automatic comment on behalf of
Log: Fixed bug #77597
 [2019-02-21 12:52 UTC]
-Status: Assigned +Status: Closed
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Thu Feb 27 08:01:27 2020 UTC