ID: 37406
Comment by: matuszynski at element5 dot de
Reported By: spatar at mail dot nnov dot ru
Status: Open
Bug Type: OCI8 related
Operating System: SuSE
PHP Version: 5.1.4
New Comment:
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
load():
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
Previous Comments:
------------------------------------------------------------------------
[2006-05-11 11:09:50] spatar at mail dot nnov dot ru
In older snapshot php5.1-200604030830 it worked:
----------------
size(): 26
load(): abcdefghijklmnopqrstuvwxyz
------------------------------------------------------------------------
[2006-05-11 10:57:29] spatar at mail dot nnov dot ru
Description:
------------
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:
---------------
<?php
$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";
}
$clob->free();
oci_free_statement($stid);
oci_close($conn);
?>
Expected result:
----------------
size(): 26
load(): abcdefghijklmnopqrstuvwxyz
Actual result:
--------------
size(): 26
load(): abcdef
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=37406&edit=1