|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2008-05-16 14:43 UTC] 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)
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Nov 04 16:00:01 2025 UTC |
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.