Bug #69552 [NEW]: PDO INSERT BLOB in oracle 12c database

From: Date: Thu, 30 Apr 2015 13:59:47 +0000
Subject: Bug #69552 [NEW]: PDO INSERT BLOB in oracle 12c database
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-192426@lists.php.net to get a copy of this message
From: michael dot lane at fadq dot gouv dot qc dot ca Operating system: Debian 3.2.65- PHP version: 5.4.40 Package: PDO OCI Bug Type: Bug Bug description:PDO INSERT BLOB in oracle 12c database Description: ------------ I try all possibility but I'm pretty sure it's not possible to insert a file in an Oracle 12C database BLOB with PDO. All the other column have a value but my BLOB data length is always 0. Table description: Table: LOCI_DOCU Column Name id Data type Null? ID 1 NUMBER (10) N FK_SH_ID 2 NUMBER (10) N NOM_PHYS_DOCU 3 VARCHAR2 (150 Byte) N TIMB_MAJ 4 DATE N USAG_MAJ 5 VARCHAR2 (12 Byte) N ADR_DOCU 6 VARCHAR2 (200 Byte) Y DOCU 7 BLOB Y TAIL_DOCU 8 NUMBER (13) Y MIME_TYPE 9 VARCHAR2 (200 Byte) Y Test script: --------------- $connection = $this->getConnection(); $sql = "INSERT INTO LOCI_DOCU (fk_sh_id, nom_phys_docu, tail_docu, mime_type, docu) VALUES (:FK, :NAMEFILE, :SIZEFILE, :MIMEFILE, EMPTY_BLOB()) RETURNING DOCU INTO :FILELOB"; $stmt = $connection->prepare($sql); $stmt->bindParam(":FK", 1, PDO::PARAM_INT); $stmt->bindParam(":NAMEFILE", 'MyFileName.jpg, PDO::PARAM_STR); $stmt->bindParam(":SIZEFILE", 278743, PDO::PARAM_INT); $stmt->bindParam(":MIMEFILE", "image/jpeg", PDO::PARAM_STR); $stmt->bindParam(":FILELOB", 50, PDO::PARAM_LOB); $stmt->execute(); Expected result: ---------------- Row insert with no error. Get a data length of 278743 and be able to get the file working if downloaded. Actual result: -------------- Row insert with no error. Data length of 0 of the BLOB in the database. When downloading file, can not show result of the original inserted file, broken file with no content. -- Edit bug report at https://bugs.php.net/bug.php?id=69552&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=69552&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=69552&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=69552&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=69552&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=69552&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=69552&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=69552&r=needscript Try newer version: https://bugs.php.net/fix.php?id=69552&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=69552&r=support Expected behavior: https://bugs.php.net/fix.php?id=69552&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=69552&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=69552&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=69552&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=69552&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=69552&r=dst IIS Stability: https://bugs.php.net/fix.php?id=69552&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=69552&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=69552&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=69552&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=69552&r=mysqlcfg

« previous php.bugs (#192426) next »