php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #47589 PDO DBLIB Fails with OOM on large recordsets
Submitted: 2009-03-06 16:36 UTC Modified: 2010-05-31 21:34 UTC
From: ssufficool at gmail dot com Assigned: ssufficool (profile)
Status: Closed Package: PDO related
PHP Version: 5.2.9 OS: Linux (Gentoo)
Private report: No CVE-ID: None
 [2009-03-06 16:36 UTC] ssufficool at gmail dot com
Description:
------------
When pulling large recordsets with PDO DBLIB I get out of memory.

This type of large recordset query works fine on mssql_* functions using the freetds library. This issue has been marked "Bogus" in the past. But since this works with other functions using FreeTDS, this issue may lie in the PDO layer.

Correct me if my understanding of Bogus is Bogus.

Reproduce code:
---------------
$pdo_ms = new PDO('dblib: host=host', 'user','pass');

/* We die here */
$rs = $pdo_ms->query("SELECT TOP 50000 from aVeryLargeTable");

Expected result:
----------------
A valid handle to a resultset in $rs

Actual result:
--------------
Available memory exhausted, tried to allocate.... 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-03-06 17:04 UTC] ssufficool at roadrunner dot com
My understanding of Bogus is indeed Bogus. After setting batchsize to 0 in php.ini, mssql_query also barfs on large recordssets. 

Apologies for the noise.
 [2010-01-14 18:20 UTC] ssufficool at roadrunner dot com
Please re-open this bug. I understand that the behaviour is shared across the PDO::DBLIB and MSSQL_* functions, however other PDO drivers do not have this issue (I.E. PDO:POSTGRESQL) and the same query issued on the command line via freetds (tsql) does not consume memory like this.

I am using a CURSOR_FWDONLY and this should not require buffering all the rows on the client.
 [2010-01-14 18:52 UTC] ssufficool at gmail dot com
new e-mail
 [2010-05-31 21:34 UTC] ssufficool@php.net
-Status: Bogus +Status: Closed -Assigned To: +Assigned To: ssufficool
 [2010-05-31 21:34 UTC] ssufficool@php.net
Fixed in revision 300002.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 17 05:01:31 2024 UTC