Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 10.6.1.0
    • Component/s: Test
    • Labels:
      None
    • Issue & fix info:
      Newcomer

      Description

      conversion of inbetween.sql to JUNIT

      1. ASF.LICENSE.NOT.GRANTED--InbetweenTest.diff
        312 kB
        Eranda Sooriyabandara
      2. ASF.LICENSE.NOT.GRANTED--InbetweenTest.diff
        314 kB
        Eranda Sooriyabandara
      3. ASF.LICENSE.NOT.GRANTED--InbetweenTest.diff
        314 kB
        Eranda Sooriyabandara
      4. ASF.LICENSE.NOT.GRANTED--InbetweenTest.diff
        315 kB
        Eranda Sooriyabandara
      5. ASF.LICENSE.NOT.GRANTED--InbetweenTest.diff
        325 kB
        Eranda Sooriyabandara
      6. ASF.LICENSE.NOT.GRANTED--InbetweenTest.diff
        158 kB
        Eranda Sooriyabandara
      7. ASF.LICENSE.NOT.GRANTED--inbetween.junit
        160 kB
        Eranda Sooriyabandara

        Activity

        Hide
        Eranda Sooriyabandara added a comment -

        Hi Bryan,Thanks for committing this issue and I am closing it.

        Show
        Eranda Sooriyabandara added a comment - Hi Bryan,Thanks for committing this issue and I am closing it.
        Hide
        Bryan Pendleton added a comment -

        I verified that the new test runs correctly in both a standalone test run
        as well as within the entire regression suite. My regression test runs
        were clean, and I've committed the patch to the trunk as svn revision 805275.

        Eranda, thanks very much for all the work on this issue, and for contributing it to Derby!

        Show
        Bryan Pendleton added a comment - I verified that the new test runs correctly in both a standalone test run as well as within the entire regression suite. My regression test runs were clean, and I've committed the patch to the trunk as svn revision 805275. Eranda, thanks very much for all the work on this issue, and for contributing it to Derby!
        Hide
        Bryan Pendleton added a comment -

        Thanks Eranda, this is great!

        I will try to review the patch soon.

        Show
        Bryan Pendleton added a comment - Thanks Eranda, this is great! I will try to review the patch soon.
        Hide
        Eranda Sooriyabandara added a comment -

        Hi Bryan,I completed the comparing and did some changes, add some comments
        and delete repeated codes. If you think test is alright we can commit it as
        a patch.
        Thanks

        Show
        Eranda Sooriyabandara added a comment - Hi Bryan,I completed the comparing and did some changes, add some comments and delete repeated codes. If you think test is alright we can commit it as a patch. Thanks
        Hide
        Eranda Sooriyabandara added a comment -

        Hi Bryan,
        Thanks for the help. Here I make as you tell and now I am comparing the test
        with the inbetween.out file.

        Show
        Eranda Sooriyabandara added a comment - Hi Bryan, Thanks for the help. Here I make as you tell and now I am comparing the test with the inbetween.out file.
        Hide
        Bryan Pendleton added a comment -

        With the statementCacheSize set to 0, we get a cleaner run, but we still find
        16 dependencies when the IJ-based test finds only 2.

        I looked into the dependencies in more detail, and there are 2 in-memory
        dependencies found, and 14 stored dependencies.

        The stored dependencies have to do with StoredPreparedStatement instances
        for the various system catalogs (SYSALIASES, SYSSCHEMAS, etc.)

        The in-memory dependencies are for the call to CONSISTENCYCHECKER itself,
        and for a separate call to SYSCS_SET_RUNTIMESTATISTICS which occurs
        later in the test.

        I wonder if the IJ test harness ran this test in such a way that there were
        no stored dependencies printed, but when we run it as a JUnit test we
        get the stored dependencies.

        I'm not actually sure what this test is trying to achieve by running the ConsistencyChecker.

        Here's two possible ideas:
        1) Change the test so that the expected output includes the actual number of
        dependencies we find, even though that's a different number than we got
        with the old IJ-based test. (we get 16 depedencies the first time, 18 the second time)
        2) Change the test to just check the number of open scans, and not count the
        number of dependencies at all.

        Does anybody else (Rick?) know why this test was calling the ConsistencyChecker
        and whether the number of dependencies that we found is important or not?

        Show
        Bryan Pendleton added a comment - With the statementCacheSize set to 0, we get a cleaner run, but we still find 16 dependencies when the IJ-based test finds only 2. I looked into the dependencies in more detail, and there are 2 in-memory dependencies found, and 14 stored dependencies. The stored dependencies have to do with StoredPreparedStatement instances for the various system catalogs (SYSALIASES, SYSSCHEMAS, etc.) The in-memory dependencies are for the call to CONSISTENCYCHECKER itself, and for a separate call to SYSCS_SET_RUNTIMESTATISTICS which occurs later in the test. I wonder if the IJ test harness ran this test in such a way that there were no stored dependencies printed, but when we run it as a JUnit test we get the stored dependencies. I'm not actually sure what this test is trying to achieve by running the ConsistencyChecker. Here's two possible ideas: 1) Change the test so that the expected output includes the actual number of dependencies we find, even though that's a different number than we got with the old IJ-based test. (we get 16 depedencies the first time, 18 the second time) 2) Change the test to just check the number of open scans, and not count the number of dependencies at all. Does anybody else (Rick?) know why this test was calling the ConsistencyChecker and whether the number of dependencies that we found is important or not?
        Hide
        Bryan Pendleton added a comment -

        The DERBY-2341 comment was a red herring.

        The optional 4th parameter to DatabasePropertyTestSetup.singleProperty() needs to
        be set to 'true' for parameters which require a database reboot after being set.

        So I changed

        suite.addTest(DatabasePropertyTestSetup.singleProperty(
        TestConfiguration.defaultSuite(InbetweenTest.class),
        "derby.language.statementCacheSize", "0"));

        to

        suite.addTest(DatabasePropertyTestSetup.singleProperty(
        TestConfiguration.defaultSuite(InbetweenTest.class),
        "derby.language.statementCacheSize", "0",true));

        And now I can see that the tests are being run with statementCacheSize == 0.

        Show
        Bryan Pendleton added a comment - The DERBY-2341 comment was a red herring. The optional 4th parameter to DatabasePropertyTestSetup.singleProperty() needs to be set to 'true' for parameters which require a database reboot after being set. So I changed suite.addTest(DatabasePropertyTestSetup.singleProperty( TestConfiguration.defaultSuite(InbetweenTest.class), "derby.language.statementCacheSize", "0")); to suite.addTest(DatabasePropertyTestSetup.singleProperty( TestConfiguration.defaultSuite(InbetweenTest.class), "derby.language.statementCacheSize", "0",true)); And now I can see that the tests are being run with statementCacheSize == 0.
        Hide
        Bryan Pendleton added a comment -

        The DatabasePropertyTestSetup code isn't working. The statement cache is getting set
        to a size of 100 before the setup code sets the property to 0.

        This seems like it might be related to DERBY-2341, which is marked closed, but which
        may have not been completely fixed?

        I'll study this further to see if I can understand how this is supposed to work.

        Show
        Bryan Pendleton added a comment - The DatabasePropertyTestSetup code isn't working. The statement cache is getting set to a size of 100 before the setup code sets the property to 0. This seems like it might be related to DERBY-2341 , which is marked closed, but which may have not been completely fixed? I'll study this further to see if I can understand how this is supposed to work.
        Hide
        Eranda Sooriyabandara added a comment -

        Hi Bryan,Here is my latest patch. While you study the test I can work on
        break into several methods.
        Thanks

        Show
        Eranda Sooriyabandara added a comment - Hi Bryan,Here is my latest patch. While you study the test I can work on break into several methods. Thanks
        Hide
        Bryan Pendleton added a comment -

        I think that the maximumdisplaywidth is only needed for ij-based tests, not for JUnit tests, so
        you should be able to simply delete that part from your new test.

        I don't understand the problem about the ConsistencyChecker finding the wrong number
        of dependencies. I shall have to study it more.

        If you can prepare a patch which has all of the other issues resolved, and just has the
        number-of-dependencies problem remaining, then it would be great to post that patch
        so that I can have a look at it.

        Show
        Bryan Pendleton added a comment - I think that the maximumdisplaywidth is only needed for ij-based tests, not for JUnit tests, so you should be able to simply delete that part from your new test. I don't understand the problem about the ConsistencyChecker finding the wrong number of dependencies. I shall have to study it more. If you can prepare a patch which has all of the other issues resolved, and just has the number-of-dependencies problem remaining, then it would be great to post that patch so that I can have a look at it.
        Hide
        Eranda Sooriyabandara added a comment -

        Hi Bryan,Is it correct and appropriate to use the codes in my previous 3
        comments?
        And I still have a problem with the code,
        if(usingEmbedded()){
        rs = st.executeQuery(
        "values ConsistencyChecker()");

        expColNames = new String []

        {"1"}

        ;
        JDBC.assertColumnNames(rs, expColNames);

        expRS = new String [][]
        {

        {"No open scans, etc"}

        ,

        {"30 dependencies found"}

        };

        JDBC.assertFullResultSet(rs, expRS, true);
        }

        and I found a unconverted part which includes the sql command,
        maximumdisplaywidth 2000;
        I use the code,
        st.executeUpdate("maximumdisplaywidth 2000");
        But it gave me errors.
        Can you help me a little with this problems.
        Thanks

        Show
        Eranda Sooriyabandara added a comment - Hi Bryan,Is it correct and appropriate to use the codes in my previous 3 comments? And I still have a problem with the code, if(usingEmbedded()){ rs = st.executeQuery( "values ConsistencyChecker()"); expColNames = new String [] {"1"} ; JDBC.assertColumnNames(rs, expColNames); expRS = new String [][] { {"No open scans, etc"} , {"30 dependencies found"} }; JDBC.assertFullResultSet(rs, expRS, true); } and I found a unconverted part which includes the sql command, maximumdisplaywidth 2000; I use the code, st.executeUpdate("maximumdisplaywidth 2000"); But it gave me errors. Can you help me a little with this problems. Thanks
        Hide
        Eranda Sooriyabandara added a comment -

        Hi Bryan,
        I solve the third problem in which the error was a Syntax error.

        before,
        st.executeUpdate(
        " create view v1(c1)"
        + "as"
        + "select c1 from t1"
        + "union all"
        + "select c2 from t2 ");
        after
        st.executeUpdate(
        " create view v1(c1)"
        + "as"
        + "(select c1 from t1)"
        + "union all"
        + "(select c2 from t2 )");

        The change was use parenthesis on select c1 from t1 and select c2 from t2 .
        The second problem was a nasty one and I ask help from derby-dev.

        Thanks

        Show
        Eranda Sooriyabandara added a comment - Hi Bryan, I solve the third problem in which the error was a Syntax error. before, st.executeUpdate( " create view v1(c1)" + "as" + "select c1 from t1" + "union all" + "select c2 from t2 "); after st.executeUpdate( " create view v1(c1)" + "as" + "(select c1 from t1)" + "union all" + "(select c2 from t2 )"); The change was use parenthesis on select c1 from t1 and select c2 from t2 . The second problem was a nasty one and I ask help from derby-dev. Thanks
        Hide
        Eranda Sooriyabandara added a comment -

        Hi Bryan,If the previous replacement correct we can use it in several
        places. And after replacing I saw three parts which still gives the errors.

        In row 687,

        if(usingEmbedded()){
        rs = st.executeQuery(
        "values ConsistencyChecker()");

        expColNames = new String []

        {"1"}

        ;
        JDBC.assertColumnNames(rs, expColNames);

        expRS = new String [][]
        {

        {"No open scans, etc"}

        ,

        {"30 dependencies found"}

        };

        JDBC.assertFullResultSet(rs, expRS, true);
        }

        In the row 2891,
        rs = st.executeQuery("values (3, cast (null as int))");

        In row 4620,
        st.executeUpdate(
        " create view v1(c1)"
        + "as"
        + "select c1 from t1"
        + "union all"
        + "select c2 from t2 ");

        I am attaching the patch file here.
        Thanks

        Show
        Eranda Sooriyabandara added a comment - Hi Bryan,If the previous replacement correct we can use it in several places. And after replacing I saw three parts which still gives the errors. In row 687, if(usingEmbedded()){ rs = st.executeQuery( "values ConsistencyChecker()"); expColNames = new String [] {"1"} ; JDBC.assertColumnNames(rs, expColNames); expRS = new String [][] { {"No open scans, etc"} , {"30 dependencies found"} }; JDBC.assertFullResultSet(rs, expRS, true); } In the row 2891, rs = st.executeQuery("values (3, cast (null as int))"); In row 4620, st.executeUpdate( " create view v1(c1)" + "as" + "select c1 from t1" + "union all" + "select c2 from t2 "); I am attaching the patch file here. Thanks
        Hide
        Eranda Sooriyabandara added a comment -

        Hi Bryan,

        I did some search on the RuntimeStaticParser and finally end up some coding
        which succeed.

        rs=st.executeQuery("SELECT R FROM t");
        while(rs.next()){}
        rs.close();

        rs = st.executeQuery(
        " values SYSCS_UTIL.SYSCS_GET_RUNTIMESTATISTICS()");
        rs.next();

        if(usingEmbedded())

        { RuntimeStatisticsParser rtsp = new RuntimeStatisticsParser(rs.getString(1)); rs.close(); assertTrue(rtsp.usedTableScan()); assertFalse(rtsp.usedDistinctScan()); }

        Is it fare to use this code here? Are there any problem with using this
        code?
        Thanks

        Show
        Eranda Sooriyabandara added a comment - Hi Bryan, I did some search on the RuntimeStaticParser and finally end up some coding which succeed. rs=st.executeQuery("SELECT R FROM t"); while(rs.next()){} rs.close(); rs = st.executeQuery( " values SYSCS_UTIL.SYSCS_GET_RUNTIMESTATISTICS()"); rs.next(); if(usingEmbedded()) { RuntimeStatisticsParser rtsp = new RuntimeStatisticsParser(rs.getString(1)); rs.close(); assertTrue(rtsp.usedTableScan()); assertFalse(rtsp.usedDistinctScan()); } Is it fare to use this code here? Are there any problem with using this code? Thanks
        Hide
        Eranda Sooriyabandara added a comment -

        Hi Bryan,I found some changes with the change of the code.

        This is the output when using,
        suite.addTest(DatabasePropertyTestSetup.singleProperty(
        TestConfiguration.defaultSuite(InbetweenTest.class)
        "derby.language.statementCacheSize", "0"));

        test_inbetween(org.apache.derbyTesting.functionTests.tests.lang.InbetweenTest)junit.framework.AssertionFailedError:
        C

        olumn value mismatch @ column '1', row 1:

        Expected: >No open scans, etc<

        Found: >No open scans, etc.

        34 dependencies found In Memory Dependencies:

        08264012-0122-d75c-d491-00000dd510ec, type PreparedStatement, is dependent
        on SYSCS_SET_DATABASE_PROPERTY, type Alias

        286cc01e-0122-d75c-d491-00000dd510ec, type PreparedStatement, is dependent
        on getSchemas, type StoredPreparedStatement

        560c80d5-0122-d75c-d491-00000dd510ec, type PreparedStatement, is dependent
        on CONSISTENCYCHECKER, type Alias

        582f8014-0122-d75c-d491-00000dd510ec, type PreparedStatement, is dependent
        on SYSCS_SET_DATABASE_PROPERTY, type Alias

        601a400f-0122-d75c-d491-00000dd510ec, type PreparedStatement, is dependent
        on SYSCS_GET_DATABASE_PROPERTY, type Alias

        61e8403f-0122-d75c-d491-00000dd510ec, type PreparedStatement, is dependent
        on getTables, type StoredPreparedStatement

        8a184042-0122-d75c-d491-00000dd510ec, type PreparedStatement, is dependent
        on SYSCS_INPLACE_COMPRESS_TABLE, type Alias

        da398044-0122-d75c-d491-00000dd510ec, type PreparedStatement, is dependent
        on SYSDEPENDS, type Table

        ea5bc046-0122-d75c-d491-00000dd510ec, type PreparedStatement, is dependent
        on SYSROLES(ROLEID, ISDEF), type Table

        ea5bc046-0122-d75c-d491-00000dd510ec, type PreparedStatement, is dependent
        on SYSROLES_INDEX2, type Index

        aliasID: 23ffc05b-0122-9ac2-fefa-00000dd510ec

        aliasName: SYSCS_SET_DATABASE_PROPERTY

        schemaID: c013800d-00fb-2649-07ec-000000134f30

        javaClassName: org.apache.derby.catalog.SystemProcedures

        aliasType: P

        nameSpace: P

        systemAlias: false

        aliasInfo: SYSCS_SET_DATABASE_PROPERTY(IN KEY VARCHAR(128),IN VALUE
        VARCHAR(32672)) LANGUAGE JAVA PARAMETER STYLE JAVA M

        ODIFIES SQL DATA

        , type Alias, provides for 08264012-0122-d75c-d491-00000dd510ec, type
        PreparedStatement

        aliasID: 23ffc05b-0122-9ac2-fefa-00000dd510ec

        aliasName: SYSCS_SET_DATABASE_PROPERTY

        schemaID: c013800d-00fb-2649-07ec-000000134f30

        javaClassName: org.apache.derby.catalog.SystemProcedures

        aliasType: P

        nameSpace: P

        systemAlias: false

        aliasInfo: SYSCS_SET_DATABASE_PROPERTY(IN KEY VARCHAR(128),IN VALUE
        VARCHAR(32672)) LANGUAG<

        at
        org.apache.derbyTesting.junit.JDBC.assertRowInResultSet(JDBC.java:1095)

        at
        org.apache.derbyTesting.junit.JDBC.assertRowInResultSet(JDBC.java:1007)

        at
        org.apache.derbyTesting.junit.JDBC.assertFullResultSet(JDBC.java:895)

        at
        org.apache.derbyTesting.junit.JDBC.assertFullResultSet(JDBC.java:833)

        at
        org.apache.derbyTesting.functionTests.tests.lang.InbetweenTest.test_inbetween(InbetweenTest.java:700)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

        at
        org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:109)

        at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)

        at junit.extensions.TestSetup$1.protect(TestSetup.java:23)

        at junit.extensions.TestSetup.run(TestSetup.java:27)

        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:23)

        at junit.extensions.TestSetup.run(TestSetup.java:27)

        at
        org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)

        Output when using the code,

        suite.addTest(TestConfiguration.defaultSuite(InbetweenTest.class));

        1)
        test_inbetween(org.apache.derbyTesting.functionTests.tests.lang.InbetweenTest)junit.framework.AssertionFailedError:
        C

        olumn value mismatch @ column '1', row 1:

        Expected: >No open scans, etc<

        Found: >No open scans, etc.

        30 dependencies found In Memory Dependencies:

        004b0019-0122-d761-1a5b-00000dd510ec, type PreparedStatement, is dependent
        on getSchemas, type StoredPreparedStatement

        0d0600d0-0122-d761-1a5b-00000dd510ec, type PreparedStatement, is dependent
        on CONSISTENCYCHECKER, type Alias

        601a400f-0122-d761-1a5b-00000dd510ec, type PreparedStatement, is dependent
        on SYSCS_SET_DATABASE_PROPERTY, type Alias

        61e8403f-0122-d761-1a5b-00000dd510ec, type PreparedStatement, is dependent
        on SYSDEPENDS, type Table

        82080041-0122-d761-1a5b-00000dd510ec, type PreparedStatement, is dependent
        on SYSROLES(ROLEID, ISDEF), type Table

        82080041-0122-d761-1a5b-00000dd510ec, type PreparedStatement, is dependent
        on SYSROLES_INDEX2, type Index

        c1c9803d-0122-d761-1a5b-00000dd510ec, type PreparedStatement, is dependent
        on SYSCS_INPLACE_COMPRESS_TABLE, type Alias

        c99d403a-0122-d761-1a5b-00000dd510ec, type PreparedStatement, is dependent
        on getTables, type StoredPreparedStatement

        aliasID: 23ffc05b-0122-9ac2-fefa-00000dd510ec

        aliasName: SYSCS_SET_DATABASE_PROPERTY

        schemaID: c013800d-00fb-2649-07ec-000000134f30

        javaClassName: org.apache.derby.catalog.SystemProcedures

        aliasType: P

        nameSpace: P

        systemAlias: false

        aliasInfo: SYSCS_SET_DATABASE_PROPERTY(IN KEY VARCHAR(128),IN VALUE
        VARCHAR(32672)) LANGUAGE JAVA PARAMETER STYLE JAVA M

        ODIFIES SQL DATA

        , type Alias, provides for 601a400f-0122-d761-1a5b-00000dd510ec, type
        PreparedStatement

        aliasID: 3a7f0048-0122-d761-1a5b-00000dd510ec

        aliasName: CONSISTENCYCHECKER

        schemaID: 80000000-00d2-b38f-4cda-000a0a412c00

        javaClassName:
        org.apache.derbyTesting.functionTests.util.T_ConsistencyChecker

        aliasType: F

        nameSpace: F

        systemAlias: false

        aliasInfo: runConsistencyChecker() RETURNS VARCHAR(2000) LANGUAGE JAVA
        PARAMETER STYLE JAVA READS SQL DATA CALLED ON NUL

        L INPUT

        , type Alias, provides for 0d0600d0-0122-d761-1a5b-00000dd510ec, type
        PreparedStatement

        SPSDescriptor:

        name: SYS.getTables

        uuid: 41588035-0122-9ac2-fefa-00000dd510ec

        text: SELECT CAST (<

        at
        org.apache.derbyTesting.junit.JDBC.assertRowInResultSet(JDBC.java:1095)

        at
        org.apache.derbyTesting.junit.JDBC.assertRowInResultSet(JDBC.java:1007)

        at
        org.apache.derbyTesting.junit.JDBC.assertFullResultSet(JDBC.java:895)

        at
        org.apache.derbyTesting.junit.JDBC.assertFullResultSet(JDBC.java:833)

        at
        org.apache.derbyTesting.functionTests.tests.lang.InbetweenTest.test_inbetween(InbetweenTest.java:695)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

        at
        org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:109)

        at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)

        at junit.extensions.TestSetup$1.protect(TestSetup.java:23)

        at junit.extensions.TestSetup.run(TestSetup.java:27)

        at
        org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)

        Show
        Eranda Sooriyabandara added a comment - Hi Bryan,I found some changes with the change of the code. This is the output when using, suite.addTest(DatabasePropertyTestSetup.singleProperty( TestConfiguration.defaultSuite(InbetweenTest.class) "derby.language.statementCacheSize", "0")); test_inbetween(org.apache.derbyTesting.functionTests.tests.lang.InbetweenTest)junit.framework.AssertionFailedError: C olumn value mismatch @ column '1', row 1: Expected: >No open scans, etc< Found: >No open scans, etc. 34 dependencies found In Memory Dependencies: 08264012-0122-d75c-d491-00000dd510ec, type PreparedStatement, is dependent on SYSCS_SET_DATABASE_PROPERTY, type Alias 286cc01e-0122-d75c-d491-00000dd510ec, type PreparedStatement, is dependent on getSchemas, type StoredPreparedStatement 560c80d5-0122-d75c-d491-00000dd510ec, type PreparedStatement, is dependent on CONSISTENCYCHECKER, type Alias 582f8014-0122-d75c-d491-00000dd510ec, type PreparedStatement, is dependent on SYSCS_SET_DATABASE_PROPERTY, type Alias 601a400f-0122-d75c-d491-00000dd510ec, type PreparedStatement, is dependent on SYSCS_GET_DATABASE_PROPERTY, type Alias 61e8403f-0122-d75c-d491-00000dd510ec, type PreparedStatement, is dependent on getTables, type StoredPreparedStatement 8a184042-0122-d75c-d491-00000dd510ec, type PreparedStatement, is dependent on SYSCS_INPLACE_COMPRESS_TABLE, type Alias da398044-0122-d75c-d491-00000dd510ec, type PreparedStatement, is dependent on SYSDEPENDS, type Table ea5bc046-0122-d75c-d491-00000dd510ec, type PreparedStatement, is dependent on SYSROLES(ROLEID, ISDEF), type Table ea5bc046-0122-d75c-d491-00000dd510ec, type PreparedStatement, is dependent on SYSROLES_INDEX2, type Index aliasID: 23ffc05b-0122-9ac2-fefa-00000dd510ec aliasName: SYSCS_SET_DATABASE_PROPERTY schemaID: c013800d-00fb-2649-07ec-000000134f30 javaClassName: org.apache.derby.catalog.SystemProcedures aliasType: P nameSpace: P systemAlias: false aliasInfo: SYSCS_SET_DATABASE_PROPERTY(IN KEY VARCHAR(128),IN VALUE VARCHAR(32672)) LANGUAGE JAVA PARAMETER STYLE JAVA M ODIFIES SQL DATA , type Alias, provides for 08264012-0122-d75c-d491-00000dd510ec, type PreparedStatement aliasID: 23ffc05b-0122-9ac2-fefa-00000dd510ec aliasName: SYSCS_SET_DATABASE_PROPERTY schemaID: c013800d-00fb-2649-07ec-000000134f30 javaClassName: org.apache.derby.catalog.SystemProcedures aliasType: P nameSpace: P systemAlias: false aliasInfo: SYSCS_SET_DATABASE_PROPERTY(IN KEY VARCHAR(128),IN VALUE VARCHAR(32672)) LANGUAG< at org.apache.derbyTesting.junit.JDBC.assertRowInResultSet(JDBC.java:1095) at org.apache.derbyTesting.junit.JDBC.assertRowInResultSet(JDBC.java:1007) at org.apache.derbyTesting.junit.JDBC.assertFullResultSet(JDBC.java:895) at org.apache.derbyTesting.junit.JDBC.assertFullResultSet(JDBC.java:833) at org.apache.derbyTesting.functionTests.tests.lang.InbetweenTest.test_inbetween(InbetweenTest.java:700) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:109) at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24) at junit.extensions.TestSetup$1.protect(TestSetup.java:23) at junit.extensions.TestSetup.run(TestSetup.java:27) 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:23) at junit.extensions.TestSetup.run(TestSetup.java:27) at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57) Output when using the code, suite.addTest(TestConfiguration.defaultSuite(InbetweenTest.class)); 1) test_inbetween(org.apache.derbyTesting.functionTests.tests.lang.InbetweenTest)junit.framework.AssertionFailedError: C olumn value mismatch @ column '1', row 1: Expected: >No open scans, etc< Found: >No open scans, etc. 30 dependencies found In Memory Dependencies: 004b0019-0122-d761-1a5b-00000dd510ec, type PreparedStatement, is dependent on getSchemas, type StoredPreparedStatement 0d0600d0-0122-d761-1a5b-00000dd510ec, type PreparedStatement, is dependent on CONSISTENCYCHECKER, type Alias 601a400f-0122-d761-1a5b-00000dd510ec, type PreparedStatement, is dependent on SYSCS_SET_DATABASE_PROPERTY, type Alias 61e8403f-0122-d761-1a5b-00000dd510ec, type PreparedStatement, is dependent on SYSDEPENDS, type Table 82080041-0122-d761-1a5b-00000dd510ec, type PreparedStatement, is dependent on SYSROLES(ROLEID, ISDEF), type Table 82080041-0122-d761-1a5b-00000dd510ec, type PreparedStatement, is dependent on SYSROLES_INDEX2, type Index c1c9803d-0122-d761-1a5b-00000dd510ec, type PreparedStatement, is dependent on SYSCS_INPLACE_COMPRESS_TABLE, type Alias c99d403a-0122-d761-1a5b-00000dd510ec, type PreparedStatement, is dependent on getTables, type StoredPreparedStatement aliasID: 23ffc05b-0122-9ac2-fefa-00000dd510ec aliasName: SYSCS_SET_DATABASE_PROPERTY schemaID: c013800d-00fb-2649-07ec-000000134f30 javaClassName: org.apache.derby.catalog.SystemProcedures aliasType: P nameSpace: P systemAlias: false aliasInfo: SYSCS_SET_DATABASE_PROPERTY(IN KEY VARCHAR(128),IN VALUE VARCHAR(32672)) LANGUAGE JAVA PARAMETER STYLE JAVA M ODIFIES SQL DATA , type Alias, provides for 601a400f-0122-d761-1a5b-00000dd510ec, type PreparedStatement aliasID: 3a7f0048-0122-d761-1a5b-00000dd510ec aliasName: CONSISTENCYCHECKER schemaID: 80000000-00d2-b38f-4cda-000a0a412c00 javaClassName: org.apache.derbyTesting.functionTests.util.T_ConsistencyChecker aliasType: F nameSpace: F systemAlias: false aliasInfo: runConsistencyChecker() RETURNS VARCHAR(2000) LANGUAGE JAVA PARAMETER STYLE JAVA READS SQL DATA CALLED ON NUL L INPUT , type Alias, provides for 0d0600d0-0122-d761-1a5b-00000dd510ec, type PreparedStatement SPSDescriptor: name: SYS.getTables uuid: 41588035-0122-9ac2-fefa-00000dd510ec text: SELECT CAST (< at org.apache.derbyTesting.junit.JDBC.assertRowInResultSet(JDBC.java:1095) at org.apache.derbyTesting.junit.JDBC.assertRowInResultSet(JDBC.java:1007) at org.apache.derbyTesting.junit.JDBC.assertFullResultSet(JDBC.java:895) at org.apache.derbyTesting.junit.JDBC.assertFullResultSet(JDBC.java:833) at org.apache.derbyTesting.functionTests.tests.lang.InbetweenTest.test_inbetween(InbetweenTest.java:695) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:109) at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24) at junit.extensions.TestSetup$1.protect(TestSetup.java:23) at junit.extensions.TestSetup.run(TestSetup.java:27) at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)
        Hide
        Bryan Pendleton added a comment -

        Hi Eranda, Actually, as I look at the test more closely, I think it
        would be easier to use the XPLAIN tables feature instead of the
        RuntimeStatisticsParser to do these sections of the test.

        But first, let's figure out the problem with the consistency checker
        and the wrong number of dependencies; then we can go back and work on
        changing the query plan verification in the test to use XPLAIN table checking.

        I'm wondering if the dependencies problem has to do with this comment in inbetween_derby.properties:

          1. wants to do consistency checking, so needs
          2. the statement cache off to ensure no trailing dependencies exist
            -derby.language.statementCacheSize=0

        I think we should be able to use DatabasePropertyTestSetup here.

        Can you try changing

        suite.addTest(TestConfiguration.defaultSuite(InbetweenTest.class));

        to

        suite.addTest(DatabasePropertyTestSetup.singleProperty(
        TestConfiguration.defaultSuite(InbetweenTest.class)
        "derby.language.statementCacheSize", "0"));

        to see if this has any effect on the dependencies that the ConsistencyChecker finds?

        Show
        Bryan Pendleton added a comment - Hi Eranda, Actually, as I look at the test more closely, I think it would be easier to use the XPLAIN tables feature instead of the RuntimeStatisticsParser to do these sections of the test. But first, let's figure out the problem with the consistency checker and the wrong number of dependencies; then we can go back and work on changing the query plan verification in the test to use XPLAIN table checking. I'm wondering if the dependencies problem has to do with this comment in inbetween_derby.properties: wants to do consistency checking, so needs the statement cache off to ensure no trailing dependencies exist -derby.language.statementCacheSize=0 I think we should be able to use DatabasePropertyTestSetup here. Can you try changing suite.addTest(TestConfiguration.defaultSuite(InbetweenTest.class)); to suite.addTest(DatabasePropertyTestSetup.singleProperty( TestConfiguration.defaultSuite(InbetweenTest.class) "derby.language.statementCacheSize", "0")); to see if this has any effect on the dependencies that the ConsistencyChecker finds?
        Hide
        Eranda Sooriyabandara added a comment -

        Hi Bryan,
        I change the code as in the DistinctTest.java, but not on a totally
        understanding. I got the results as below, and need more help to understand
        the dependencies. Here I am attaching the code which I made changes.
        Also same situation in the row 696.

        rs = st.executeQuery(" values
        SYSCS_UTIL.SYSCS_GET_RUNTIMESTATISTICS()");

        expColNames = new String []

        {"1"}

        ;

        JDBC.assertColumnNames(rs, expColNames);

        RuntimeStatisticsParser rtsp =
        SQLUtilities.getRuntimeStatisticsParser(st);

        assertTrue(rtsp.usedTableScan());

        assertFalse(rtsp.usedDistinctScan());

        .F.F

        Time: 6.763

        There were 2 failures:

        1)
        test_inbetween(org.apache.derbyTesting.functionTests.tests.lang.InbetweenTest)junit.framework.AssertionFailedError:
        n

        ull

        at
        org.apache.derbyTesting.functionTests.tests.lang.InbetweenTest.test_inbetween(InbetweenTest.java:1590)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

        at
        org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:109)

        at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)

        at junit.extensions.TestSetup$1.protect(TestSetup.java:23)

        at junit.extensions.TestSetup.run(TestSetup.java:27)

        at
        org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)

        2)
        test_inbetween(org.apache.derbyTesting.functionTests.tests.lang.InbetweenTest)junit.framework.AssertionFailedError:
        n

        ull

        at
        org.apache.derbyTesting.functionTests.tests.lang.InbetweenTest.test_inbetween(InbetweenTest.java:1590)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

        at
        org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:109)

        at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)

        at junit.extensions.TestSetup$1.protect(TestSetup.java:23)

        at junit.extensions.TestSetup.run(TestSetup.java:27)

        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:23)

        at junit.extensions.TestSetup.run(TestSetup.java:27)

        at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)

        at junit.extensions.TestSetup$1.protect(TestSetup.java:23)

        at junit.extensions.TestSetup.run(TestSetup.java:27)

        at
        org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)

        FAILURES!!!

        Tests run: 2, Failures: 2, Errors: 0

        Thanks

        Show
        Eranda Sooriyabandara added a comment - Hi Bryan, I change the code as in the DistinctTest.java, but not on a totally understanding. I got the results as below, and need more help to understand the dependencies. Here I am attaching the code which I made changes. Also same situation in the row 696. rs = st.executeQuery(" values SYSCS_UTIL.SYSCS_GET_RUNTIMESTATISTICS()"); expColNames = new String [] {"1"} ; JDBC.assertColumnNames(rs, expColNames); RuntimeStatisticsParser rtsp = SQLUtilities.getRuntimeStatisticsParser(st); assertTrue(rtsp.usedTableScan()); assertFalse(rtsp.usedDistinctScan()); .F.F Time: 6.763 There were 2 failures: 1) test_inbetween(org.apache.derbyTesting.functionTests.tests.lang.InbetweenTest)junit.framework.AssertionFailedError: n ull at org.apache.derbyTesting.functionTests.tests.lang.InbetweenTest.test_inbetween(InbetweenTest.java:1590) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:109) at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24) at junit.extensions.TestSetup$1.protect(TestSetup.java:23) at junit.extensions.TestSetup.run(TestSetup.java:27) at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57) 2) test_inbetween(org.apache.derbyTesting.functionTests.tests.lang.InbetweenTest)junit.framework.AssertionFailedError: n ull at org.apache.derbyTesting.functionTests.tests.lang.InbetweenTest.test_inbetween(InbetweenTest.java:1590) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:109) at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24) at junit.extensions.TestSetup$1.protect(TestSetup.java:23) at junit.extensions.TestSetup.run(TestSetup.java:27) 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:23) at junit.extensions.TestSetup.run(TestSetup.java:27) at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24) at junit.extensions.TestSetup$1.protect(TestSetup.java:23) at junit.extensions.TestSetup.run(TestSetup.java:27) at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57) FAILURES!!! Tests run: 2, Failures: 2, Errors: 0 Thanks
        Hide
        Bryan Pendleton added a comment -

        Hi Eranda, For an example of how to use RuntimeStatisticsParser in a Derby JUnit test, have a look at:
        trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/DistinctTest.java

        For example, look around line 588 in that file.

        Show
        Bryan Pendleton added a comment - Hi Eranda, For an example of how to use RuntimeStatisticsParser in a Derby JUnit test, have a look at: trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/DistinctTest.java For example, look around line 588 in that file.
        Hide
        Bryan Pendleton added a comment -

        Hi Eranda, Rick provided his patch in a message to the derby-dev list. Here is his message:
        http://mail-archives.apache.org/mod_mbox/db-derby-dev/200907.mbox/%3C4A6DC058.7050302@sun.com%3E

        And here is the diff that was attached to the message, to help with diagnosis:
        Index: java/testing/org/apache/derbyTesting/functionTests/tests/lang/inbetween.sql
        ===================================================================
        — java/testing/org/apache/derbyTesting/functionTests/tests/lang/inbetween.sql (revision 798152)
        +++ java/testing/org/apache/derbyTesting/functionTests/tests/lang/inbetween.sql (working copy)
        @@ -23,7 +23,7 @@
        – compatibility with dynamic parameters
        set isolation to rr;

        -CREATE FUNCTION ConsistencyChecker() RETURNS VARCHAR(128)
        +CREATE FUNCTION ConsistencyChecker() RETURNS VARCHAR(20000)
        EXTERNAL NAME 'org.apache.derbyTesting.functionTests.util.T_ConsistencyChecker.runConsistencyChecker'
        LANGUAGE JAVA PARAMETER STYLE JAVA;
        autocommit off;
        @@ -147,6 +147,7 @@
        delete from s where i between 3 and 5;
        select * from s;

        +MAXIMUMDISPLAYWIDTH 2000;
        – check consistency of scans, etc.
        values ConsistencyChecker();

        Index: java/testing/org/apache/derbyTesting/functionTests/util/T_ConsistencyChecker.java
        ===================================================================
        — java/testing/org/apache/derbyTesting/functionTests/util/T_ConsistencyChecker.java (revision 798152)
        +++ java/testing/org/apache/derbyTesting/functionTests/util/T_ConsistencyChecker.java (working copy)
        @@ -504,6 +504,8 @@

        { debugBuf.append("No outstanding dependencies.\n"); }

        +
        + debugBuf.append( " " + dm.dumpDependencies() );

        return debugBuf.toString();
        }

        Show
        Bryan Pendleton added a comment - Hi Eranda, Rick provided his patch in a message to the derby-dev list. Here is his message: http://mail-archives.apache.org/mod_mbox/db-derby-dev/200907.mbox/%3C4A6DC058.7050302@sun.com%3E And here is the diff that was attached to the message, to help with diagnosis: Index: java/testing/org/apache/derbyTesting/functionTests/tests/lang/inbetween.sql =================================================================== — java/testing/org/apache/derbyTesting/functionTests/tests/lang/inbetween.sql (revision 798152) +++ java/testing/org/apache/derbyTesting/functionTests/tests/lang/inbetween.sql (working copy) @@ -23,7 +23,7 @@ – compatibility with dynamic parameters set isolation to rr; -CREATE FUNCTION ConsistencyChecker() RETURNS VARCHAR(128) +CREATE FUNCTION ConsistencyChecker() RETURNS VARCHAR(20000) EXTERNAL NAME 'org.apache.derbyTesting.functionTests.util.T_ConsistencyChecker.runConsistencyChecker' LANGUAGE JAVA PARAMETER STYLE JAVA; autocommit off; @@ -147,6 +147,7 @@ delete from s where i between 3 and 5; select * from s; +MAXIMUMDISPLAYWIDTH 2000; – check consistency of scans, etc. values ConsistencyChecker(); Index: java/testing/org/apache/derbyTesting/functionTests/util/T_ConsistencyChecker.java =================================================================== — java/testing/org/apache/derbyTesting/functionTests/util/T_ConsistencyChecker.java (revision 798152) +++ java/testing/org/apache/derbyTesting/functionTests/util/T_ConsistencyChecker.java (working copy) @@ -504,6 +504,8 @@ { debugBuf.append("No outstanding dependencies.\n"); } + + debugBuf.append( " " + dm.dumpDependencies() ); return debugBuf.toString(); }
        Hide
        Eranda Sooriyabandara added a comment -

        Hi Kathey,I am sorry,I didn't get your idea you trying to say me.
        RuntimeStatisticsParser to verify relevant output.
        How can I use RuntimeStatisticsParser to verify relevant output?

        I am sorry I didn't have the patch which Rick provided. Where can I find it?

        On Fri, Jul 31, 2009 at 12:36 AM, Kathey Marsden (JIRA) <jira@apache.org>wrote:

        Show
        Eranda Sooriyabandara added a comment - Hi Kathey,I am sorry,I didn't get your idea you trying to say me. RuntimeStatisticsParser to verify relevant output. How can I use RuntimeStatisticsParser to verify relevant output? I am sorry I didn't have the patch which Rick provided. Where can I find it? On Fri, Jul 31, 2009 at 12:36 AM, Kathey Marsden (JIRA) <jira@apache.org>wrote:
        Hide
        Kathey Marsden added a comment -

        Hi Eranda, when I tried to run the test I saw a different failure:

        test_inbetween used 1968 ms F.
        test_inbetween used 5156 ms F
        Time: 11.828
        There were 2 failures:
        1) test_inbetween(org.apache.derbyTesting.functionTests.tests.lang.InbetweenTest)junit.framework.AssertionFailedError: C
        olumn value mismatch @ column '1', row 1:
        Expected: >Statement Name:
        null
        Statement Text:
        call SYSCS_UTIL.SYSCS_SET_RUNTIMESTATISTICS(1)
        Parse Time: 0
        Bind Time: 0
        Optimize Time: 0
        Generate Time: 0
        Compile Time: 0
        Execute Time: 0
        Begin Compilation Timestamp : null
        End Compilation Timestamp : null
        Begin Execution Timestamp : null
        End Execution Timestamp : null
        Statement Execution Plan Text:
        null<
        Found: >Statement Name:
        null
        Statement Text:
        call SYSCS_UTIL.SYSCS_SET_RUNTIMESTATISTICS(1)
        Parse Time: 0
        Bind Time: 0
        Optimize Time: 0
        Generate Time: 0
        Compile Time: 0
        Execute Time: 0
        Begin Compilation Timestamp : null
        End Compilation Timestamp : null
        Begin Execution Timestamp : null
        End Execution Timestamp : null
        Statement Execution Plan Text:
        null<
        at org.apache.derbyTesting.junit.JDBC.assertRowInResultSet(JDBC.java:1092)
        at org.apache.derbyTesting.junit.JDBC.assertRowInResultSet(JDBC.java:1004)
        at org.apache.derbyTesting.junit.JDBC.assertFullResultSet(JDBC.java:892)
        at org.apache.derbyTesting.junit.JDBC.assertFullResultSet(JDBC.java:830)
        at org.apache.derbyTesting.functionTests.tests.lang.InbetweenTest.test_inbetween(InbetweenTest.java:1608)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
        at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:109)
        at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
        at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
        at junit.extensions.TestSetup.run(TestSetup.java:23)
        at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)
        2) test_inbetween(org.apache.derbyTesting.functionTests.tests.lang.InbetweenTest)junit.framework.AssertionFailedError: C
        olumn value mismatch @ column '1', row 1:
        Expected: >Statement Name:<
        Found: >Statement Name:
        SQL_CURLH000C15
        Statement Text:
        select c1 from t2 where c1 in (select c1 from t1 where c1 in (5, t2.c2))
        Parse Time: 0
        Bind Time: 0
        Optimize Time: 0
        Generate Time: 0
        Compile Time: 0
        Execute Time: 0
        Begin Compilation Timestamp : null
        End Compilation Timestamp : null
        Begin Execution Timestamp : null
        End Execution Timestamp : null
        Statement Execution Plan Text:
        Project-Restrict ResultSet (5):
        Number of opens = 1
        Rows seen = 2
        Rows filtered = 0
        restriction = false
        projection = true
        constructor time (milliseconds) = 0
        open time (milliseconds) = 0
        next time (milliseconds) = 0
        close time (milliseconds) = 0
        restriction time (milliseconds) = 0
        projection time (milliseconds) = 0
        optimizer estimated row count: 1.00
        optimizer estimated cost: 60.02

        Source result set:
        Hash Exists Join ResultSet:
        Number of opens = 1
        Rows seen from the left = 4
        Rows seen from the right = 2
        Rows filtered = 0
        Rows returned = 2
        constructor time (milliseconds) = 0
        open time (milliseconds) = 0
        next time (milliseconds) = 0
        close time (milliseconds) = 0
        optimizer estimated row count: 1.00
        optimizer estimated cost: 60.02

        Left result set:
        Table Scan ResultSet for T2 at serializable isolation level using share table locking chosen by the opti
        mizer
        Number of opens = 1
        Rows seen = 4
        Rows filtered = 0
        Fetch Size = 16
        constructor time (milliseconds) = 0
        open time (milliseconds) = 0
        next time (milliseconds) = 0
        close time (milliseconds) = 0
        next time in milliseconds/row = 0

        scan information:
        Bit set of columns fetched=All
        Number of columns fetched=2
        Number of pages visited=1
        Number of rows qualified=4
        Number of rows visited=4
        Scan type=heap
        start position:
        null stop position:
        null qualifiers:
        None
        optimizer estimated row count: 9.00
        optimizer estimated cost: 39.32

        Right result set:
        Project-Restrict ResultSet (4):
        Number of opens = 4
        Rows seen = 2
        Rows filtered = 0
        restriction = true
        projection = false
        constructor time (milliseconds) = 0
        open time (milliseconds) = 0
        next time (milliseconds) = 0
        close time (milliseconds) = 0
        restriction time (milliseconds) = 0
        projection time (milliseconds) = 0
        optimizer estimated row count: 1.00
        optimizer estimated cost: 20.69

        Source result set:
        Hash Scan ResultSet for T1 using index I11 at serializable isolation level using share table loc
        king:
        Number of opens = 4
        Hash table size = 5
        Hash key is column number 0
        Rows seen = 2
        Rows filtered = 0
        constructor time (milliseconds) = 0
        open time (milliseconds) = 0
        next time (milliseconds) = 0
        close time (milliseconds) = 0
        next time in milliseconds/row = 0

        scan information:
        Bit set of columns fetched=

        {0}

        Number of columns fetched=1
        Number of deleted rows visited=0
        Number of pages visited=1
        Number of rows qualified=5
        Number of rows visited=5
        Scan type=btree
        Tree height=1
        start position:
        None
        stop position:
        None
        scan qualifiers:
        None
        next qualifiers:
        Column[0][0] Id: 0
        Operator: =
        Ordered nulls: false
        Unknown return value: false
        Negate comparison result: false

        optimizer estimated row count: 1.00
        optimizer estimated cost: 20.69<
        at org.apache.derbyTesting.junit.JDBC.assertRowInResultSet(JDBC.java:1092)
        at org.apache.derbyTesting.junit.JDBC.assertRowInResultSet(JDBC.java:1004)
        at org.apache.derbyTesting.junit.JDBC.assertFullResultSet(JDBC.java:892)
        at org.apache.derbyTesting.junit.JDBC.assertFullResultSet(JDBC.java:830)
        at org.apache.derbyTesting.functionTests.tests.lang.InbetweenTest.test_inbetween(InbetweenTest.java:3828)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
        at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:109)
        at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
        at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
        at junit.extensions.TestSetup.run(TestSetup.java:23)
        at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)
        at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
        at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
        at junit.extensions.TestSetup.run(TestSetup.java:23)
        at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
        at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
        at junit.extensions.TestSetup.run(TestSetup.java:23)
        at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)

        FAILURES!!!
        Tests run: 2, Failures: 2, Errors: 0

        I think typically instead of checking the full RuntimeStatistics output, tests use RuntimeStatisticsParser to verify relevant output.

        I also noticed the test name was wrong in the license header and think it might be good to split this test up into multiple fixtures if that is practical.

        But back to the question you asked, to see the dependency issue should I uncomment the code around line 1860? Was the patch Rick provided helpful in isolating the issue?

        Show
        Kathey Marsden added a comment - Hi Eranda, when I tried to run the test I saw a different failure: test_inbetween used 1968 ms F. test_inbetween used 5156 ms F Time: 11.828 There were 2 failures: 1) test_inbetween(org.apache.derbyTesting.functionTests.tests.lang.InbetweenTest)junit.framework.AssertionFailedError: C olumn value mismatch @ column '1', row 1: Expected: >Statement Name: null Statement Text: call SYSCS_UTIL.SYSCS_SET_RUNTIMESTATISTICS(1) Parse Time: 0 Bind Time: 0 Optimize Time: 0 Generate Time: 0 Compile Time: 0 Execute Time: 0 Begin Compilation Timestamp : null End Compilation Timestamp : null Begin Execution Timestamp : null End Execution Timestamp : null Statement Execution Plan Text: null< Found: >Statement Name: null Statement Text: call SYSCS_UTIL.SYSCS_SET_RUNTIMESTATISTICS(1) Parse Time: 0 Bind Time: 0 Optimize Time: 0 Generate Time: 0 Compile Time: 0 Execute Time: 0 Begin Compilation Timestamp : null End Compilation Timestamp : null Begin Execution Timestamp : null End Execution Timestamp : null Statement Execution Plan Text: null< at org.apache.derbyTesting.junit.JDBC.assertRowInResultSet(JDBC.java:1092) at org.apache.derbyTesting.junit.JDBC.assertRowInResultSet(JDBC.java:1004) at org.apache.derbyTesting.junit.JDBC.assertFullResultSet(JDBC.java:892) at org.apache.derbyTesting.junit.JDBC.assertFullResultSet(JDBC.java:830) at org.apache.derbyTesting.functionTests.tests.lang.InbetweenTest.test_inbetween(InbetweenTest.java:1608) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37) at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:109) at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22) at junit.extensions.TestSetup$1.protect(TestSetup.java:19) at junit.extensions.TestSetup.run(TestSetup.java:23) at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57) 2) test_inbetween(org.apache.derbyTesting.functionTests.tests.lang.InbetweenTest)junit.framework.AssertionFailedError: C olumn value mismatch @ column '1', row 1: Expected: >Statement Name:< Found: >Statement Name: SQL_CURLH000C15 Statement Text: select c1 from t2 where c1 in (select c1 from t1 where c1 in (5, t2.c2)) Parse Time: 0 Bind Time: 0 Optimize Time: 0 Generate Time: 0 Compile Time: 0 Execute Time: 0 Begin Compilation Timestamp : null End Compilation Timestamp : null Begin Execution Timestamp : null End Execution Timestamp : null Statement Execution Plan Text: Project-Restrict ResultSet (5): Number of opens = 1 Rows seen = 2 Rows filtered = 0 restriction = false projection = true constructor time (milliseconds) = 0 open time (milliseconds) = 0 next time (milliseconds) = 0 close time (milliseconds) = 0 restriction time (milliseconds) = 0 projection time (milliseconds) = 0 optimizer estimated row count: 1.00 optimizer estimated cost: 60.02 Source result set: Hash Exists Join ResultSet: Number of opens = 1 Rows seen from the left = 4 Rows seen from the right = 2 Rows filtered = 0 Rows returned = 2 constructor time (milliseconds) = 0 open time (milliseconds) = 0 next time (milliseconds) = 0 close time (milliseconds) = 0 optimizer estimated row count: 1.00 optimizer estimated cost: 60.02 Left result set: Table Scan ResultSet for T2 at serializable isolation level using share table locking chosen by the opti mizer Number of opens = 1 Rows seen = 4 Rows filtered = 0 Fetch Size = 16 constructor time (milliseconds) = 0 open time (milliseconds) = 0 next time (milliseconds) = 0 close time (milliseconds) = 0 next time in milliseconds/row = 0 scan information: Bit set of columns fetched=All Number of columns fetched=2 Number of pages visited=1 Number of rows qualified=4 Number of rows visited=4 Scan type=heap start position: null stop position: null qualifiers: None optimizer estimated row count: 9.00 optimizer estimated cost: 39.32 Right result set: Project-Restrict ResultSet (4): Number of opens = 4 Rows seen = 2 Rows filtered = 0 restriction = true projection = false constructor time (milliseconds) = 0 open time (milliseconds) = 0 next time (milliseconds) = 0 close time (milliseconds) = 0 restriction time (milliseconds) = 0 projection time (milliseconds) = 0 optimizer estimated row count: 1.00 optimizer estimated cost: 20.69 Source result set: Hash Scan ResultSet for T1 using index I11 at serializable isolation level using share table loc king: Number of opens = 4 Hash table size = 5 Hash key is column number 0 Rows seen = 2 Rows filtered = 0 constructor time (milliseconds) = 0 open time (milliseconds) = 0 next time (milliseconds) = 0 close time (milliseconds) = 0 next time in milliseconds/row = 0 scan information: Bit set of columns fetched= {0} Number of columns fetched=1 Number of deleted rows visited=0 Number of pages visited=1 Number of rows qualified=5 Number of rows visited=5 Scan type=btree Tree height=1 start position: None stop position: None scan qualifiers: None next qualifiers: Column [0] [0] Id: 0 Operator: = Ordered nulls: false Unknown return value: false Negate comparison result: false optimizer estimated row count: 1.00 optimizer estimated cost: 20.69< at org.apache.derbyTesting.junit.JDBC.assertRowInResultSet(JDBC.java:1092) at org.apache.derbyTesting.junit.JDBC.assertRowInResultSet(JDBC.java:1004) at org.apache.derbyTesting.junit.JDBC.assertFullResultSet(JDBC.java:892) at org.apache.derbyTesting.junit.JDBC.assertFullResultSet(JDBC.java:830) at org.apache.derbyTesting.functionTests.tests.lang.InbetweenTest.test_inbetween(InbetweenTest.java:3828) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37) at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:109) at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22) at junit.extensions.TestSetup$1.protect(TestSetup.java:19) at junit.extensions.TestSetup.run(TestSetup.java:23) at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57) at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22) at junit.extensions.TestSetup$1.protect(TestSetup.java:19) at junit.extensions.TestSetup.run(TestSetup.java:23) at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22) at junit.extensions.TestSetup$1.protect(TestSetup.java:19) at junit.extensions.TestSetup.run(TestSetup.java:23) at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57) FAILURES!!! Tests run: 2, Failures: 2, Errors: 0 I think typically instead of checking the full RuntimeStatistics output, tests use RuntimeStatisticsParser to verify relevant output. I also noticed the test name was wrong in the license header and think it might be good to split this test up into multiple fixtures if that is practical. But back to the question you asked, to see the dependency issue should I uncomment the code around line 1860? Was the patch Rick provided helpful in isolating the issue?
        Hide
        Eranda Sooriyabandara added a comment -

        Hi Kathey,I am really sorry about that, I missed out when I create the
        patch.
        I send it right away.
        Thanks
        Eranda

        Show
        Eranda Sooriyabandara added a comment - Hi Kathey,I am really sorry about that, I missed out when I create the patch. I send it right away. Thanks Eranda
        Hide
        Kathey Marsden added a comment -

        Hi Eranda,

        I don't see the new test in the patch. Perhaps did you forget to svn add the file InbetweenTest.java?

        Show
        Kathey Marsden added a comment - Hi Eranda, I don't see the new test in the patch. Perhaps did you forget to svn add the file InbetweenTest.java?
        Hide
        Eranda Sooriyabandara added a comment -

        Hi Kathey,
        I passed the test with the code,

        rs = st.executeQuery(
        "values ConsistencyChecker()");

        expColNames = new String []

        {"1"}

        ;
        JDBC.assertColumnNames(rs, expColNames);

        expRS = new String [][]
        {

        {"No open scans, etc.\n30 dependencies found"}

        };

        JDBC.assertFullResultSet(rs, expRS, true);

        But it is differ from what we expect as the result.

        Show
        Eranda Sooriyabandara added a comment - Hi Kathey, I passed the test with the code, rs = st.executeQuery( "values ConsistencyChecker()"); expColNames = new String [] {"1"} ; JDBC.assertColumnNames(rs, expColNames); expRS = new String [][] { {"No open scans, etc.\n30 dependencies found"} }; JDBC.assertFullResultSet(rs, expRS, true); But it is differ from what we expect as the result.
        Hide
        Eranda Sooriyabandara added a comment -

        Hi Kathey,Thanks for help me with this issue.
        I send the patch file(not for commit) with this.
        Thanks
        Eranda

        Show
        Eranda Sooriyabandara added a comment - Hi Kathey,Thanks for help me with this issue. I send the patch file(not for commit) with this. Thanks Eranda
        Hide
        Kathey Marsden added a comment -

        Hi Eranda,

        Can you post your current patch and just indicate that it is not for commit and I will try to help you debug this issue.

        Show
        Kathey Marsden added a comment - Hi Eranda, Can you post your current patch and just indicate that it is not for commit and I will try to help you debug this issue.
        Hide
        Eranda Sooriyabandara added a comment -

        Hi Bryan,
        I found a big problem with the unconverted codings(about 400 unconverted
        lines). I did some of them successfully but in the case of, ij> – check
        consistency of scans, etc. values ConsistencyChecker(); 1
        --------------------------- No open scans, etc. 2 dependencies found

        I use the code as,

        rs = st.executeQuery(
        "values ConsistencyChecker()");

        expRS = new String [][]
        {

        {"No open scans, etc. 2 dependencies found"}

        };

        JDBC.assertFullResultSet(rs, expRS, true);

        the result failure was

        test_inbetween(org.apache.derbyTesting.functionTests.tests.lang.InbetweenTest)junit.framework.AssertionFailedError:
        C

        olumn value mismatch @ column '1', row 1:

        Expected: >No open scans, etc. 2 dependencies found<

        Found: >No open scans, etc.

        46 dependencies found<

        What can I do for the make that test success.

        Show
        Eranda Sooriyabandara added a comment - Hi Bryan, I found a big problem with the unconverted codings(about 400 unconverted lines). I did some of them successfully but in the case of, ij> – check consistency of scans, etc. values ConsistencyChecker(); 1 --------------------------- No open scans, etc. 2 dependencies found I use the code as, rs = st.executeQuery( "values ConsistencyChecker()"); expRS = new String [][] { {"No open scans, etc. 2 dependencies found"} }; JDBC.assertFullResultSet(rs, expRS, true); the result failure was test_inbetween(org.apache.derbyTesting.functionTests.tests.lang.InbetweenTest)junit.framework.AssertionFailedError: C olumn value mismatch @ column '1', row 1: Expected: >No open scans, etc. 2 dependencies found< Found: >No open scans, etc. 46 dependencies found< What can I do for the make that test success.
        Hide
        Eranda Sooriyabandara added a comment -

        Hi Bryan,Here I send the JUNIT file I got with this. There is a big
        unconverted code and I have to work harder on that.
        It'll take bit more time than what I expect for the next patch.

        Show
        Eranda Sooriyabandara added a comment - Hi Bryan,Here I send the JUNIT file I got with this. There is a big unconverted code and I have to work harder on that. It'll take bit more time than what I expect for the next patch.
        Hide
        Bryan Pendleton added a comment -

        That looks like exactly the right fix.

        Show
        Bryan Pendleton added a comment - That looks like exactly the right fix.
        Hide
        Eranda Sooriyabandara added a comment -

        Hi Bryan,
        In the code I face with a problem with the code,

        st.executeUpdate(
        " insert into t values (0, 100, 'hello', 'everyone "
        + "is here', 200.0e0,"
        + " 300.0e0, '1992-01-01', '12:30:30', "
        + "'xxxxxxFILTERED-TIMESTAMPxxxxx')");

        and I replace with the code,

        st.executeUpdate(
        " insert into t values (0, 100, 'hello', 'everyone "
        + "is here', 200.0e0,"
        + " 300.0e0, '1992-01-01','12:30:30',"+
        "'"Timestamp.valueOf("1992-01-01 12:30:30")"')");

        And I got the results fine.

        Show
        Eranda Sooriyabandara added a comment - Hi Bryan, In the code I face with a problem with the code, st.executeUpdate( " insert into t values (0, 100, 'hello', 'everyone " + "is here', 200.0e0," + " 300.0e0, '1992-01-01', '12:30:30', " + "'xxxxxxFILTERED-TIMESTAMPxxxxx')"); and I replace with the code, st.executeUpdate( " insert into t values (0, 100, 'hello', 'everyone " + "is here', 200.0e0," + " 300.0e0, '1992-01-01','12:30:30',"+ "'" Timestamp.valueOf("1992-01-01 12:30:30") "')"); And I got the results fine.

          People

          • Assignee:
            Eranda Sooriyabandara
            Reporter:
            Eranda Sooriyabandara
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development