Uploaded image for project: 'MariaDB Connector/J'
  1. MariaDB Connector/J
  2. CONJ-348

Could not read resultset: unexpected end of stream, read 0 bytes from 4

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Critical
    • Resolution: Not a Bug
    • Affects Version/s: 1.3.7, 1.4.6, 1.5.2
    • Fix Version/s: N/A
    • Component/s: Other
    • Labels:
      None
    • Environment:
      Client: OS X 10.11.6 with Oracle Java 1.8.0_102
      Server: Oracle Linux 6.8 (x64) running MariaDB 10.1.16
        

      Description

      Observed behavior:
      The attached UnexpectedEndOfStreamError class fails with following:

      Exception in thread "main" java.sql.SQLNonTransientConnectionException: Could not read resultset: unexpected end of stream, read 0 bytes from 4
      Query is: SELECT a.AID FROM A a WHERE EXISTS (SELECT 1 FROM V v WHERE a.AID = v.AID)
      at org.mariadb.jdbc.internal.util.ExceptionMapper.get(ExceptionMapper.java:123)
      at org.mariadb.jdbc.internal.util.ExceptionMapper.throwException(ExceptionMapper.java:69)
      at org.mariadb.jdbc.MariaDbStatement.executeQueryEpilog(MariaDbStatement.java:226)
      at org.mariadb.jdbc.MariaDbServerPreparedStatement.executeInternal(MariaDbServerPreparedStatement.java:376)
      at org.mariadb.jdbc.MariaDbServerPreparedStatement.execute(MariaDbServerPreparedStatement.java:323)
      at org.mariadb.jdbc.MariaDbServerPreparedStatement.executeQuery(MariaDbServerPreparedStatement.java:304)
      at UnexpectedEndOfStreamError.executeTestQuery(UnexpectedEndOfStreamError.java:56)
      at UnexpectedEndOfStreamError.runTest(UnexpectedEndOfStreamError.java:49)
      at UnexpectedEndOfStreamError.main(UnexpectedEndOfStreamError.java:28)
      Caused by: org.mariadb.jdbc.internal.util.dao.QueryException: Could not read resultset: unexpected end of stream, read 0 bytes from 4
      Query is: SELECT a.AID FROM A a WHERE EXISTS (SELECT 1 FROM V v WHERE a.AID = v.AID)
      at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.getResult(AbstractQueryProtocol.java:1054)
      at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.prepareAndExecute(AbstractQueryProtocol.java:544)
      at org.mariadb.jdbc.MariaDbServerPreparedStatement.executeInternal(MariaDbServerPreparedStatement.java:365)
      ... 5 more
      Caused by: java.io.EOFException: unexpected end of stream, read 0 bytes from 4
      at org.mariadb.jdbc.internal.packet.read.ReadPacketFetcher.getReusableBuffer(ReadPacketFetcher.java:164)
      at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.getResult(AbstractQueryProtocol.java:1045)
      ... 7 more

      The code runs without issues when using MySQL Connector/J 5.1.39 and MariaDB Connector/J version 1.2.3 and 1.1.9.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              diego dupin Diego Dupin
              Reporter:
              jwa_66061 Juraj Wagner
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: