From:
Operating system: Linux
PHP version: 5.3.6
Package: PDO related
Bug Type: Bug
Bug description:PDO_OCI cannot insert more than 1332 one byte chars in al32utf8
varchar2 field
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 bug report at https://bugs.php.net/bug.php?id=55138&edit=1
--
Try a snapshot (PHP 5.2):
https://bugs.php.net/fix.php?id=55138&r=trysnapshot52
Try a snapshot (PHP 5.3):
https://bugs.php.net/fix.php?id=55138&r=trysnapshot53
Try a snapshot (trunk):
https://bugs.php.net/fix.php?id=55138&r=trysnapshottrunk
Fixed in SVN:
https://bugs.php.net/fix.php?id=55138&r=fixed
Fixed in SVN and need be documented:
https://bugs.php.net/fix.php?id=55138&r=needdocs
Fixed in release:
https://bugs.php.net/fix.php?id=55138&r=alreadyfixed
Need backtrace:
https://bugs.php.net/fix.php?id=55138&r=needtrace
Need Reproduce Script:
https://bugs.php.net/fix.php?id=55138&r=needscript
Try newer version:
https://bugs.php.net/fix.php?id=55138&r=oldversion
Not developer issue:
https://bugs.php.net/fix.php?id=55138&r=support
Expected behavior:
https://bugs.php.net/fix.php?id=55138&r=notwrong
Not enough info:
https://bugs.php.net/fix.php?id=55138&r=notenoughinfo
Submitted twice:
https://bugs.php.net/fix.php?id=55138&r=submittedtwice
register_globals:
https://bugs.php.net/fix.php?id=55138&r=globals
PHP 4 support discontinued:
https://bugs.php.net/fix.php?id=55138&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=55138&r=dst
IIS Stability:
https://bugs.php.net/fix.php?id=55138&r=isapi
Install GNU Sed:
https://bugs.php.net/fix.php?id=55138&r=gnused
Floating point limitations:
https://bugs.php.net/fix.php?id=55138&r=float
No Zend Extensions:
https://bugs.php.net/fix.php?id=55138&r=nozend
MySQL Configuration Error:
https://bugs.php.net/fix.php?id=55138&r=mysqlcfg
Try a snapshot (PHP 5.4):
https://bugs.php.net/fix.php?id=55138&r=trysnapshot54