#45021 [Opn->Fbk]: PDO_OCI only fetches 512 bytes from a LONG column
| From: | jani@php.net | Date: | Sat, 25 Apr 2009 15:07:28 +0000 |
| Subject: | #45021 [Opn->Fbk]: PDO_OCI only fetches 512 bytes from a LONG column | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-136285@lists.php.net to get a copy of this message | ||
ID: 45021
Updated by: jani@php.net
Reported By: steil at zweitwerk dot com
-Status: Open
+Status: Feedback
Bug Type: PDO related
Operating System: Linux
PHP Version: 5.2.6
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php5.2-latest.tar.gz
For Windows:
http://windows.php.net/snapshots/
Previous Comments:
------------------------------------------------------------------------
[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/?id=45021&edit=1