Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-19619

ORA-22921: with ora-initialize.sh

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Medium Medium
    • None
    • 4.7.0-dev
    • None
    • ezp47

    Description

      If chrachters like • äöüÄÖÜß„„ are used the script runs in errors because of wrong character counts:
      Note: I shortended a string with a hack, but you can see the error. String length shold be 5 but php counts 6.
      Fix is below (using mb_strlen isntead of strlen and mb_substr istead of substr. Beacuse of this the buffer may be to short, so i set the splitting count from 4000 down to 2000)

      Error: (eZOracleDB::query())
      Error (22921): ORA-22921: Länge des Eingabepuffers ist kleiner als der geforderte Wert
      ORA-06512: in "SYS.DBMS_LOB", Zeile 833
      ORA-06512: in Zeile 5
      Failed query at offset 0:
      DECLARE
        v_5 CLOB;
      BEGIN
      INSERT INTO ezcontentobject_attribute (attribute_original_id, contentclassattribute_id, contentobject_id, data_float, data_int, data_text, data_type_string, id, language_code, language_id, sort_key_int, sort_key_string, version) VALUES (0,392,132,'0',1045487555,empty_clob(),'ezxmltext',682,'ger-DE',2,0,'',1) RETURNING data_text INTO v_5;
      dbms_lob.writeappend(v_5, 6, 'eßend');
      COMMIT;
      END;
      
      Start of error:
      DECLARE
        v_5 CLOB;
      BEGIN
      INSERT INTO ezcontentobject_attribute (attribute_original_id, contentclassattribute_id, contentobject_id, data_float, data_int, data_text, data_type_string, id, language_code, language_id, sort_key_int, sort_key_string, version) VALUES (0,392,132,'0',1045487555,empty_clob(),'ezxmltext',682,'ger-DE',2,0,'',1) RETURNING data_text INTO v_5;
      dbms_lob.writeappend(v_5, 6, 'eßend');
      COMMIT;
      END;
      
      Error: (eZDBInterface::commit TRANSID-347a7ed580bc280e28977bdbea6358a6)
      Transaction in progress failed due to DB error, transaction was rollbacked. Transaction ID is TRANSID-347a7ed580bc280e28977bdbea6358a6.
      

      FIX:

      Index: extension/ezoracle/ezdb/dbms-schema/ezoracleschema.php
      ===================================================================
      --- extension/ezoracle/ezdb/dbms-schema/ezoracleschema.php	(Revision 65770)
      +++ extension/ezoracle/ezdb/dbms-schema/ezoracleschema.php	(Arbeitskopie)
      @@ -776,7 +776,7 @@
                   {
                       foreach( $blobs as $blobcol )
                       {
      -                    if ( strlen( $row[$blobcol] ) > 4000 )
      +                    if ( mb_strlen( $row[$blobcol] ) > 2000 )
                           {
                               $splitrows[] = $i;
                           }
      @@ -860,12 +860,12 @@
                           $insert = substr( $insert, 0, -2 ) . ";\n";
                           foreach ( $blobs as $blobcol )
                           {
      -                        while( ( $len = strlen( $row[$blobcol] ) > 4000 ) )
      +                        while( ( $len = mb_strlen( $row[$blobcol] ) > 2000 ) )
                               {
      -                            $insert .= "dbms_lob.writeappend(v_$blobcol, 4000, '" . $this->escapeSQLString( substr( $row[$blobcol], 0, 4000 ) ). "');\n";
      -                            $row[$blobcol] = substr( $row[$blobcol], 4000 );
      +                            $insert .= "dbms_lob.writeappend(v_$blobcol, 2000, '" . $this->escapeSQLString( mb_substr( $row[$blobcol], 0, 2000 ) ). "');\n";
      +                            $row[$blobcol] = mb_substr( $row[$blobcol], 2000 );
                               }
      -                        $insert .= "dbms_lob.writeappend(v_$blobcol, " . strlen( $row[$blobcol] ) . ", '" . $this->escapeSQLString( $row[$blobcol] ) . "');\n";
      +                        $insert .= "dbms_lob.writeappend(v_$blobcol, " . mb_strlen( $row[$blobcol] ) . ", '" . $this->escapeSQLString( $row[$blobcol] ) . "');\n";
                           }
                           $insert .= "COMMIT;\nEND;"; // plsql does not parse with final ';' anyway
                           $sqlList[] = $insert;
      
      

      Attachments

        Activity

          People

            unknown unknown
            27baafe9-fa89-4e4f-9302-199c157530db@accounts.ibexa.co ez service
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: