php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #81034 mysqli_result::free emmits exception/warning
Submitted: 2021-05-12 09:40 UTC Modified: 2021-05-23 04:22 UTC
From: shop1 at mokraemer dot de Assigned:
Status: No Feedback Package: MySQLi related
PHP Version: 8.0.6 OS:
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2021-05-12 09:40 UTC] shop1 at mokraemer dot de
Description:
------------
an exception is thrown and a warning is emitted if no result is available.
There is no need to emmit this!!!

With this (change due to @ operator) it makes db handling more complex without any benefit. Since insert/update events do not have any results.

Expected result:
----------------
do NOT emit any warning! this causes error checks to trigger, which is not desireable!!!

Actual result:
--------------
an exception is emitted (can be handled, but unneeded)
and a warning is emitted which is worse, since it can't be silenced!

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-05-12 09:41 UTC] nikic@php.net
-Status: Open +Status: Feedback
 [2021-05-12 09:41 UTC] nikic@php.net
Could you please provide an example script for the case you have in mind?
 [2021-05-23 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 [2021-05-23 07:11 UTC] rtrtrtrtrt at dfdfdfdf dot dfd
> Since insert/update events do not have any results

and why would you then free the result?
be happy that php tells you a useless function call

in 99.9% of all cases you can remove 100% of mysqli_result::free from your codebase at all
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 19:01:28 2024 UTC