[
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.