php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #27164 blob data failing to save using OCINewDescriptor save
Submitted: 2004-02-05 16:59 UTC Modified: 2004-02-05 21:24 UTC
From: dbliss at hireability dot com Assigned:
Status: Not a bug Package: OCI8 related
PHP Version: 4.3.5RC2 OS: Redhat kv 2.4.20-8
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: dbliss at hireability dot com
New email:
PHP Version: OS:

 

 [2004-02-05 16:59 UTC] dbliss at hireability dot com
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.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-02-05 21:24 UTC] iliaa@php.net
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. 

Thank you for your interest in PHP.

This is a dupe of an already fixed bug. 
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 07:01:31 2024 UTC