#40121 [Opn->Csd]: DBLIB driver wont free statements
| From: | iliaa@php.net | Date: | Sun, 14 Jan 2007 16:57:56 +0000 |
| Subject: | #40121 [Opn->Csd]: DBLIB driver wont free statements | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-107584@lists.php.net to get a copy of this message | ||
ID: 40121
Updated by: iliaa@php.net
Reported By: spheroid@php.net
-Status: Open
+Status: Closed
Bug Type: PDO related
Operating System: Mac OS X 10.4.8
PHP Version: 5.2.1RC2
New Comment:
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2007-01-13 18:23:10] spheroid@php.net
Forgot to mention that it works perfectly with MySQL driver.
------------------------------------------------------------------------
[2007-01-13 18:19:43] spheroid@php.net
Description:
------------
As stated on the summary, PDO DBLIB driver wont free memory
allocated to statements (or the resultset, not sure). Same
code done with ext/mssql functions works, though.
Reproduce code:
---------------
$db = new PDO('dblib:host=hostname;dbname=database', 'user',
'password');
$query = 'SELECT GETDATE()'; // NOW() on mysql
for ($i = 0; $i < 10; $i++) {
$stmt = $db->query($query); // new statement
$stmt->fetch(); // actual data
$stmt->fetch(); // false; end of resultset
$stmt->closeCursor(); // this should at least free it,
right?
$stmt = null; // being paranoid here
echo memory_get_usage() . "\n";
}
Expected result:
----------------
54152
54152
54152
54152
54152
54152
54152
54152
54152
54152
Actual result:
--------------
54152
54252
54292
54332
54372
54412
54452
54492
54532
54572
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=40121&edit=1