|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #80842 Reading num_rows property on unbuffered result should throw an error
Submitted: 2021-03-06 22:25 UTC Modified: -
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: Assigned:
Status: Open Package: MySQLi related
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
New email:
PHP Version: OS:


 [2021-03-06 22:25 UTC]
Reading mysqli_stmt::num_rows property or calling the method mysqli_stmt::num_rows() should throw an error if using unbuffered results and the result hasn't been fully fetched yet. 

Test script:

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

$stmt = $mysqli->prepare('SELECT * FROM a LIMIT 2');
echo $stmt->num_rows; // <-- Should trigger OOS error

Expected result:
Out of sync error

Actual result:


Add a Patch

Pull Requests

Add a Pull Request

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Jul 14 06:01:29 2024 UTC