|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-11-17 06:19 UTC] tony2001 at phpclub dot net
[2005-11-18 03:50 UTC] dziugas dot baltrunas at metasite dot net
[2006-03-21 10:07 UTC] tony2001 at phpclub dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 08:00:02 2025 UTC |
Description: ------------ Reading a BLOB column which is bigger than 1048576 bytes (this number is defined as PHP_OCI_LOB_BUFFER_SIZE in php_oci8_int.h) with ocifetchinto function with mode OCI_RETURN_LOBS, returned blob column always have a size of 1048576. This is definitely a bug in oci8_lob.c:php_oci_lob_get_length() function (as php_oci_lob_read is called from oci8_interface.c with read_length =-1) or in a reading loop in oci8_lob.c:php_oci_lob_read function. Reproduce code: --------------- $data = array(); $conn = OCIPLogon("user", "pass", "db"); $query = "SELECT BLOB_COLUMN FROM t WHERE ID=:id"; $cur = OCIParse($conn, $query); OCIBindByName ($cur, ':id', $id, 4000); $er = OCIExecute($cur); if (!$er) print_r(OCIError($cur)); OCIFetchInto($cur, $data, OCI_ASSOC + OCI_RETURN_NULLS + OCI_RETURN_LOBS); OCIFreeStatement($cur); echo strlen($data['BLOB_COLUMN']); Expected result: ---------------- Returned length of $data['BLOB_COLUMN'] should be the original length of the BLOB_COLUMN in table t. Actual result: -------------- Returned length of $data['BLOB_COLUMN'] is always 1048576 bytes.