db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bryan Pendleton (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DERBY-4248) convert checkConstraint.sql to JUnit
Date Thu, 28 May 2009 15:02:45 GMT

    [ https://issues.apache.org/jira/browse/DERBY-4248?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12713998#action_12713998
] 

Bryan Pendleton commented on DERBY-4248:
----------------------------------------

Hi Eranda,

The new patch looks good, it seems like the new test is taking shape nicely.

I think that the conversion tool did not handle this section of the script very well:

prepare p1 as 'insert into t1 values 1';
prepare p2 as 'update t1 set c1 = 3 where c1 = 4';
prepare p3 as 'select * from t1';
-- the insert and update should fail, select should succeed
execute p1;
execute p2;
execute p3;

In the new JUnit test, this seemed to show up as:

+        pSt = prepareStatement(
+            "insert into t1 values 1");
+        
+        pSt = prepareStatement(
+            "update t1 set c1 = 3 where c1 = 4");
+        
+        pSt = prepareStatement(
+            "select * from t1");
+        
+        // the insert and update should fail, select should succeed
+        
+        assertStatementError("23505", pSt);
+        
+        assertStatementError("23505", pSt);
+        
+        rs = pSt.executeQuery();

I think that we should not be using the same variable for these 3 prepared statements,
instead we need to have 3 separate PreparedStatement objects.


> convert checkConstraint.sql to JUnit
> ------------------------------------
>
>                 Key: DERBY-4248
>                 URL: https://issues.apache.org/jira/browse/DERBY-4248
>             Project: Derby
>          Issue Type: Test
>          Components: Test
>    Affects Versions: 10.4.3.0
>            Reporter: Eranda Sooriyabandara
>            Assignee: Eranda Sooriyabandara
>            Priority: Minor
>             Fix For: 10.6.0.0
>
>         Attachments: CheckConstraintTest.diff, CheckConstraintTest.diff, CheckConstraintTest.diff,
CheckConstraintTest.java
>
>
> Converting CheckConstraint.sql to JUnit under supervision of Bryan Pendleton.

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


Mime
View raw message