|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #39824 mysql_free_result warning
Submitted: 2006-12-13 23:20 UTC Modified: 2006-12-18 10:47 UTC
From: marcos dot neves at gmail dot com Assigned:
Status: Not a bug Package: MySQL related
PHP Version: 5.2.0 OS: WINXP
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:
From: marcos dot neves at gmail dot com
New email:
PHP Version: OS:


 [2006-12-13 23:20 UTC] marcos dot neves at gmail dot com
Starting with mysql 5.2.0, mysql_free_result is required be called before end of script

Reproduce code:

mysql_connect("localhost", "root", "");

$result = mysql_query("SELECT 1 + 2");


Expected result:
no warnings, the results should be disposed at end of script, as documentantion saids and as like was before.

Actual result:
Warning: Unknown: 1 result set(s) not freed. Use mysql_free_result to free result sets which were requested using mysql_query() in Unknown on line 0


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-12-18 08:38 UTC]
Set mysql.trace_mode to Off in your php.ini.
 [2006-12-18 10:38 UTC] marcos dot neves at gmail dot com
Hide the error msg doesn?t means the error has gone.
Does this error still happens before 5.2? Why no warning before?
The docs are very clear:
"only needs to be called if you are concerned about how much memory is being used for queries that return large result sets. All associated result memory is automatically freed at the end of the script's execution"

I hope that this "trick" of hide error messages to "fixes" then, not be used at PHP core code :(
 [2006-12-18 10:47 UTC]
>Does this error still happens before 5.2? 
Sure it does. 
Just enable trace_mode and you'll see it.

>Why no warning before?
Because you did not enable mysql.trace_mode before.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Fri Mar 31 01:03:44 2023 UTC