提交 4bf929db authored 作者: Noel Grandin's avatar Noel Grandin

fix another TestCrashAPI failure

上级 6439c5ed
...@@ -2252,6 +2252,7 @@ public class SimpleResultSet implements ResultSet, ResultSetMetaData, ...@@ -2252,6 +2252,7 @@ public class SimpleResultSet implements ResultSet, ResultSetMetaData,
// --- private ----------------------------- // --- private -----------------------------
private void update(int columnIndex, Object obj) throws SQLException { private void update(int columnIndex, Object obj) throws SQLException {
checkClosed();
checkColumnIndex(columnIndex); checkColumnIndex(columnIndex);
this.currentRow[columnIndex - 1] = obj; this.currentRow[columnIndex - 1] = obj;
} }
...@@ -2268,6 +2269,12 @@ public class SimpleResultSet implements ResultSet, ResultSetMetaData, ...@@ -2268,6 +2269,12 @@ public class SimpleResultSet implements ResultSet, ResultSetMetaData,
getSQLException(); getSQLException();
} }
private void checkClosed() throws SQLException {
if (columns == null) {
throw DbException.get(ErrorCode.OBJECT_CLOSED).getSQLException();
}
}
private void checkColumnIndex(int columnIndex) throws SQLException { private void checkColumnIndex(int columnIndex) throws SQLException {
if (columnIndex < 1 || columnIndex > columns.size()) { if (columnIndex < 1 || columnIndex > columns.size()) {
throw DbException.getInvalidValueException( throw DbException.getInvalidValueException(
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论