Bug #45021 [Opn->Fbk]: PDO_OCI only fetches 512 bytes from a LONG column
| From: | cmb@php.net | Date: | Mon, 03 May 2021 12:30:38 +0000 |
| Subject: | Bug #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-233661@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=45021&edit=1
ID: 45021
Updated by: cmb@php.net
Reported by: steil at zweitwerk dot com
Summary: PDO_OCI only fetches 512 bytes from a LONG column
-Status: Open
+Status: Feedback
Type: Bug
Package: PDO OCI
Operating System: Linux
PHP Version: 5.2CVS-2009-04-29
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
Is this still an issue with any of the actively supported PHP
versions[1]?
[1] <https://www.php.net/supported-versions.php>
Previous Comments:
------------------------------------------------------------------------
[2010-12-28 12:29:21] tomasz at trejderowski dot pl
Exactly the same results on PHP Version 5.3.1 and Windows XP SP 3. Conclusion: No fix up until
5.3.1.
------------------------------------------------------------------------
[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 https://bugs.php.net/bug.php?id=45021&edit=1