[ http://issues.apache.org/jira/browse/DERBY-1361?page=all ]
Andreas Korneliussen updated DERBY-1361:
----------------------------------------
Attachment: DERBY-1361.diff
DERBY-1361.stat
Attaching a patch for this issue.
The patch (DERBY-1361.diff + stat) does the following: when a commit is issued,
the resultset will clear the current row. A positioned update / delete will be
prohibited until there is a fetch (reposition).
The sqlstate for the error message has been set to 24000.
The client driver will no longer do the unnecessary repositioning before
positioned updates/deletes (unnecessary since the resultset is already
positioned)
Testing: 4 new testcases added to SURTest
Some masterfiles have been hand-edited with new error message / sqlstate.
I have run the tests which have been changed, however I have not yet run
derbyall with the patch.
> positioned updates and deletes allowed after a commit without repositioning
> the cursor - if the table is indexed on the columns selected
> ----------------------------------------------------------------------------------------------------------------------------------------
>
> Key: DERBY-1361
> URL: http://issues.apache.org/jira/browse/DERBY-1361
> Project: Derby
> Type: Bug
> Components: JDBC
> Versions: 10.2.0.0
> Environment: Java 1.4
> Reporter: Andreas Korneliussen
> Assignee: Andreas Korneliussen
> Attachments: DERBY-1361.diff, DERBY-1361.stat
>
> After a commit, the cursor should be positioned before the next row (not on a
> row). However in Derby 10.2, I now see the following behavior if the table
> has an index on the selected columns:
> ij> create table t (id int primary key);
> ij> commit;
> ij> insert into t values 1,2,3,4,5,6,7,8,9;
> 9 rows inserted/updated/deleted
> ij> commit;
> ij> get cursor c1 as 'select * from t for update';
> ij> next c1;
> ID
> -----------
> 1
> ij> commit;
> ij> update t set id=id+1000 where current of c1;
> 1 row inserted/updated/deleted
> ij> commit;
> ij> update t set id=id+1000 where current of c1;
> 1 row inserted/updated/deleted
> ij>
> The expected behavior is that the UPDATE .. WHERE CURRENT OF fails with:
> ERROR 24000: Invalid cursor state - no current row.
> The problem applies to both scrollable and forward-only updatable cursors.
> Note: If the table is created *without* the index, I do see the expected
> behavior.
> I am marking this as a regression, since this issue is not reproducible on
> older, released versions of derby (I have tested with 10.1.2.1).
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira