Derby
  1. Derby
  2. DERBY-3999

Can't execute select statement with blob in network server mode

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Cannot Reproduce
    • Affects Version/s: 10.4.2.0
    • Fix Version/s: None
    • Component/s: Network Client
    • Labels:
      None
    • Environment:
      OS - windows xp, Derby - 10.4.2, client jdbc Driver - org.apache.derby.jdbc.ClientDriver()
    • Bug behavior facts:
      Embedded/Client difference

      Description

      When Derby Derby in ServerMode this query raise the java.io.EOFException(in embedded works normally):
      SELECT
      this_.ID as ID11_2_,
      this_.PROTOCOL_ID as PROTOCOL2_11_2_,
      this_.PROTOCOL_NAME as PROTOCOL3_11_2_,
      this_.PROTOCOL_VERSION as PROTOCOL4_11_2_,
      this_.STORAGE as STORAGE11_2_,
      schemavali2_.PROTOCOL_VALIDATION_ID as PROTOCOL4_4_,
      schemavali2_.ID as ID4_,
      schemavali2_.ID as ID12_0_,
      schemavali2_.BINARY_CONTENT as BINARY2_12_0_, – this should be commented to allow normal query execution
      schemavali2_.FILE_NAME as FILE3_12_0_,
      schemavali2_.PROTOCOL_VALIDATION_ID as PROTOCOL4_12_0_,
      validation3_.SCHEMA_VALIDATION_ID as SCHEMA8_5_,
      validation3_.ID as ID5_,
      validation3_.ID as ID13_1_,
      validation3_.IS_IMPORTED as IS2_13_1_,
      validation3_.IMPORTED_FILE_NAME as IMPORTED3_13_1_,
      validation3_.ITEM_TEXT as ITEM4_13_1_,
      validation3_.PROPERTY_NAME as PROPERTY5_13_1_,
      validation3_.RULE_NAME as RULE6_13_1_,
      validation3_.SCHEMA_VALIDATION_ID as SCHEMA8_13_1_,
      validation3_.ISSUE_STATUS as ISSUE7_13_1_
      FROM
      VL_PROTOCOL_VALIDATION this_
      LEFT OUTER JOIN
      VL_SCHEMA_VALIDATION schemavali2_
      ON
      this_.ID=schemavali2_.PROTOCOL_VALIDATION_ID
      LEFT OUTER JOIN
      VL_SCHEMA_VALIDATION_ISSUE validation3_
      ON
      schemavali2_.ID=validation3_.SCHEMA_VALIDATION_ID
      WHERE
      this_.PROTOCOL_NAME='base'

      Tables ddl:
      create table VL_PROTOCOL_VALIDATION (
      ID integer generated always as identity(start with 1, increment by 1) primary key,
      PROTOCOL_ID integer,
      PROTOCOL_NAME varchar(100),
      PROTOCOL_VERSION varchar(100),
      STORAGE varchar(20)
      );

      create table VL_SCHEMA_VALIDATION (
      ID integer generated always as identity(start with 1, increment by 1) primary key,
      PROTOCOL_VALIDATION_ID integer not null references VL_PROTOCOL_VALIDATION(ID),
      FILE_NAME varchar(250),
      BINARY_CONTENT blob
      );

      create table VL_SCHEMA_VALIDATION_ISSUE (
      ID integer generated always as identity(start with 1, increment by 1) primary key,
      SCHEMA_VALIDATION_ID integer not null references VL_SCHEMA_VALIDATION(ID),
      ITEM_TEXT varchar(1000),
      RULE_NAME varchar(100),
      ISSUE_STATUS varchar(10),
      PROPERTY_NAME varchar(100),
      IS_IMPORTED varchar(10),
      IMPORTED_FILE_NAME varchar(250)
      );

      1. log.txt
        5 kB
        Ashitkin Alexander
      2. d3999.sql
        3 kB
        Knut Anders Hatlen

        Activity

        Hide
        Knut Anders Hatlen added a comment -

        Could you also post the stack trace of the EOFException?

        Show
        Knut Anders Hatlen added a comment - Could you also post the stack trace of the EOFException?
        Hide
        Ashitkin Alexander added a comment - - edited

        ok. i will try to trace error, but you shouldn't rely on this.

        Show
        Ashitkin Alexander added a comment - - edited ok. i will try to trace error, but you shouldn't rely on this.
        Hide
        Knut Anders Hatlen added a comment -

        I made a quick attempt on reproducing the exception with the attached script (d3999.sql) which creates the tables and inserts a couple of rows in each of them before the query is executed, but I didn't see any errors. It would be of great help if you could make the necessary changes to the script so that it reproduces the error, or if you post the exact steps needed to trigger the error.

        Show
        Knut Anders Hatlen added a comment - I made a quick attempt on reproducing the exception with the attached script (d3999.sql) which creates the tables and inserts a couple of rows in each of them before the query is executed, but I didn't see any errors. It would be of great help if you could make the necessary changes to the script so that it reproduces the error, or if you post the exact steps needed to trigger the error.
        Hide
        Ashitkin Alexander added a comment - - edited

        I attached a log. The log isn't very useful because it looks like the derby client logs nothing internally (i use log4j ).
        regarding your previous comment - i still can reproduce error, but i investigated an interesting issue:
        query with additional restriction 'and length(schemavali2_.BINARY_CONTENT)<41181' fails,
        but query with restriction 'and length(schemavali2_.BINARY_CONTENT)<41180' works normally.
        I don't know how to explain this. Though, to reproduce the error you need a 50kb blob probably.

        Any suggestions how to trace the error?

        Show
        Ashitkin Alexander added a comment - - edited I attached a log. The log isn't very useful because it looks like the derby client logs nothing internally (i use log4j ). regarding your previous comment - i still can reproduce error, but i investigated an interesting issue: query with additional restriction 'and length(schemavali2_.BINARY_CONTENT)<41181' fails, but query with restriction 'and length(schemavali2_.BINARY_CONTENT)<41180' works normally. I don't know how to explain this. Though, to reproduce the error you need a 50kb blob probably. Any suggestions how to trace the error?
        Hide
        Kristian Waagan added a comment -

        Are there any error messages in the log file 'derby.log' on the server side?
        You could also try to set 'derby.stream.error.logSeverityLevel=0' (restart the server), reproduce the error and then re-check the log file (on the server).

        Show
        Kristian Waagan added a comment - Are there any error messages in the log file 'derby.log' on the server side? You could also try to set 'derby.stream.error.logSeverityLevel=0' (restart the server), reproduce the error and then re-check the log file (on the server).
        Hide
        Ashitkin Alexander added a comment -

        i had tried to set environment variable before server startup:
        "set derby.stream.error.logSeverityLevel=0"
        and to add jvm parameter in server startup script:
        "-Dderby.stream.error.logSeverityLevel=0"

        • but nothing changed. the derby.log the same - no any the error related message.
        Show
        Ashitkin Alexander added a comment - i had tried to set environment variable before server startup: "set derby.stream.error.logSeverityLevel=0" and to add jvm parameter in server startup script: "-Dderby.stream.error.logSeverityLevel=0" but nothing changed. the derby.log the same - no any the error related message.
        Hide
        Kristian Waagan added a comment -

        Thank you.
        Then I suggest we try to create a repro for the error to debug it. Seems Knut Anders has already made a good starting point, and hopefully it can be adjusted to trigger the error. It might be related to the DRDA protocol (off-by-one bug?).

        Btw, I don't think Derby looks at the environment variables (i.e. set using 'set' or 'export'), but setting them on the JVM command line should do. The derby.properties file can also be used.

        Show
        Kristian Waagan added a comment - Thank you. Then I suggest we try to create a repro for the error to debug it. Seems Knut Anders has already made a good starting point, and hopefully it can be adjusted to trigger the error. It might be related to the DRDA protocol (off-by-one bug?). Btw, I don't think Derby looks at the environment variables (i.e. set using 'set' or 'export'), but setting them on the JVM command line should do. The derby.properties file can also be used.
        Hide
        Kathey Marsden added a comment -

        Was there any luck getting a script or java program to reproduce this issue? If not I suggest we close cannot reproduce and then can reopen if a reproduction is discovered.

        Show
        Kathey Marsden added a comment - Was there any luck getting a script or java program to reproduce this issue? If not I suggest we close cannot reproduce and then can reopen if a reproduction is discovered.
        Hide
        Dag H. Wanvik added a comment -

        +1 to close, since we have no repro.

        Show
        Dag H. Wanvik added a comment - +1 to close, since we have no repro.
        Hide
        Dag H. Wanvik added a comment -

        Unchecking "wrong query result", since this issue reports a query that fails, not
        erroneous data.

        Show
        Dag H. Wanvik added a comment - Unchecking "wrong query result", since this issue reports a query that fails, not erroneous data.
        Hide
        Knut Anders Hatlen added a comment -

        Setting resolution to "Cannot Reproduce". If someone finds a way to reproduce this, please reopen.

        Show
        Knut Anders Hatlen added a comment - Setting resolution to "Cannot Reproduce". If someone finds a way to reproduce this, please reopen.

          People

          • Assignee:
            Unassigned
            Reporter:
            Ashitkin Alexander
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development