Derby
  1. Derby
  2. DERBY-5409

GrantRevokeDDLTest fails under Java 7

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 10.9.1.0
    • Fix Version/s: 10.8.2.2, 10.9.1.0
    • Component/s: SQL
    • Labels:
      None
    • Bug behavior facts:
      Regression Test Failure

      Description

      With my last "svn up " I see the following failure when I run with Java
      7 (not with 6), sane classes or sane jars (I didn't test insane), on
      Solaris 11.

      It seems the recent checkin 1167226 introduced this failure.

      Caveat, there are knows issues with the first Java 7 release. If it
      looks mysterious, we could wait till the update release is available to
      track this down..

      ----------------------------------------------------------
      > derbyjunit GrantRevokeDDLTest
      ------------------ Java Information ------------------
      Java Version: 1.7.0
      Java Vendor: Oracle Corporation
      Java home: /usr/jdk/instances/jdk1.7.0-b147/jre
      Java classpath: /export/home/dag/java/sb/sb1/classes:/usr/local/share/java/db2jcc/lib/db2jcc.jar:/usr/local/share/java/db2jcc/lib/db2jcc_license_c.jar:/export/home/dag/java/sb/sb1/tools/java/jakarta-oro-2.0.8.jar:/export/home/dag/java/sb/sb1/tools/java/jdbc2_0-stdext.jar:/export/home/dag/java/sb/sb1/tools/java/junit.jar:/export/home/dag/java/sb/sb1/tools/java/jce1_2_2.jar:/export/home/dag/java/sb/sb1/tools/java/xalan.jar:/export/home/dag/java/sb/sb1/tools/java/serializer.jar:/export/home/dag/java/sb/sb1/tools/java/xercesImpl.jar
      OS name: SunOS
      OS architecture: x86
      OS version: 5.11
      Java user name: dag
      Java user home: /export/home/dag
      Java user dir: /export/home/dag/java/sb/tests/derby-5363-full-1-lang.GrantRevokeDDLTest-sb.sb1.classes-1.7.0-12870
      java.specification.name: Java Platform API Specification
      java.specification.version: 1.7
      java.runtime.version: 1.7.0-b147
      --------- Derby Information --------
      JRE - JDBC: ?-?
      [/export/home/dag/java/sb/sb1/classes] 10.9.0.0 alpha - (1169692M)
      ------------------------------------------------------
      ----------------- Locale Information -----------------
      Current Locale : [English/United States [en_US]]
      Found support for locale: [cs]
      version: 10.9.0.0 alpha - (1169692M)
      Found support for locale: [de_DE]
      version: 10.9.0.0 alpha - (1169692M)
      Found support for locale: [es]
      version: 10.9.0.0 alpha - (1169692M)
      Found support for locale: [fr]
      version: 10.9.0.0 alpha - (1169692M)
      Found support for locale: [hu]
      version: 10.9.0.0 alpha - (1169692M)
      Found support for locale: [it]
      version: 10.9.0.0 alpha - (1169692M)
      Found support for locale: [ja_JP]
      version: 10.9.0.0 alpha - (1169692M)
      Found support for locale: [ko_KR]
      version: 10.9.0.0 alpha - (1169692M)
      Found support for locale: [pl]
      version: 10.9.0.0 alpha - (1169692M)
      Found support for locale: [pt_BR]
      version: 10.9.0.0 alpha - (1169692M)
      Found support for locale: [ru]
      version: 10.9.0.0 alpha - (1169692M)
      Found support for locale: [zh_CN]
      version: 10.9.0.0 alpha - (1169692M)
      Found support for locale: [zh_TW]
      version: 10.9.0.0 alpha - (1169692M)
      ------------------------------------------------------
      java -client -Xms128M -Xmx512M -XX:MaxPermSize=192m -DderbyTesting.oldReleasePath=/usr/local/share/java/derby/lib-debug junit.textui.TestRunner org.apache.derbyTesting.functionTests.tests.lang.GrantRevokeDDLTest
      .....F.E..
      Time: 9.37
      There was 1 error:
      1) testGrantRevokeDDL2(org.apache.derbyTesting.functionTests.tests.lang.GrantRevokeDDLTest)java.sql.SQLException: Schema 'USER1' already exists.
      at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:98)
      at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Util.java:256)
      at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:400)
      at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:348)
      at org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:2290)
      at org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:82)
      at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1334)
      at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:630)
      at org.apache.derby.impl.jdbc.EmbedStatement.executeUpdate(EmbedStatement.java:179)
      at org.apache.derbyTesting.functionTests.tests.lang.GrantRevokeDDLTest.testGrantRevokeDDL2(GrantRevokeDDLTest.java:6540)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:113)
      at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
      at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
      at junit.extensions.TestSetup.run(TestSetup.java:25)
      at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
      at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
      at junit.extensions.TestSetup.run(TestSetup.java:25)
      at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)
      at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
      at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
      at junit.extensions.TestSetup.run(TestSetup.java:25)
      at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)
      at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
      at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
      at junit.extensions.TestSetup.run(TestSetup.java:25)
      at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
      at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
      at junit.extensions.TestSetup.run(TestSetup.java:25)
      at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)
      at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
      at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
      at junit.extensions.TestSetup.run(TestSetup.java:25)
      at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)
      at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
      at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
      at junit.extensions.TestSetup.run(TestSetup.java:25)
      at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
      at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
      at junit.extensions.TestSetup.run(TestSetup.java:25)
      Caused by: java.sql.SQLException: Schema 'USER1' already exists.
      at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45)
      at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(SQLExceptionFactory40.java:122)
      at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:71)
      ... 61 more
      Caused by: ERROR X0Y68: Schema 'USER1' already exists.
      at org.apache.derby.iapi.error.StandardException.newException(StandardException.java:295)
      at org.apache.derby.impl.sql.execute.CreateSchemaConstantAction.executeConstantActionMinion(CreateSchemaConstantAction.java:138)
      at org.apache.derby.impl.sql.execute.CreateSchemaConstantAction.executeConstantAction(CreateSchemaConstantAction.java:104)
      at org.apache.derby.impl.sql.execute.MiscResultSet.open(MiscResultSet.java:61)
      at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(GenericPreparedStatement.java:436)
      at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:317)
      at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1242)
      ... 55 more
      There was 1 failure:
      1) testGrantRevokeDDL(org.apache.derbyTesting.functionTests.tests.lang.GrantRevokeDDLTest)junit.framework.AssertionFailedError: Column value mismatch @ column 'SCHEMANAME', row 4:
      Expected: >SATHEESH<
      Found: >USER1<
      at org.apache.derbyTesting.junit.JDBC.assertRowInResultSet(JDBC.java:1213)
      at org.apache.derbyTesting.junit.JDBC.assertRowInResultSet(JDBC.java:1125)
      at org.apache.derbyTesting.junit.JDBC.assertFullResultSetMinion(JDBC.java:1012)
      at org.apache.derbyTesting.junit.JDBC.assertFullResultSet(JDBC.java:935)
      at org.apache.derbyTesting.junit.JDBC.assertFullResultSet(JDBC.java:892)
      at org.apache.derbyTesting.functionTests.tests.lang.GrantRevokeDDLTest.testGrantRevokeDDL(GrantRevokeDDLTest.java:397)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:113)
      at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
      at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
      at junit.extensions.TestSetup.run(TestSetup.java:25)
      at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
      at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
      at junit.extensions.TestSetup.run(TestSetup.java:25)
      at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)
      at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
      at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
      at junit.extensions.TestSetup.run(TestSetup.java:25)
      at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)
      at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
      at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
      at junit.extensions.TestSetup.run(TestSetup.java:25)
      at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
      at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
      at junit.extensions.TestSetup.run(TestSetup.java:25)
      at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)
      at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
      at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
      at junit.extensions.TestSetup.run(TestSetup.java:25)
      at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)
      at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
      at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
      at junit.extensions.TestSetup.run(TestSetup.java:25)
      at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
      at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
      at junit.extensions.TestSetup.run(TestSetup.java:25)

      FAILURES!!!
      Tests run: 8, Failures: 1, Errors: 1

      Log /export/home/dag/java/sb/tests/derby-5363-full-1-lang.GrantRevokeDDLTest-sb.sb1.classes-1.7.0-12870/test.log
      dag@T61pOS:~/java/sb/sb1$

      1. d5409.diff
        3 kB
        Knut Anders Hatlen

        Activity

        Hide
        Dag H. Wanvik added a comment - - edited

        Interestingly, if I remove the java -client flag, the test passes. This suggests this may not be a Derby bug.

        Show
        Dag H. Wanvik added a comment - - edited Interestingly, if I remove the java -client flag, the test passes. This suggests this may not be a Derby bug.
        Hide
        Knut Anders Hatlen added a comment -

        This happens if one of the test cases testAlterTablePrivilegesIntace() or testAlterTableWithPrivileges() is executed before testGrantRevokeDDL(), and it probably only works because on Java 6 and earlier the test cases are usually (but not always) executed in the order in which they appear in the source. On Java 7, the order is less predictable.

        Show
        Knut Anders Hatlen added a comment - This happens if one of the test cases testAlterTablePrivilegesIntace() or testAlterTableWithPrivileges() is executed before testGrantRevokeDDL(), and it probably only works because on Java 6 and earlier the test cases are usually (but not always) executed in the order in which they appear in the source. On Java 7, the order is less predictable.
        Hide
        Knut Anders Hatlen added a comment -

        The attached patch makes the test cases testAlterTablePrivilegesIntace() and testAlterTableWithPrivileges() drop the schemas USER1 and USER2 when they're done, so that these schemas don't unexpectedly turn up in queries executed by the other test cases.

        Show
        Knut Anders Hatlen added a comment - The attached patch makes the test cases testAlterTablePrivilegesIntace() and testAlterTableWithPrivileges() drop the schemas USER1 and USER2 when they're done, so that these schemas don't unexpectedly turn up in queries executed by the other test cases.
        Hide
        Knut Anders Hatlen added a comment -

        Committed revision 1170470.

        Show
        Knut Anders Hatlen added a comment - Committed revision 1170470.
        Hide
        Dag H. Wanvik added a comment -

        Thanks, Knut. Closing.

        Show
        Dag H. Wanvik added a comment - Thanks, Knut. Closing.
        Hide
        Myrna van Lunteren added a comment -

        Mamta just backported the changes of revision 1167226, so I assume these changes now need to be backported too...

        Show
        Myrna van Lunteren added a comment - Mamta just backported the changes of revision 1167226, so I assume these changes now need to be backported too...
        Hide
        Myrna van Lunteren added a comment -

        I couldn't reproduce the problem with the version of jdk 1.7 on my system
        (Java(TM) SE Runtime Environment (build 1.7.0-b147)), but I backported the change and the test still passes.
        committed with revision 1179724 to 10.8 branch.

        Show
        Myrna van Lunteren added a comment - I couldn't reproduce the problem with the version of jdk 1.7 on my system (Java(TM) SE Runtime Environment (build 1.7.0-b147)), but I backported the change and the test still passes. committed with revision 1179724 to 10.8 branch.
        Hide
        Mamta A. Satoor added a comment -

        Thanks for backporting this to 10.8,Myrna. You probably didn't run into it before the backport because the order in which tests get picked from the junit test are unpredictable.

        Show
        Mamta A. Satoor added a comment - Thanks for backporting this to 10.8,Myrna. You probably didn't run into it before the backport because the order in which tests get picked from the junit test are unpredictable.

          People

          • Assignee:
            Knut Anders Hatlen
            Reporter:
            Dag H. Wanvik
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development