View Issue Details

IDProjectCategoryView StatusLast Update
0001071XdebugUncategorizedpublic2014-11-11 20:07
ReporterAbcAeffchen Assigned Toderick  
PrioritynormalSeverityminorReproducibilityhave not tried
Status resolvedResolutionnot fixable 
Platform64bitOSWindowsOS VersionWindows 7
Product Version2.2.5 
Summary0001071: Many warnings if breakpoint is setted after a closed prepared mysqli statement
Description

If I set a breakpoint after a closed mysqli statement, I get a lot of warnings like

Property access is not allowed yet (3 times)

or

Couldn't fetch mysqli_stmt (7 times)

pointing to the line i setted the breakpoint to.

But the statement is already closed and not used in this line or any line after.
If I do not set any breakpoint the script runs perfectly fine without errors or wanings and it also loads the data from the database correctly.

Steps To Reproduce

$conn = new mysqli($host, $username, $passwd, $dbname);

...

$stmt = $conn->prepare('SELECT ...');
$stmt->bind_param(...);
$stmt->execute();
$stmt->bind_result(...);
while($stmt->fetch())
{
// do something here
}
$stmt->close(); // setting a breakpoint AFTER this.

... // maybe here

// do something more here that has absolutly nothing to do with $stmt

Additional Information

I used additional xdebug settings:

xdebug.collect_vars = "on"
xdebug.collect_params = 2
xdebug.show_local_vars = "on"
xdebug.trace_format = 1

A workaround is to unset $stmt after closing.

TagsNo tags attached.
Operating System
PHP Version5.5.0-5.5.4

Activities

robertjohnson

2014-11-09 10:40

reporter   ~0002889

This is happening to me too, it's not new though. You will also find that when using xdebug, the value of affected_rows might mysteriously be set to -1 even though a command statement succeeded. It makes debugging very herd because you have to 2nd guess if your code is only failing in the debugger.

Thanks for reporting this because I had forgotten about it and was really confused why so many 'errors' kept happening in code that used to work perfectly!

derick

2014-11-11 20:07

administrator   ~0002906

This is a bug in the MySQLi driver. I have filed a bug already for this way
in the past: https://bugs.php.net/bug.php?id=67348

Issue History

Date Modified Username Field Change
2014-08-20 21:08 AbcAeffchen New Issue
2014-11-09 10:40 robertjohnson Note Added: 0002889
2014-11-11 20:07 derick Note Added: 0002906
2014-11-11 20:07 derick Status new => resolved
2014-11-11 20:07 derick Resolution open => not fixable
2014-11-11 20:07 derick Assigned To => derick
2016-07-31 12:36 derick Category Usage problems => Usage problems (Crashes)
2016-07-31 12:38 derick Category Usage problems (Crashes) => Usage problems (Wrong Results)
2020-03-12 16:35 derick Category Usage problems (Wrong Results) => Variable Display
2020-03-12 16:38 derick Category Variable Display => Uncategorized