|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #80837 Calling stmt_store_result after fetch doesn't throw an error
Submitted: 2021-03-05 21:35 UTC Modified: -
From: Assigned:
Status: Closed Package: MySQLi related
PHP Version: master-Git-2021-03-05 (Git) OS:
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:
16 - 1 = ?
Subscribe to this entry?

 [2021-03-05 21:35 UTC]
Calling stmt_store_result when in the middle of manual fetch cycle should throw an OOS error. However, mysqlnd sets the error in conn property which means mysqli will not throw it. 

Test script:

$mysqli = new mysqli('localhost', 'user', 'password', 'test');
$mysqli->set_charset('utf8mb4'); // always set the charset

$statement = $mysqli->prepare("SELECT b FROM a");
var_dump($mysqli->error, $statement->error);
echo $statement->num_rows();

Expected result:
Fatal error: Uncaught mysqli_sql_exception: Commands out of sync; you can't run this command now

Actual result:
string(52) "Commands out of sync; you can't run this command now"
string(0) ""


Add a Patch

Pull Requests

Pull requests:

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2021-03-05 22:01 UTC]
The following pull request has been associated:

Patch Name: Fix bug #80837
On GitHub:
 [2021-03-15 13:39 UTC]
Automatic comment on behalf of
Log: Fix bug #80837
 [2021-03-15 13:39 UTC]
-Status: Open +Status: Closed
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Thu Sep 23 06:03:35 2021 UTC