Bug #45021 [Com]: PDO_OCI only fetches 512 bytes from a LONG column
| From: | tomasz at trejderowski dot pl | Date: | Tue, 28 Dec 2010 11:29:22 +0000 |
| Subject: | Bug #45021 [Com]: PDO_OCI only fetches 512 bytes from a LONG column | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-157355@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=45021&edit=1
ID: 45021
Comment by: tomasz at trejderowski dot pl
Reported by: steil at zweitwerk dot com
Summary: PDO_OCI only fetches 512 bytes from a LONG column
Status: Assigned
Type: Bug
Package: PDO related
Operating System: Linux
PHP Version: 5.2CVS-2009-04-29
Assigned To: sixd
Block user comment: N
Private report: N
New Comment:
Exactly the same results on PHP Version 5.3.1 and Windows XP SP 3.
Conclusion: No fix up until 5.3.1.
Previous Comments:
------------------------------------------------------------------------
[2009-04-29 14:13:50] steil at zweitwerk dot com
Testing on Linux, I can find no improvement. The error message and
result are as before
------------------------------------------------------------------------
[2009-04-25 15:07:27] jani@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php5.2-latest.tar.gz
For Windows:
http://windows.php.net/snapshots/
------------------------------------------------------------------------
[2008-05-19 16:30:10] steil at zweitwerk dot com
Sorry, I thought I could straighten the example by omitting records with
small content, but the long column does not support the length property
whence the statement should just read
$res = $db->query("SELECT longcolumn FROM table");
However, the bug remains.
------------------------------------------------------------------------
[2008-05-16 14:43:10] steil at zweitwerk dot com
Description:
------------
If you fetch from an Oracle column of datatype long, and the actual data
is more than 512 byte long it will be truncated and the following
warning will be issued
"Warning: PDOStatement::fetch(): column 0 data was too large for buffer
and was truncated to fit it in"
Reproduce code:
---------------
$db = new PDO('oci:dbname=...', 'user', 'pwd');
$res = $db->query("SELECT longcolumn FROM table WHERE length(longcolumn)
> 512");
$row = $res->fetch();
print_r('data length: '. strlen($row[0]));
results in $row[0] being truncated and the output
data length: 512
Expected result:
----------------
$row[0] should contain all of the data and the output
data length: x (where x > 512)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=45021&edit=1