Derby
  1. Derby
  2. DERBY-1124

DatabaseMetaData.getTablePrivileges fails in soft upgrade mode

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 10.2.1.6
    • Fix Version/s: 10.2.1.6
    • Component/s: JDBC
    • Labels:
      None
    • Environment:
      Soft upgrade from 10.1 to 10.2

      Description

      The stack trace for failure is:

      SQLSTATE(42X05):ERROR 42X05: Table 'SYS.SYSTABLEPERMS' does not exist.
      at org.apache.derby.iapi.error.StandardException.newException(StandardException.java:311)
      at org.apache.derby.impl.sql.compile.FromBaseTable.bindTableDescriptor(FromBaseTable.java:2382)
      at org.apache.derby.impl.sql.compile.FromBaseTable.bindNonVTITables(FromBaseTable.java:2120)
      at org.apache.derby.impl.sql.compile.FromList.bindTables(FromList.java:303)
      at org.apache.derby.impl.sql.compile.SelectNode.bindNonVTITables(SelectNode.java:472)
      at org.apache.derby.impl.sql.compile.DMLStatementNode.bindTables(DMLStatementNode.java:220)
      at org.apache.derby.impl.sql.compile.DMLStatementNode.bind(DMLStatementNode.java:158)
      at org.apache.derby.impl.sql.compile.CursorNode.bind(CursorNode.java:252)
      at org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:344)
      at org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:118)
      at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(GenericLanguageConnectionContext.java:725)
      at org.apache.derby.impl.jdbc.EmbedPreparedStatement.<init>(EmbedPreparedStatement.java:118)
      at org.apache.derby.impl.jdbc.EmbedPreparedStatement20.<init>(EmbedPreparedStatement20.java:82)
      at org.apache.derby.impl.jdbc.EmbedPreparedStatement30.<init>(EmbedPreparedStatement30.java:62)
      at org.apache.derby.jdbc.Driver30.newEmbedPreparedStatement(Driver30.java:92)
      at org.apache.derby.impl.jdbc.EmbedConnection.prepareMetaDataStatement(EmbedConnection.java:1645)
      at org.apache.derby.impl.jdbc.EmbedDatabaseMetaData.getPreparedQuery(EmbedDatabaseMetaData.java:3172)
      at org.apache.derby.impl.jdbc.EmbedDatabaseMetaData.getTablePrivileges(EmbedDatabaseMetaData.java:1841)
      at org.apache.derbyTesting.functionTests.tests.jdbcapi.metadata.getMetaDataRS(metadata.java:116)
      at org.apache.derbyTesting.functionTests.tests.jdbcapi.metadata_test.runTest(metadata_test.java:764)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.apache.derbyTesting.upgradeTests.UpgradeTester.runMetadataTest(UpgradeTester.java:388)
      at org.apache.derbyTesting.upgradeTests.UpgradeTester.runPhase(UpgradeTester.java:218)
      at org.apache.derbyTesting.upgradeTests.UpgradeTester.runUpgradeTests(UpgradeTester.java:192)
      at org.apache.derbyTesting.upgradeTests.UpgradeTester.main(UpgradeTester.java:521)

      I got this exception when I ran the metadata test after soft upgrade from 10.1 to 10.2 codeline. I ran the metadata test by commenting out the call to getColumnPrivileges which has a similar problem reported in DERBY-1120.

      1. Derby1120_1124
        5 kB
        Satheesh Bandaram

        Issue Links

          Activity

          Hide
          Satheesh Bandaram added a comment -

          Verified the fix by trying getTablePrivileges and getColumnPrivileges API calls in soft upgrade mode.

          Show
          Satheesh Bandaram added a comment - Verified the fix by trying getTablePrivileges and getColumnPrivileges API calls in soft upgrade mode.
          Hide
          Satheesh Bandaram added a comment -

          Fix merged into trunk.

          Show
          Satheesh Bandaram added a comment - Fix merged into trunk.
          Hide
          Satheesh Bandaram added a comment -

          You are right... It doesn't... checkVersion is looking for minimum version of 10_2... not actual match. I will rewrite the check.

          Show
          Satheesh Bandaram added a comment - You are right... It doesn't... checkVersion is looking for minimum version of 10_2... not actual match. I will rewrite the check.
          Hide
          Daniel John Debrunner added a comment -

          Why would the condition change?

          Show
          Daniel John Debrunner added a comment - Why would the condition change?
          Hide
          Satheesh Bandaram added a comment -

          I can change it... but my only concern was what will happen when we move to 10.3? Someone has to go change the condition? The way it is would work even after DD version is bumped to 10.3... which should be pretty soon, after we branch 10.2?

          Show
          Satheesh Bandaram added a comment - I can change it... but my only concern was what will happen when we move to 10.3? Someone has to go change the condition? The way it is would work even after DD version is bumped to 10.3... which should be pretty soon, after we branch 10.2?
          Hide
          Daniel John Debrunner added a comment -

          Might be better to have a single version check:

          + if (!dd.checkVersion(DataDictionary.DD_VERSION_DERBY_10_2, null))

          { // If we are before 10.2 then use specific queries blah blah }
          Show
          Daniel John Debrunner added a comment - Might be better to have a single version check: + if (!dd.checkVersion(DataDictionary.DD_VERSION_DERBY_10_2, null)) { // If we are before 10.2 then use specific queries blah blah }
          Hide
          Satheesh Bandaram added a comment -

          Tested the fix by attempting soft upgrade from 10.1 database to 10.2 and attempting to get columnPrivileges and tablePrivileges. This fix should address both DERBY-1120 and DERBY-1124. I will close DERBY-1120 as duplicate of DERBY-1124.

          Let me know if anyone have any comments. I will submit it later today.

          Show
          Satheesh Bandaram added a comment - Tested the fix by attempting soft upgrade from 10.1 database to 10.2 and attempting to get columnPrivileges and tablePrivileges. This fix should address both DERBY-1120 and DERBY-1124 . I will close DERBY-1120 as duplicate of DERBY-1124 . Let me know if anyone have any comments. I will submit it later today.
          Hide
          Satheesh Bandaram added a comment -

          Both DERBY-1120 and DERBY-1124 are reporting essentially same problem... How to make metadata queries that reference new catalogs or new columns in catalog work in soft-upgrade mode. Not sure if this problem was seen in previous releases (as no major catalog changes were made, as far as I know), but Derby needs to solve this problem now as Grant & Revoke has added 4 new system catalogs.

          Show
          Satheesh Bandaram added a comment - Both DERBY-1120 and DERBY-1124 are reporting essentially same problem... How to make metadata queries that reference new catalogs or new columns in catalog work in soft-upgrade mode. Not sure if this problem was seen in previous releases (as no major catalog changes were made, as far as I know), but Derby needs to solve this problem now as Grant & Revoke has added 4 new system catalogs.
          Hide
          Deepa Remesh added a comment -

          I have opened DERBY-1124 for the soft upgrade problem I found in getTablePrivileges query.

          To check whether there are any other problems after soft upgrade, I ran metadata test by commenting out the problem queries (getColumnPrivileges and getTablePrivileges). I did not see any other issues.

          Show
          Deepa Remesh added a comment - I have opened DERBY-1124 for the soft upgrade problem I found in getTablePrivileges query. To check whether there are any other problems after soft upgrade, I ran metadata test by commenting out the problem queries (getColumnPrivileges and getTablePrivileges). I did not see any other issues.

            People

            • Assignee:
              Satheesh Bandaram
              Reporter:
              Deepa Remesh
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development