|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37406 Can't load lob string
Submitted: 2006-05-11 10:57 UTC Modified: 2006-06-02 09:16 UTC
Avg. Score:5.0 ± 0.0
Reproduced:3 of 3 (100.0%)
Same Version:3 (100.0%)
Same OS:1 (33.3%)
From: spatar at mail dot nnov dot ru Assigned:
Status: Closed Package: OCI8 related
PHP Version: 5.1.4 OS: SuSE
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 !
Your email address:
Solve the problem:
20 + 6 = ?
Subscribe to this entry?

 [2006-05-11 10:57 UTC] spatar at mail dot nnov dot ru
Can't load lob string.
It seems, OCI8 calculates wrong size in _bytes_ for UTF strings to load.
My Oracle database charset is AL32UTF8, so maybe it's the cause of that the load() method returns only the first 1/4 part of a string.
The older versions didn't have this bug.

Reproduce code:
        $conn = oci_connect("scott", "tiger", "ora10201");
        $sql =  "begin :p_clob := 'abcdefghijklmnopqrstuvwxyz'; end;";
        $stid = oci_parse($conn, $sql);
        $clob = oci_new_descriptor($conn, OCI_D_LOB);
        oci_bind_by_name($stid, ":p_clob", $clob, -1, OCI_B_CLOB);
        $r = oci_execute($stid, OCI_DEFAULT);
        if ($r)
                echo "size(): ", $clob->size(), "\n";
                echo "load(): ", $clob->load(), "\n";

Expected result:
size(): 26
load(): abcdefghijklmnopqrstuvwxyz

Actual result:
size(): 26
load(): abcdef


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-05-11 11:09 UTC] spatar at mail dot nnov dot ru
In older snapshot php5.1-200604030830 it worked:
size(): 26
load(): abcdefghijklmnopqrstuvwxyz
 [2006-05-12 13:55 UTC] matuszynski at element5 dot de
I encountered a similar problem that might be related to this one: Reading CLOBs always leads to empty strings.

When running the given sample, I get the following output:

size(): 26

We're using Oracle 10 client and PHP 5.1.4 under Ubuntu and connect to a Oracle 9i DB running under Solaris on SPARC
 [2006-05-15 09:07 UTC]
Please try using this CVS snapshot:
For Windows:

Please try next snapshot.
 [2006-05-15 10:17 UTC] spatar at mail dot nnov dot ru
The latest CVS snapshot (php5.2-200605150830) produces the same wrong result:
size(): 26
load(): abcdef
 [2006-05-15 10:31 UTC]
I intentionally wrote "next snapshot" because the latest snapshot was built BEFORE the patch has been applied.
 [2006-05-15 12:19 UTC] spatar at mail dot nnov dot ru
Now I tested with snapshot php5.2-200605151030 and result is still the same :(
 [2006-05-15 13:56 UTC]
I'd appreciate if you provide an account for me to reproduce & investigate this problem on your server.
 [2006-05-23 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2006-06-02 09:16 UTC] spatar at mail dot nnov dot ru
With the latest changes problem seems to be fixed.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Jul 23 12:01:30 2024 UTC