ID: 47311 Updated by: [email protected] Reported By: matteo at beccati dot com -Status: Open +Status: Closed Bug Type: PDO related Operating System: Any PHP Version: 5.3.0beta1 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: ------------------------------------------------------------------------ [2009-02-04 18:31:55] matteo at beccati dot com Patch is available here: http://www.beccati.com/misc/pdo_pgsql_bug47311_php_5.3.patch It fixes another small problem in the phpt and adds one more test case. Plus adds a note to the code. ------------------------------------------------------------------------ [2009-02-04 18:29:09] matteo at beccati dot com Description: ------------ I was trying to investigate a test failure in the pdo_pgsql extension, namely the large_objects.phpt. The failure is caused by the fact that the LOB parameter is bound after calling execute, which seems to be unsupported. Moving the call to bindColumn() before execute() fixes the test. I've also tried to fix it, but no matter how hard I tried I couldn't find a suitable solution that also kept backwards compatibility (i.e. returning the large object OID as int if the parameter is not explicitly bound as PDO::PARAM_LOB). Therefore I think that the best solution would be to document such behaviour and fix the test accordingly. Note: it doesn't look like a duplicate of #40913, as mysql and sqlite do not seem to have custom code to retrieve data as a stream. Reproduce code: --------------- $stmt = $db->prepare("SELECT * from test"); $stmt->bindColumn('bloboid', $lob, PDO::PARAM_LOB); $stmt->execute(); $stmt->fetch(PDO::FETCH_ASSOC); var_dump(is_resource($lob)); $stmt = $db->prepare("SELECT * from test"); $stmt->execute(); $stmt->bindColumn('bloboid', $lob, PDO::PARAM_LOB); $stmt->fetch(PDO::FETCH_ASSOC); var_dump(is_resource($lob)); Expected result: ---------------- bool(true) bool(true) Actual result: -------------- bool(true) bool(false) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=47311&edit=1
