Doc #68537 [NEW]: oci_bind_by_name() should provide unity length description

From: Date: Tue, 02 Dec 2014 08:32:50 +0000
Subject: Doc #68537 [NEW]: oci_bind_by_name() should provide unity length description
Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-11714@lists.php.net to get a copy of this message
From: ikonta at yandex dot ru Operating system: Gentoo GNU/Linux PHP version: 5.4.35 Package: Documentation problem Bug Type: Documentation Problem Bug description:oci_bind_by_name() should provide unity length description Description: ------------ After migrating to UTF8, database provides two-way semantics for text data types: byte (for single byte encodings is a synonim of char) and char. http://docs.oracle.com/cd/B28359_01/server.111/b28318/datatype.htm#CNCPT012 Length field in oci_bind_by_name() function forcely expect byte data size. For now we should update documentation noting it. For future development, ma be it is reasonable to add a modifier to switch between char and byte semantics. SQL> CREATE TABLE EXAMPLE ( MESSAGE VARCHAR2(16 CHAR) NOT NULL ); Oracle's client locale is: NLS_LANG=RUSSIAN_RUSSIA.AL32UTF8 Test script: --------------- <?php require_once("../inc/conn.inc"); $conn = conn("UPO"); $var = "тест-тест"; $stid = oci_parse($conn, 'INSERT INTO EXAMPLE VALUES (:bv)'); oci_bind_by_name($stid, ':bv', $var, 9); if (oci_execute($stid)) { echo ("insert OK"); oci_free_statement($stid); oci_close($conn); } else echo ("insert failed"); ?> Expected result: ---------------- If client's locale is NLS_LANG=RUSSIAN_CIS.CL8ISO8859P5 properly encoded (translated from UTF8 back to ISO-8859-5) script works fine. I expect the same for modern UTF8 locale. Or at least proper description of issued function: what and how should be corrected. Actual result: -------------- If client is configured to use UTF8 locale, quoted script failes with ORA-01461 (can bind a LONG value only for insert into a LONG column) error. Originally it was find for binding output variables for call of PL/SQL procedure. In that case the error message was ORA-06525: Length Mismatch for CHAR or RAW data -- Edit bug report at https://bugs.php.net/bug.php?id=68537&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=68537&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=68537&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=68537&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=68537&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=68537&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=68537&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=68537&r=needscript Try newer version: https://bugs.php.net/fix.php?id=68537&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=68537&r=support Expected behavior: https://bugs.php.net/fix.php?id=68537&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=68537&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=68537&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=68537&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=68537&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=68537&r=dst IIS Stability: https://bugs.php.net/fix.php?id=68537&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=68537&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=68537&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=68537&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=68537&r=mysqlcfg

« previous php.doc.bugs (#11714) next »