Derby
  1. Derby
  2. DERBY-5249

A table created with 10.0.2.1 with constraints cannot be dropped with 10.5 due to NullPointerException with insane build or ASSERT FAILED Failed to find sharable conglomerate descriptor for index conglomerate with sane build

    Details

    • Issue & fix info:
      High Value Fix, Workaround attached
    • Bug behavior facts:
      Regression

      Description

      In 10.0.2.1 there was some bug that caused a duplicate entry in sys.sysconglomerates.
      After running the attached repro_create.sql with 10.0.2.1, you will see two rows returned instead of one with:

      select c.constraintname, c.constraintid, cong.conglomerateid, cong.conglomeratename from sys.sysconglomerates cong, sys.syskeys k, sys.sysconstraints c where c.constraintname = 'PK_RS' and c.constraintid =k.constraintid and k.conglomerateid = cong.conglomerateid ;

      I am not sure what practical impact this has with 10.0 as you can still drop the table s.rs with that version.
      On connecting to the database with 10.5, either soft or hard upgrade with 10.5.3.2 - 1103924

      DROP TABLE S.RS fails with:
      Caused by: java.sql.SQLException: Java exception: 'ASSERT FAILED Failed to find
      sharable conglomerate descriptor for index conglomerate # 785: org.apache.derby.
      shared.common.sanity.AssertFailure'.
      at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExc
      eptionFactory.java:45)
      at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransport
      AcrossDRDA(SQLExceptionFactory40.java:119)
      at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLE
      xceptionFactory40.java:70)
      ... 17 more
      Caused by: org.apache.derby.shared.common.sanity.AssertFailure: ASSERT FAILED Fa
      iled to find sharable conglomerate descriptor for index conglomerate # 785
      at org.apache.derby.shared.common.sanity.SanityManager.THROWASSERT(Sanit
      yManager.java:162)
      at org.apache.derby.shared.common.sanity.SanityManager.THROWASSERT(Sanit
      yManager.java:147)
      at org.apache.derby.iapi.sql.dictionary.ConglomerateDescriptor.describeS
      haredConglomerate(ConglomerateDescriptor.java:638)
      at org.apache.derby.iapi.sql.dictionary.ConglomerateDescriptor.drop(Cong
      lomerateDescriptor.java:428)
      at org.apache.derby.iapi.sql.dictionary.ConstraintDescriptor.drop(Constr
      aintDescriptor.java:738)
      at org.apache.derby.impl.sql.execute.DDLSingleTableConstantAction.dropCo
      nstraint(DDLSingleTableConstantAction.java:144)
      at org.apache.derby.impl.sql.execute.DDLSingleTableConstantAction.dropCo
      nstraint(DDLSingleTableConstantAction.java:107)
      at org.apache.derby.impl.sql.execute.DropTableConstantAction.dropAllCons
      traintDescriptors(DropTableConstantAction.java:315)
      at org.apache.derby.impl.sql.execute.DropTableConstantAction.executeCons
      tantAction(DropTableConstantAction.java:222)
      at org.apache.derby.impl.sql.execute.MiscResultSet.open(MiscResultSet.ja
      va:61)
      at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(Generi
      cPreparedStatement.java:416)
      at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPre
      paredStatement.java:297)
      at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedState
      ment.java:1235)
      ... 10 more

      and with an insane build with a NullPointerException:
      java.lang.NullPointerException
      at
      org.apache.derby.iapi.sql.dictionary.ConglomerateDescriptor.drop(Unknown
      Source)
      at
      org.apache.derby.iapi.sql.dictionary.ConstraintDescriptor.drop(Unknown
      Source)
      at
      org.apache.derby.impl.sql.execute.DDLSingleTableConstantAction.dropConst
      raint(Unknown Source)
      at
      org.apache.derby.impl.sql.execute.DDLSingleTableConstantAction.dropConst
      raint(Unknown Source)
      at
      org.apache.derby.impl.sql.execute.DropTableConstantAction.dropAllConstra
      intDescriptors(Unknown Source)
      at
      org.apache.derby.impl.sql.execute.DropTableConstantAction.executeConstan
      tAction(Unknown Source)
      at org.apache.derby.impl.sql.execute.MiscResultSet.open(Unknown
      Source)
      at
      org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(Unknown
      Source)
      at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown
      Source)
      at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown
      Source)
      at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
      at org.apache.derby.impl.jdbc.EmbedStatement.executeUpdate(Unknown
      Source)

      Still need to figure out the exact versions affected, when the dup row was fixed, and when the drop stopped working.

      To reproduce connect to a database with 10.0.2.1
      (can be accessed at http://svn.apache.org/repos/asf/db/derby/jars/10.0.2.1)

      run the attached script repro_create.sql;

      connect with the latest on the trunk or 10.5 branch

      DROP TABLE S.RS;

      The table will not drop. The work around is to drop the table with the old version 10.0.2.1

      1. derby-5249_diff.txt
        3 kB
        Kathey Marsden
      2. my10db.zip
        45 kB
        Kathey Marsden
      3. repro_create.sql
        0.7 kB
        Kathey Marsden
      4. repro_create.sql
        1 kB
        Kathey Marsden

        Issue Links

          Activity

          Kathey Marsden created issue -
          Kathey Marsden made changes -
          Field Original Value New Value
          Attachment repro_create.sql [ 12480706 ]
          Kathey Marsden made changes -
          Summary A table created with 10.0.2.1 with constraints cannot be dropped with 10.5 due to NullPointerException with insane build or SSERT FAILED Failed to find sharable conglomerate descriptor for index conglomerate with sane build A table created with 10.0.2.1 with constraints cannot be dropped with 10.5 due to NullPointerException with insane build or ASSERT FAILED Failed to find sharable conglomerate descriptor for index conglomerate with sane build
          Kathey Marsden made changes -
          Attachment repro_create.sql [ 12480715 ]
          Kathey Marsden made changes -
          Assignee Kathey Marsden [ kmarsden ]
          Kathey Marsden made changes -
          Attachment my10db.zip [ 12481264 ]
          Kathey Marsden made changes -
          Link This issue is related to DERBY-655 [ DERBY-655 ]
          Kathey Marsden made changes -
          Link This issue is related to DERBY-3299 [ DERBY-3299 ]
          Kathey Marsden made changes -
          Link This issue is related to DERBY-1343 [ DERBY-1343 ]
          Kathey Marsden made changes -
          Attachment derby-5249_diff.txt [ 12481350 ]
          Kathey Marsden made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Fix Version/s 10.4.2.1 [ 12313401 ]
          Fix Version/s 10.5.3.2 [ 12315436 ]
          Fix Version/s 10.6.2.3 [ 12315434 ]
          Fix Version/s 10.7.1.4 [ 12315902 ]
          Fix Version/s 10.8.1.4 [ 12316500 ]
          Fix Version/s 10.9.0.0 [ 12316344 ]
          Resolution Fixed [ 1 ]
          Knut Anders Hatlen made changes -
          Fix Version/s 10.8.1.5 [ 12316676 ]
          Fix Version/s 10.8.1.4 [ 12316500 ]
          Myrna van Lunteren made changes -
          Fix Version/s 10.8.2.0 [ 12317955 ]
          Fix Version/s 10.8.1.6 [ 12316676 ]
          Myrna van Lunteren made changes -
          Fix Version/s 10.8.2.2 [ 12317968 ]
          Fix Version/s 10.8.2.0 [ 12317955 ]
          Knut Anders Hatlen made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Gavin made changes -
          Workflow jira [ 12614905 ] Default workflow, editable Closed status [ 12802739 ]

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Development