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 "Fernanda Pizzorno (JIRA)" <de...@db.apache.org> on 2006/05/30 13:10:29 UTC

[jira] Created: (DERBY-1356) Positioned update/delete when positioned after last or before first causes NullPointerException

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
 Assigned to: Fernanda Pizzorno 
    Priority: Minor
     Fix For: 10.2.0.0


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


[jira] Closed: (DERBY-1356) Positioned update/delete when positioned after last or before first causes NullPointerException

Posted by "Fernanda Pizzorno (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-1356?page=all ]
     
Fernanda Pizzorno closed DERBY-1356:
------------------------------------


> 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


[jira] Resolved: (DERBY-1356) Positioned update/delete when positioned after last or before first causes NullPointerException

Posted by "Knut Anders Hatlen (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-1356?page=all ]
     
Knut Anders Hatlen resolved DERBY-1356:
---------------------------------------

    Resolution: Fixed

Committed revision 411428.

> 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


[jira] Updated: (DERBY-1356) Positioned update/delete when positioned after last or before first causes NullPointerException

Posted by "Fernanda Pizzorno (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-1356?page=all ]

Fernanda Pizzorno updated DERBY-1356:
-------------------------------------

    Attachment: derby-1356.diff
                derby-1356.stat

The attached file derby-1356.diff contains a fix for this problem and a new test. I have successfully run derbyall with this patch. Can someone please review it?

Thank you in advance!

> 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


[jira] Commented: (DERBY-1356) Positioned update/delete when positioned after last or before first causes NullPointerException

Posted by "Dag H. Wanvik (JIRA)" <de...@db.apache.org>.
    [ 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