php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #45021 PDO_OCI only fetches 512 bytes from a LONG column
Submitted: 2008-05-16 14:43 UTC Modified: 2021-05-16 04:22 UTC
Votes:21
Avg. Score:4.6 ± 0.8
Reproduced:18 of 19 (94.7%)
Same Version:7 (38.9%)
Same OS:5 (27.8%)
From: steil at zweitwerk dot com Assigned: cmb (profile)
Status: No Feedback Package: PDO OCI
PHP Version: 5.2CVS-2009-04-29 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
14 - 8 = ?
Subscribe to this entry?

 
 [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)


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-05-19 16:30 UTC] 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.
 [2009-04-25 15:07 UTC] 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/


 [2009-04-29 14:13 UTC] steil at zweitwerk dot com
Testing on Linux, I can find no improvement. The error message and result are as before
 [2010-12-28 12:29 UTC] 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.
 [2012-10-26 05:54 UTC] sixd@php.net
-Assigned To: sixd +Assigned To:
 [2014-01-01 12:52 UTC] felipe@php.net
-Package: PDO related +Package: PDO OCI
 [2021-05-03 12:30 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2021-05-03 12:30 UTC] cmb@php.net
Is this still an issue with any of the actively supported PHP
versions[1]?

[1] <https://www.php.net/supported-versions.php>
 [2021-05-16 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 11:01:27 2024 UTC