#27164 [NEW]: blob data failing to save using OCINewDescriptor save

From: Date: Thu, 05 Feb 2004 21:59:43 +0000
Subject: #27164 [NEW]: blob data failing to save using OCINewDescriptor save
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-54481@lists.php.net to get a copy of this message
From: dbliss at hireability dot com Operating system: Redhat kv 2.4.20-8 PHP version: 4.3.5RC2 PHP Bug Type: OCI8 related Bug description: blob data failing to save using OCINewDescriptor save Description: ------------ We are using the Oracle 9.2 client and Apache 2.0.48 Saving a blob using the OCINewDescriptor method "save" causes "ocCILobWrite: illegal parameter value in OCI lob function" warning. All other data for the insert is saved but the blob data is lost. I tested using PHP 5 and there was no problem. I went back and used PHP 4.3.4 and there was no problem either. It seems 4.3.5RC2 is the problem. Reproduce code: --------------- $blob_data = fread(fopen("/file_location/file_name", "r"), filesize("/file_location/file_name")); $dbcon = OCILogon($dbUser,$dbPassword,$dbName); $lob = OCINewDescriptor($dbcon, OCI_D_LOB); $query = "INSERT INTO TABLE_NAME (TABLE_NAME_ID,BLOB_DATA) ". "VALUES (TABLE_NAME_SEQ.NEXTVAL, EMPTY_BLOB()) RETURNING ". BLOB_DATA into :BLOB_DATA"; $result = ociparse($dbcon,$query); OCIBindByName($results,":BLOB_DATA",$lob,-1,OCI_B_BLOB); OCIExecute($results,OCI_DEFAULT); $lob->save($blob_data); $lob->free(); Expected result: ---------------- $lob->save($blob_data); should return 1 and the data should be saved into the BLOB_DATA column of the table. Actual result: -------------- The rest of the data is saved into the table but $lob->svae($blob_data); returns nothing, the "ocCILobWrite: illegal parameter value in OCI lob function" error appears and no BLOB data is saved. -- Edit bug report at http://bugs.php.net/?id=27164&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=27164&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=27164&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=27164&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=27164&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=27164&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=27164&r=needscript Try newer version: http://bugs.php.net/fix.php?id=27164&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=27164&r=support Expected behavior: http://bugs.php.net/fix.php?id=27164&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=27164&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=27164&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=27164&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=27164&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=27164&r=dst IIS Stability: http://bugs.php.net/fix.php?id=27164&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=27164&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=27164&r=float

« previous php.bugs (#54481) next »