You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Ramandeep Kaur (JIRA)" <ji...@apache.org> on 2007/04/03 02:40:32 UTC

[jira] Created: (DERBY-2517) convert lang/forupdate.sql to junit

convert  lang/forupdate.sql to junit
------------------------------------

                 Key: DERBY-2517
                 URL: https://issues.apache.org/jira/browse/DERBY-2517
             Project: Derby
          Issue Type: Test
          Components: Test
            Reporter: Ramandeep Kaur
         Assigned To: Ramandeep Kaur
            Priority: Minor
             Fix For: 10.3.0.0


convert  lang/forupdate.sql to junit

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-2517) convert lang/forupdate.sql to junit

Posted by "Ramandeep Kaur (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2517?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ramandeep Kaur updated DERBY-2517:
----------------------------------

    Derby Info: [Patch Available]

> convert  lang/forupdate.sql to junit
> ------------------------------------
>
>                 Key: DERBY-2517
>                 URL: https://issues.apache.org/jira/browse/DERBY-2517
>             Project: Derby
>          Issue Type: Test
>          Components: Test
>            Reporter: Ramandeep Kaur
>         Assigned To: Ramandeep Kaur
>            Priority: Minor
>             Fix For: 10.3.0.0
>
>         Attachments: DERBY-2517.diff
>
>
> convert  lang/forupdate.sql to junit

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (DERBY-2517) convert lang/forupdate.sql to junit

Posted by "Ramandeep Kaur (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2517?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ramandeep Kaur closed DERBY-2517.
---------------------------------


> convert  lang/forupdate.sql to junit
> ------------------------------------
>
>                 Key: DERBY-2517
>                 URL: https://issues.apache.org/jira/browse/DERBY-2517
>             Project: Derby
>          Issue Type: Test
>          Components: Test
>            Reporter: Ramandeep Kaur
>         Assigned To: Ramandeep Kaur
>            Priority: Minor
>             Fix For: 10.3.0.0
>
>         Attachments: DERBY-2517.diff, DERBY_2517-0419.diff, DERBY_2517.stat
>
>
> convert  lang/forupdate.sql to junit

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-2517) convert lang/forupdate.sql to junit

Posted by "Kathey Marsden (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2517?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kathey Marsden updated DERBY-2517:
----------------------------------

    Derby Info:   (was: [Patch Available])

> convert  lang/forupdate.sql to junit
> ------------------------------------
>
>                 Key: DERBY-2517
>                 URL: https://issues.apache.org/jira/browse/DERBY-2517
>             Project: Derby
>          Issue Type: Test
>          Components: Test
>            Reporter: Ramandeep Kaur
>         Assigned To: Ramandeep Kaur
>            Priority: Minor
>             Fix For: 10.3.0.0
>
>         Attachments: DERBY-2517.diff
>
>
> convert  lang/forupdate.sql to junit

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-2517) convert lang/forupdate.sql to junit

Posted by "Ramandeep Kaur (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2517?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ramandeep Kaur updated DERBY-2517:
----------------------------------

    Derby Info: [Patch Available]

> convert  lang/forupdate.sql to junit
> ------------------------------------
>
>                 Key: DERBY-2517
>                 URL: https://issues.apache.org/jira/browse/DERBY-2517
>             Project: Derby
>          Issue Type: Test
>          Components: Test
>            Reporter: Ramandeep Kaur
>         Assigned To: Ramandeep Kaur
>            Priority: Minor
>             Fix For: 10.3.0.0
>
>         Attachments: DERBY-2517.diff, DERBY_2517-0419.diff, DERBY_2517.stat
>
>
> convert  lang/forupdate.sql to junit

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (DERBY-2517) convert lang/forupdate.sql to junit

Posted by "Ramandeep Kaur (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2517?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ramandeep Kaur resolved DERBY-2517.
-----------------------------------

    Resolution: Fixed

> convert  lang/forupdate.sql to junit
> ------------------------------------
>
>                 Key: DERBY-2517
>                 URL: https://issues.apache.org/jira/browse/DERBY-2517
>             Project: Derby
>          Issue Type: Test
>          Components: Test
>            Reporter: Ramandeep Kaur
>         Assigned To: Ramandeep Kaur
>            Priority: Minor
>             Fix For: 10.3.0.0
>
>         Attachments: DERBY-2517.diff, DERBY_2517-0419.diff, DERBY_2517.stat
>
>
> convert  lang/forupdate.sql to junit

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-2517) convert lang/forupdate.sql to junit

Posted by "Kathey Marsden (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2517?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12489840 ] 

Kathey Marsden commented on DERBY-2517:
---------------------------------------

Thanks Raman for the patch.

I have not seen the stmt and connection set as instance variables.  Typically I see each fixture call getConnection or createStatement as needed.  I don't know if this is a problem, but just something I noticed.

With the new patch can you also submit a file with the stat output?

The issue with the delete statement is because the cursor C4  is closed, first by JDBC.assertSingleValueResultSet(rs, "1"); and then again by rs.close().   The following edits should make it pass.

    public void testUpdates2() throws SQLException {	
		stmt.executeUpdate("insert into t1 (i) values (1)");
		stmt.setCursorName("C4");
		ResultSet rs = stmt.executeQuery("select i from t1 s1 for update");
                rs.next();
	
		Statement stmt2 = createStatement();
		try {
			stmt2.executeUpdate("delete from s1 where current of C4");
			fail("ForUpdateTest: should have thrown exception");
		} catch (SQLException e) {
                       
				assertSQLState("42X28", e);
			
		}
		

		Statement stmt3 = createStatement();
		stmt3.executeUpdate("delete from t1 where current of C4");
		stmt3.executeUpdate("delete from t1");

                rs.close();
                ...


Thanks

Kathey







> convert  lang/forupdate.sql to junit
> ------------------------------------
>
>                 Key: DERBY-2517
>                 URL: https://issues.apache.org/jira/browse/DERBY-2517
>             Project: Derby
>          Issue Type: Test
>          Components: Test
>            Reporter: Ramandeep Kaur
>         Assigned To: Ramandeep Kaur
>            Priority: Minor
>             Fix For: 10.3.0.0
>
>         Attachments: DERBY-2517.diff
>
>
> convert  lang/forupdate.sql to junit

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-2517) convert lang/forupdate.sql to junit

Posted by "Ramandeep Kaur (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2517?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ramandeep Kaur updated DERBY-2517:
----------------------------------

    Attachment: DERBY-2517.diff

I am attaching patch for conversion of forupdate.sql to junit test "ForUpdateTest.java". 

I am having one problem during conversion.
In method "public void testUpdates2()" in ForUpdateTest.java file, whenever, I uncomment line stmt3.executeUpdate("delete from t1 where current of C4");, I get the following error.
.......E..........E...
Time: 38.224
There were 2 errors:
1) testUpdates2(org.apache.derbyTesting.functionTests.tests.lang.ForUpdateTest)java.sql.SQLException: Cursor 'C4' not found. Verify that autocommit is OFF.
        at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
        at org.apache.derby.impl.sql.compile.CurrentOfNode.bindNonVTITables(Unknown Source)
        at org.apache.derby.impl.sql.compile.FromList.bindTables(Unknown Source)
        at org.apache.derby.impl.sql.compile.SelectNode.bindNonVTITables(Unknown Source)
        at org.apache.derby.impl.sql.compile.DMLStatementNode.bindTables(Unknown Source)
        at org.apache.derby.impl.sql.compile.DeleteNode.bindStatement(Unknown Source)
        at org.apache.derby.impl.sql.GenericStatement.prepMinion(Unknown Source)
        at org.apache.derby.impl.sql.GenericStatement.prepare(Unknown Source)
        at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedStatement.executeUpdate(Unknown Source)
        at org.apache.derbyTesting.functionTests.tests.lang.ForUpdateTest.testUpdates2(ForUpdateTest.java:232)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:88)
        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)
2) testUpdates2(org.apache.derbyTesting.functionTests.tests.lang.ForUpdateTest)java.sql.SQLException: Invalid cursor name 'C4'.
        at org.apache.derby.client.am.SQLExceptionFactory.getSQLException(Unknown Source)
        at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
        at org.apache.derby.client.am.Statement.executeUpdate(Unknown Source)
        at org.apache.derbyTesting.functionTests.tests.lang.ForUpdateTest.testUpdates2(ForUpdateTest.java:232)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:88)
        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 junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
        at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
        at junit.extensions.TestSetup.run(TestSetup.java:23)
Caused by: org.apache.derby.client.am.SqlException: Invalid cursor name 'C4'.
        at org.apache.derby.client.am.Statement.flowExecute(Unknown Source)
        at org.apache.derby.client.am.Statement.executeUpdateX(Unknown Source)
        ... 34 more

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


> convert  lang/forupdate.sql to junit
> ------------------------------------
>
>                 Key: DERBY-2517
>                 URL: https://issues.apache.org/jira/browse/DERBY-2517
>             Project: Derby
>          Issue Type: Test
>          Components: Test
>            Reporter: Ramandeep Kaur
>         Assigned To: Ramandeep Kaur
>            Priority: Minor
>             Fix For: 10.3.0.0
>
>         Attachments: DERBY-2517.diff
>
>
> convert  lang/forupdate.sql to junit

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-2517) convert lang/forupdate.sql to junit

Posted by "Ramandeep Kaur (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2517?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ramandeep Kaur updated DERBY-2517:
----------------------------------

    Attachment: DERBY_2517.stat
                DERBY_2517-0419.diff

Kathy, thanks for your feedback.
I have incorporated your suggestions and tests runs successfully now.

Thanks, Raman

> convert  lang/forupdate.sql to junit
> ------------------------------------
>
>                 Key: DERBY-2517
>                 URL: https://issues.apache.org/jira/browse/DERBY-2517
>             Project: Derby
>          Issue Type: Test
>          Components: Test
>            Reporter: Ramandeep Kaur
>         Assigned To: Ramandeep Kaur
>            Priority: Minor
>             Fix For: 10.3.0.0
>
>         Attachments: DERBY-2517.diff, DERBY_2517-0419.diff, DERBY_2517.stat
>
>
> convert  lang/forupdate.sql to junit

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-2517) convert lang/forupdate.sql to junit

Posted by "Kathey Marsden (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2517?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kathey Marsden updated DERBY-2517:
----------------------------------

    Derby Info:   (was: [Patch Available])

The patch was committed with 530946/48


> convert  lang/forupdate.sql to junit
> ------------------------------------
>
>                 Key: DERBY-2517
>                 URL: https://issues.apache.org/jira/browse/DERBY-2517
>             Project: Derby
>          Issue Type: Test
>          Components: Test
>            Reporter: Ramandeep Kaur
>         Assigned To: Ramandeep Kaur
>            Priority: Minor
>             Fix For: 10.3.0.0
>
>         Attachments: DERBY-2517.diff, DERBY_2517-0419.diff, DERBY_2517.stat
>
>
> convert  lang/forupdate.sql to junit

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.