[
http://issues.apache.org/jira/browse/DERBY-1322?page=comments#action_12412454 ]
Dag H. Wanvik commented on DERBY-1322:
--------------------------------------
The patch looks good. I verified that the changed SURTest.java exposes the
problem
when run without the rest of the patch, and is OK after code changes.
Just a few comments:
*ResultSet.java
- relativeX
if (isOnInsertRow_) {
moveToCurrentRowX();
}
:
// this method may not be called when the cursor on the insert row
if (isOnInsertRow_) {
throw new SqlException(agent_.logWriter_,
new
ClientMessageId(SQLState.CURSOR_INVALID_OPERATION_AT_CURRENT_POSITION));
}
The latter "if" can now be removed.
- Since the method moveToCurrentRowX checks against isOnInsertRow_, I think
you could remove the (redundant) tests in the <position>X methods, e.g.
here in nextX:
if (isOnInsertRow_) {
moveToCurrentRowX();
}
->
moveToCurrentRowX();
- typo in comment in moveToCurrentRowX: // no affect
It should be "effect", but I would omit this comment, as it's
obvious.
* SURTest.java
- testInsertRowWithScrollCursor:
Statement s should be closed at end.
> s.setCursorName(getNextCursorName());
I don't believe this is necessary; I suspect in SURTest.java, the
cursor was named explicitly due to DERBY-787, but this has been
fixed now.
> Missing resets of isOnInsertRow state in net client when navigating away via
> other than ResultSet#next
> ------------------------------------------------------------------------------------------------------
>
> Key: DERBY-1322
> URL: http://issues.apache.org/jira/browse/DERBY-1322
> Project: Derby
> Type: Bug
> Components: JDBC, Network Client
> Versions: 10.2.0.0
> Reporter: Dag H. Wanvik
> Assignee: Fernanda Pizzorno
> Priority: Minor
> Fix For: 10.2.0.0
> Attachments: Repro.java, derby-1322.diff, derby-1322.stat
>
> Please see the enclosed repro program.
> When attempting the deleteRow, it will fail with SQL state 24000 "no
> current row", since the first() call doesn't properly reset the
> IsOnInsertRow_ state. By inspection of ../am/ResultSet.java I found
> the other positioning calls beside next and moveToCurrentRow to suffer
> the same problem.
--
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