Derby
  1. Derby
  2. DERBY-2782

10.2 client Stream.java test fails when run against 10.3 with Java exception: 'Reversed byte-order mark: sun.io.MalformedInputException'.

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 10.3.1.4
    • Fix Version/s: None
    • Component/s: JDBC
    • Urgency:
      Normal
    • Issue & fix info:
      Release Note Needed

      Description

      The jdbcapi/Stream.java test run with client and 10.2.1.6 derbyTesting.jar and 10.3 product jars fails with
      Java exception: 'Reversed byte-order mark: sun.io.MalformedInputException'.

      java.sql.SQLException: An unexpected exception was thrown
      at org.apache.derby.client.am.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:46)
      at org.apache.derby.client.am.SqlException.getSQLException(SqlException.java:362)
      at org.apache.derby.client.am.PreparedStatement.executeUpdate(PreparedStatement.java:391)
      at org.apache.derbyTesting.functionTests.tests.jdbcapi.Stream.createLargeClobTestData(Unknown Source)
      at org.apache.derbyTesting.functionTests.tests.jdbcapi.Stream.createTestData(Unknown Source)
      at org.apache.derbyTesting.functionTests.tests.jdbcapi.Stream.createTestTables(Unknown Source)
      at org.apache.derbyTesting.functionTests.tests.jdbcapi.Stream.main(Unknown Source)
      Caused by: org.apache.derby.client.am.SqlException: An unexpected exception was thrown
      at org.apache.derby.client.am.Statement.completeExecute(Statement.java:1498)
      at org.apache.derby.client.net.NetStatementReply.parseEXCSQLSTTreply(NetStatementReply.java:304)
      at org.apache.derby.client.net.NetStatementReply.readExecute(NetStatementReply.java:70)
      at org.apache.derby.client.net.StatementReply.readExecute(StatementReply.java:55)
      at org.apache.derby.client.net.NetPreparedStatement.readExecute_(NetPreparedStatement.java:183)
      at org.apache.derby.client.am.PreparedStatement.readExecute(PreparedStatement.java:1795)
      at org.apache.derby.client.am.PreparedStatement.flowExecute(PreparedStatement.java:2115)
      at org.apache.derby.client.am.PreparedStatement.executeUpdateX(PreparedStatement.java:396)
      at org.apache.derby.client.am.PreparedStatement.executeUpdate(PreparedStatement.java:382)
      ... 4 more
      Caused by: org.apache.derby.client.am.SqlException: Java exception: 'Reversed byte-order mark: sun.io.MalformedInputException'.
      at org.apache.derby.client.am.SqlException.<init>(SqlException.java:290)
      at org.apache.derby.client.am.SqlException.<init>(SqlException.java:264)
      ... 13 more

        Issue Links

          Activity

          Hide
          Kathey Marsden added a comment -

          I am not sure what changed in 10.3, but I question if the test has valid input.
          Here is the read method for the stream. I am not sure that this would always be a valid character. The new test StreamTest uses real characters instead of this cast.
          Does anyone have thoughts on whether cbuf[i] = (char) (wroteLength % 0x10000L) always represents a valid character?

          public int read( char[] cbuf,
          int off,
          int len ){

          if(wroteLength >= total)
          return -1;

          int i;
          for(i = off ;
          i < off + len &&
          wroteLength < total ;
          i++, wroteLength ++)

          { cbuf[i] = (char) (wroteLength % 0x10000L); }

          return i - off;
          }

          Show
          Kathey Marsden added a comment - I am not sure what changed in 10.3, but I question if the test has valid input. Here is the read method for the stream. I am not sure that this would always be a valid character. The new test StreamTest uses real characters instead of this cast. Does anyone have thoughts on whether cbuf [i] = (char) (wroteLength % 0x10000L) always represents a valid character? public int read( char[] cbuf, int off, int len ){ if(wroteLength >= total) return -1; int i; for(i = off ; i < off + len && wroteLength < total ; i++, wroteLength ++) { cbuf[i] = (char) (wroteLength % 0x10000L); } return i - off; }
          Hide
          Rick Hillegas added a comment -

          Triaged for 10.5.2: assigned normal urgency.

          Show
          Rick Hillegas added a comment - Triaged for 10.5.2: assigned normal urgency.

            People

            • Assignee:
              Unassigned
              Reporter:
              Kathey Marsden
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:

                Development