Edit report at https://bugs.php.net/bug.php?id=55138&edit=1
ID: 55138
User updated by: an0nym at narod dot ru
Reported by: an0nym at narod dot ru
Summary: PDO_OCI cannot insert more than 1332 one byte chars
in al32utf8 varchar2 field
Status: Open
Type: Bug
Package: PDO related
Operating System: Linux
PHP Version: 5.3.6
Block user comment: N
Private report: N
New Comment:
This issue can be worked around by adding $statement->bindParam(":test",
$test>>>, PDO::PARAM_STR, 4000<<<), however this does not fix the bug itself.
Previous Comments:
------------------------------------------------------------------------
[2011-07-05 15:16:40] an0nym at narod dot ru
Description:
------------
PDO_OCI cannot insert more than 1332 one byte chars in al32utf8 varchar2(4000
CHAR) field.
Additional info
$ php -v
PHP 5.3.6 (cli) (built: Apr 27 2011 23:46:11)
Copyright (c) 1997-2011 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies
$ uname -a
Linux ... 2.6.18-194.32.1.el5 #1 SMP Wed Jan 5 17:52:25 EST 2011 x86_64 x86_64
x86_64 GNU/Linux
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
Test script:
---------------
<?php
$DB = new PDO("oci:dbname=//host:port/dbname;charset=AL32UTF8", "...", "...",
array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION));
foreach ($DB->query("SELECT value FROM nls_database_parameters WHERE parameter
= 'NLS_CHARACTERSET'") as $row)
echo $row["VALUE"], "\n";
$DB->exec("CREATE TABLE test(test VARCHAR2(4000 CHAR))");
$statement = $DB->prepare("INSERT INTO test VALUES(:test)");
$test = str_repeat(chr(97), 1332);
$statement->bindParam(":test", $test);
$statement->execute();
$test .= chr(97);
try {
$statement->execute();
} catch (PDOException $e) {
$DB->exec("DROP TABLE test");
exit("Error\n");
}
exit("Ok\n");
Expected result:
----------------
$ php test.php
AL32UTF8
Ok
Actual result:
--------------
$ php test.php
AL32UTF8
Error
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=55138&edit=1