Derby
  1. Derby
  2. DERBY-720

Calling SYSCS_INPLACE_COMPRESS_TABLE on a synonym or a temp table results in a NullPointerException

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 10.1.2.1
    • Fix Version/s: None
    • Component/s: Store
    • Environment:
      sane mode
    • Urgency:
      Normal
    • Issue & fix info:
      Repro attached

      Description

      ij> create synonym fred for barney;
      0 rows inserted/updated/deleted
      WARNING 01522: The newly defined synonym 'FRED' resolved to the object 'APP.BARN
      EY' which is currently undefined.
      ij> call SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE('APP', 'FRED', 1, 1, 1);
      ERROR 38000: The exception 'java.lang.NullPointerException' was thrown while eva
      luating an expression.
      ERROR XJ001: Java exception: ': java.lang.NullPointerException'.

      Also seems to occur if the table behind the synonym does exist.

      1. w.sql
        0.3 kB
        Rick Hillegas

        Activity

        Hide
        Daniel John Debrunner added a comment -

        ij> autocommit off;
        ij> declare global temporary table t2(c21 int) not logged;
        0 rows inserted/updated/deleted
        ij> insert into t2 values 2,3,4,5;
        ERROR 42X05: Table 'T2' does not exist.
        ij> insert into session.t2 values 2,3,4,5;
        4 rows inserted/updated/deleted
        ij> select * from session.t2;
        C21
        -----------
        2
        3
        4
        5

        4 rows selected
        ij> call SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE('SESSION', 'T2', 1, 1, 1);
        ERROR 38000: The exception 'java.lang.NullPointerException' was thrown while eva
        luating an expression.
        ERROR XJ001: Java exception: ': java.lang.NullPointerException'.

        Show
        Daniel John Debrunner added a comment - ij> autocommit off; ij> declare global temporary table t2(c21 int) not logged; 0 rows inserted/updated/deleted ij> insert into t2 values 2,3,4,5; ERROR 42X05: Table 'T2' does not exist. ij> insert into session.t2 values 2,3,4,5; 4 rows inserted/updated/deleted ij> select * from session.t2; C21 ----------- 2 3 4 5 4 rows selected ij> call SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE('SESSION', 'T2', 1, 1, 1); ERROR 38000: The exception 'java.lang.NullPointerException' was thrown while eva luating an expression. ERROR XJ001: Java exception: ': java.lang.NullPointerException'.
        Hide
        Daniel John Debrunner added a comment -

        For VTI tables I followed the mode for views and the compress code ignores them.
        I modified the code to use a switch statement and ignore views and vti tables.

        Didn't want to fix this bug by ignoring synoymns and temp tables because maybe it's not the correct approach, maybe the table under the synoymns should be compressed and the temp table compressed.

        Though maybe a good short term, easy, soution is to ignore synonyms and temp tables.

        Show
        Daniel John Debrunner added a comment - For VTI tables I followed the mode for views and the compress code ignores them. I modified the code to use a switch statement and ignore views and vti tables. Didn't want to fix this bug by ignoring synoymns and temp tables because maybe it's not the correct approach, maybe the table under the synoymns should be compressed and the temp table compressed. Though maybe a good short term, easy, soution is to ignore synonyms and temp tables.
        Hide
        Suresh Thalamati added a comment -

        derby-365 might be a duplicate of this issue.

        Show
        Suresh Thalamati added a comment - derby-365 might be a duplicate of this issue.
        Hide
        Satheesh Bandaram added a comment -

        I think Derby shouldn't allow compress on synonyms... Synonym usage is valid only in DML operations. If no one objects, I can make compress ignore synonyms, like views. While I am there, I can also make it ignore temp. tables... This may be a good (short term) solution.

        I will also mark Derby-365 a duplicate of this bug.

        Show
        Satheesh Bandaram added a comment - I think Derby shouldn't allow compress on synonyms... Synonym usage is valid only in DML operations. If no one objects, I can make compress ignore synonyms, like views. While I am there, I can also make it ignore temp. tables... This may be a good (short term) solution. I will also mark Derby-365 a duplicate of this bug.
        Hide
        Mamta A. Satoor added a comment -

        By following the examples provided in this jira entry, I couldn't get the npe for synonym but still get it for global temp table. Even for synonym, I am not sure if we are just skipping the code as suggested by Satheesh(seems like that might be the right thing for synonyms based on Satheesh's comment above). If nothing else, the issue definitely needs further looking into for global temporary tables.

        Show
        Mamta A. Satoor added a comment - By following the examples provided in this jira entry, I couldn't get the npe for synonym but still get it for global temp table. Even for synonym, I am not sure if we are just skipping the code as suggested by Satheesh(seems like that might be the right thing for synonyms based on Satheesh's comment above). If nothing else, the issue definitely needs further looking into for global temporary tables.
        Hide
        Rick Hillegas added a comment -

        Attaching repro, w.sql.

        Show
        Rick Hillegas added a comment - Attaching repro, w.sql.
        Hide
        Rick Hillegas added a comment -

        Triaged for 10.5.3: assigned normal urgency and marked "repro attached".

        Show
        Rick Hillegas added a comment - Triaged for 10.5.3: assigned normal urgency and marked "repro attached".

          People

          • Assignee:
            Unassigned
            Reporter:
            Daniel John Debrunner
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:

              Development