![]() |
|
|
|
|
|
|
|
|
4
19th October 01:01
External User
Posts: 1
|
Try isolating the problem. If you have a literal query through PDO that
fails, in isolation, try the same query using the old-skool odbc routines; just a trivial test script. If that works but the same test script converted to minimal PDO fails, you've found a bug. If it fails in both cases, I'd start blaming something else. -- Larry Garfield AIM: LOLG42 larry@garfieldtech.com ICQ: 6817012 "If nature has made any one thing less susceptible than all others of exclusive property, it is the action of the thinking power called an idea, which an individual may exclusively possess as long as he keeps it to himself; but the moment it is divulged, it forces itself into the possession of every one, and the receiver cannot dispossess himself of it." -- Thomas Jefferson |
|
|
6
19th October 01:02
External User
Posts: 1
|
The problem is isolated to PDO ODBC -- old school ODBC works fine.
Below are my test cases. Plain old ODBC: <?php // lobtestOdbc.php $res = odbc_connect('fmarchive_mssql', 'change', 'me'); if (!$res) { die ('failed to connect'); } $stp = 'SELECT attdata FROM fm_faxin_att WHERE id = 119085913400004 AND attid = 0'; // statement to prepare $ps = odbc_prepare($res, $stp); if (!$res) { die ('failed to prepare statement'); } $execResult = odbc_execute($ps); echo var_export($execResult, true); ?> The output from the plain old ODBC test case is: true (indicating that odbc_execute succeeded, see http://www.php.net/manual/en/function.odbc-execute.php). Next up, PDO ODBC: <?php // lobtestPdoOdbc.php try { $db = new PDO('odbc:fmarchive_mssql', 'change', 'me'); $stp = 'SELECT attdata FROM fm_faxin_att WHERE id = 119085913400004 AND attid = 0'; // statement to prepare $ps = $db->prepare($stp); $execResult = $ps->execute(); var_export($execResult, true); } catch (PDOException $e) { die($e->getMessage()); } ?> When running lobtestPdoOdbc.php, I get the same old error: *Fatal error*: Out of memory (allocated 262144) (tried to allocate 4294967295 bytes) in *C:\Inetpub\wwwroot\FMarchive\lobtestPdoOdbc.php* on line *9* I tried removing the try-catch blocks with no change in output (still gets the exact same Fatal Error) -- not like that would be an acceptable solution anyway. It appears this is a problem with PDO. I'm starting to really get out of my league now. How can I go about fixing this? Regards, Carlton Whitehead |
|
|
7
19th October 01:02
External User
Posts: 1
|
Hi Colin,
The MS documentation says the image type can hold up to 2GB: http://technet.microsoft.com/en-us/l.../ms187993.aspx It appears someone beat me to filing a bug report about this: http://bugs.php.net/bug.php?id=42765 I guess that's that for now until this gets fixed. Regards, Carlton Whitehead ----- Original Message ----- From: "Colin Guthrie" <gmane@colin.guthr.ie> To: php-general@lists.php.net Sent: Thursday, September 27, 2007 4:04:53 AM (GMT-0500) America/New_York Subject: [php] Re: PDOStatement execute memory issue? I don't think so as the 4GB value is mentioned in the error message. Usually when memory is exhausted in a loop it will say "(tried to allocate 100 bytes)" - e.g. a little amount. This appears to do it in one chunk. I wonder if this is trying to allocate memory for the maximum potential size of your field in the DB? Perhaps read up on PDO/ODBC/MSSQL and how they treat BLOBs.... (I don't know myself). Col -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php |
|
| Some other forums that might be of your interest : Php 5 forum, Apache forum, Iis forum, Functions forum, Classes forum, Librarys forum, Bugs forum, Postgres forum, Mysql forum, Paradox forum, Ms sql forum, Configurations forum, Php.ini forum, Problems forum, Scripting forum, Css forum, General forums, Off-topic talk, Links, Extra forums, Php |