[ http://issues.apache.org/jira/browse/DERBY-1356?page=comments#action_12414540 ]
Dag H. Wanvik commented on DERBY-1356: -------------------------------------- This is a simple patch which adds handling of the two exceptional cases indicated in the title of this issue. I have verified that the added test reveals the error before the fix code is added. I recommend it for commit. > Positioned update/delete when positioned after last or before first causes > NullPointerException > ----------------------------------------------------------------------------------------------- > > Key: DERBY-1356 > URL: http://issues.apache.org/jira/browse/DERBY-1356 > Project: Derby > Type: Bug > Components: JDBC > Versions: 10.2.0.0 > Reporter: Fernanda Pizzorno > Assignee: Fernanda Pizzorno > Priority: Minor > Fix For: 10.2.0.0 > Attachments: derby-1356.diff, derby-1356.stat > > ij version 10.2 > ij> connect 'jdbc:derby:SURTest;create=true'; > ij> autocommit off; > ij> create table t1 (c1 int primary key, c2 int); > 0 rows inserted/updated/deleted > ij> insert into t1 values (1, 1), (2, 2), (3, 3), (4, 4), (5, 5), (6, 6), (7, > 7), (8, 8), (9, 9), (10, 10); > 10 rows inserted/updated/deleted > ij> get scroll insensitive cursor sc1 as 'SELECT * FROM t1 FOR UPDATE'; > ij> after last sc1; > No current row > ij> update t1 set c2 = c1 + 20 where current of sc1; > ERROR XJ001: Java exception: ': java.lang.NullPointerException'. > ij> before first sc1; > No current row > ij> update t1 set c2 = c1 + 20 where current of sc1; > ERROR XJ001: Java exception: ': java.lang.NullPointerException'. > ij> after last sc1; > No current row > ij> delete from t1 where current of sc1; > ERROR XJ001: Java exception: ': java.lang.NullPointerException'. > ij> before first sc1; > No current row > ij> delete from t1 where current of sc1; > ERROR XJ001: Java exception: ': java.lang.NullPointerException'. > ij> close sc1; -- 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
