Bug #63486 [Asn->Csd]: mysqli_free_result leave the resource variable in a messy state

From: Date: Thu, 29 Oct 2020 09:46:41 +0000
Subject: Bug #63486 [Asn->Csd]: mysqli_free_result leave the resource variable in a messy state
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-230000@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=63486&edit=1

 ID:                 63486
 Updated by:         nikic@php.net
 Reported by:        derick@php.net
 Summary:            mysqli_free_result leave the resource variable in a
                     messy state
-Status:             Assigned
+Status:             Closed
 Type:               Bug
 Package:            MySQLi related
 PHP Version:        5.4.8
-Assigned To:        mysql
+Assigned To:        nikic
 Block user comment: N
 Private report:     N

 New Comment:

This has been fixed by https://github.com/php/php-src/commit/d39edebbce35890aafd77cc47e1830e851287219
in PHP 7.4.


Previous Comments:
------------------------------------------------------------------------
[2020-08-16 00:20:05] marcelotpcruz at gmail dot com

This is fixed at PHP 7.4.9 (cli) (built: Aug  4 2020 11:52:41) ( ZTS Visual C++ 2017 x64 ).

Probably fixed at Version 7.4.3.

You may check for an int property to see if it's freed:
$result->free();
var_dump(isset($result->current_field));//bool(false)
var_dump($result);//object(mysqli_result)#3 (0) {}

------------------------------------------------------------------------
[2016-07-21 07:25:49] davey@php.net

Closed accidentally. Reopening.

------------------------------------------------------------------------
[2016-07-20 11:39:18] davey@php.net

Automatic comment on behalf of jpauli
Revision: http://git.php.net/?p=php-src.git;a=commit;h=37ecfdad09767773dfacf478e0c5a66a01f66dca
Log: Fix #63486

------------------------------------------------------------------------
[2015-10-28 22:38:09] php dot net at mellesmoen dot com

I'm seeing this issue as well using:

PHP 5.6.14
Xdebug 2.3.3
MySQL 5.7.9

Though the work around posted by "[2015-01-16 08:57 UTC] hans dot puac at gmail dot com"
fixes the issue and allows me to move forward. ;-)

------------------------------------------------------------------------
[2015-06-04 15:47:02] loco at andrews dot lv

This issue is still there and is extremely annoying, as xdebug is practically unusable, as it's
often impossible to reach a breakpoint due to the state of mysqli_result:

"main(): Couldn't fetch mysqli_result in ...."

error is recorded into the fpm log when setting a breakpoint in PhpStorm, even before a breakpoint
could even be reached..

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=63486


--
Edit this bug report at https://bugs.php.net/bug.php?id=63486&edit=1


Thread (24 messages)

« previous php.bugs (#230000) next »