Another data point.
This also fails when using updatable result set, as could be expected
since it uses an underlying cursor:
Statement st1=conn.createStatement(ResultSet.TYPE_FORWARD_ONLY,
ResultSet.CONCUR_UPDATABLE);
st1.setCursorName("c1");
ResultSet rs = st1.executeQuery("select * from t1 for update");
rs.next();
rs.updateInt(1, rs.getInt(1));
rs.updateRow();
Caused by: ERROR 42X04: Column 'C2' is either not in any table in the FROM list
or appears within a join specification and is outside the scope of the join
specification or appears in a HAVING clause and is not in the GROUP BY list. If
this is a CREATE or ALTER TABLE statement then 'C2' is not a column in the
target table.
at
org.apache.derby.iapi.error.StandardException.newException(StandardException.java:286)
at
org.apache.derby.impl.sql.compile.ColumnReference.bindExpression(ColumnReference.java:354)
at
org.apache.derby.impl.sql.compile.BinaryOperatorNode.bindExpression(BinaryOperatorNode.java:298)
at
org.apache.derby.impl.sql.compile.BinaryComparisonOperatorNode.bindExpression(BinaryComparisonOperatorNode.java:133)
at
org.apache.derby.impl.sql.compile.UnaryOperatorNode.bindOperand(UnaryOperatorNode.java:333)
at
org.apache.derby.impl.sql.compile.TestConstraintNode.bindExpression(TestConstraintNode.java:92)
at
org.apache.derby.impl.sql.compile.BinaryOperatorNode.bindExpression(BinaryOperatorNode.java:298)
at
org.apache.derby.impl.sql.compile.BinaryLogicalOperatorNode.bindExpression(BinaryLogicalOperatorNode.java:94)
at
org.apache.derby.impl.sql.compile.AndNode.bindExpression(AndNode.java:68)
at
org.apache.derby.impl.sql.compile.DMLModStatementNode.bindRowScopedExpression(DMLModStatementNode.java:809)
at
org.apache.derby.impl.sql.compile.DMLModStatementNode.bindConstraints(DMLModStatementNode.java:735)
at
org.apache.derby.impl.sql.compile.UpdateNode.bindStatement(UpdateNode.java:618)
at
org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:316)
at
org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:80)
at
org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(GenericLanguageConnectionContext.java:831)
at
org.apache.derby.impl.jdbc.EmbedResultSet.updateRow(EmbedResultSet.java:3710)
... 1 more