php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #34630 PDO: LOB support incomplete in some drivers
Submitted: 2005-09-24 20:34 UTC Modified: 2008-07-23 13:58 UTC
From: wez@php.net Assigned: wez
Status: Closed Package: Feature/Change Request
PHP Version: 5CVS-2005-09-24 (cvs) OS: *
Private report: No CVE-ID:
 [2005-09-24 20:34 UTC] wez@php.net
Description:
------------
Quoting a reporting I received via email:

I'm trying to use PDO abstraction layer (version 1.0RC1), but I'm having serious problems with LOB support in Oracle and Postgres (the only I've tried).




Reproduce code:
---------------
<?php
	/* Connect to an ODBC database using driver invocation */
	$dsn = 'pgsql:host=192.168.0.4 port=5432 dbname=isodb_fresz';
	$path = "test.jpg";

   	$dbh = new PDO($dsn, "isodb_user", "isodb_user");

        $sql="
        insert into iso_dane_binarne (db_dane_binarne_id, db_dane)
        values(1, ?);";

        $content  = fopen($path, "rb");
        print_r($content);

        $stmt = $dbh->prepare($sql);
        print_r(PDO_PARAM_LOB);
        $stmt->bindParam( 1, $content, PDO_PARAM_LOB);
        $stmt->execute();
?>


Expected result:
----------------
The image content in the database

Actual result:
--------------
This inserts something like "Resource id 3#" string into db_dane (bytea type) column.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-07-14 14:14 UTC] uw@php.net
This one still fails on aix5.2-ppc64 and hpux11.23-ia64 with php5.3-200807081830. It seems to work fine on all other platforms.
 [2008-07-23 13:58 UTC] uw@php.net
Now that PHP 5_3 compiles again on Solaris using Sun CC, I see this test failing on:

mysqldev@production:~/Connector-PHP-PDO-mysqlnd/testlogs> find ./ -type f -name bug_34630.diff

./solaris10-sparc64/bug_34630.diff
./solaris8-sparc64/bug_34630.diff
./hpux11.23-ia64/bug_34630.diff
./solaris9-sparc64/bug_34630.diff

mysqldev@production:~/Connector-PHP-PDO-mysqlnd/testlogs> cat solaris10-sparc64/bug_34630.diff
007+     string(14) "Resource id #6"
007-     string(17) "I am the LOB data"mysqldev

(This time AIX is not on the list because the AIX box has been skipped)

SPARC 32 bit seems fine.
 [2010-05-15 17:59 UTC] i dot kay at me dot com
Having just compiled PHP 5.3.2 on CentOS 5.5 domU I have encountered this bug 
after running make test.

I used the following configure command:
./configure --prefix=/usr/local --sysconfdir=/etc/php --with-apxs2 --with-zlib

The error reported by make test was:
=====================================================================
WARNED TEST SUMMARY
---------------------------------------------------------------------
via [ext/pdo_sqlite/tests/common.phpt]
	SQLite PDO Common: Bug #34630 (inserting streams as LOBs) 
[ext/pdo_sqlite/tests/bug_34630.phpt] (warn: XFAIL section but test passes)
via [ext/sqlite/tests/pdo/common.phpt]
	SQLite2 PDO Common: Bug #34630 (inserting streams as LOBs) 
[ext/sqlite/tests/pdo/bug_34630.phpt] (warn: XFAIL section but test passes)
=====================================================================
 [2010-05-15 18:06 UTC] i dot kay at me dot com
I should have mentioned that I'm using the x86_64 architecture. Xen 4.0.1 without 
pvopts kernel. CentOS has been installed using the pxeboot xen image. Boots on 
kernel-xen-2.6.18-194.3.1.el5 with pygrub. Installed autoconf, automake, make, 
gcc, gcc-c++, zlib-devel, libxml2-devel distro packages.
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Mon Apr 21 02:02:11 2014 UTC