提交 4ee576d6 authored 作者: thomasmueller's avatar thomasmueller

Documentation, Javadocs, formatting

上级 5b21a636
......@@ -342,8 +342,8 @@ public abstract class Query extends Prepared {
*/
public final ResultInterface query(int limit, ResultTarget target) {
if (isUnion()) {
// union doesn't always know the parameter list of the left and right
// queries
// union doesn't always know the parameter list of the left and
// right queries
return queryWithoutCacheLazyCheck(limit, target);
}
fireBeforeSelectTriggers();
......
......@@ -1548,7 +1548,8 @@ public class JdbcConnection extends TraceObject implements Connection,
"SELECT SCOPE_IDENTITY() " +
"WHERE SCOPE_IDENTITY() IS NOT NULL", getGeneratedKeys);
ResultInterface result = getGeneratedKeys.executeQuery(0, false);
ResultSet rs = new JdbcResultSet(this, stat, getGeneratedKeys, result, id, false, true, false);
ResultSet rs = new JdbcResultSet(this, stat, getGeneratedKeys, result,
id, false, true, false);
return rs;
}
......
......@@ -1044,6 +1044,12 @@ public class JdbcStatement extends TraceObject implements Statement, JdbcStateme
executingCommand = c;
}
/**
* Called when the result set is closed.
*
* @param command the command
* @param closeCommand whether to close the command
*/
void onLazyResultSetClose(CommandInterface command, boolean closeCommand) {
setExecutingStatement(null);
command.stop();
......
......@@ -12,7 +12,7 @@ import org.h2.value.Value;
/**
* Lazy execution support for queries.
*
*
* @author Sergi Vladykin
*/
public abstract class LazyResult implements ResultInterface {
......@@ -83,7 +83,7 @@ public abstract class LazyResult implements ResultInterface {
/**
* Fetch next row or null if none available.
*
*
* @return next row or null
*/
protected abstract Value[] fetchNextRow();
......
......@@ -1067,10 +1067,21 @@ public abstract class TestBase {
}
}
/**
* Execute the statement.
*
* @param stat the statement
*/
protected void execute(PreparedStatement stat) throws SQLException {
execute(stat, null);
}
/**
* Execute the statement.
*
* @param stat the statement
* @param sql the SQL command
*/
protected void execute(Statement stat, String sql) throws SQLException {
boolean query = sql == null ? ((PreparedStatement) stat).execute() :
stat.execute(sql);
......
......@@ -189,7 +189,8 @@ public class TestCancel extends TestBase {
cancel.start();
try {
Thread.yield();
assertThrows(ErrorCode.STATEMENT_WAS_CANCELED, query, "SELECT VISIT(ID), (SELECT SUM(X) " +
assertThrows(ErrorCode.STATEMENT_WAS_CANCELED, query,
"SELECT VISIT(ID), (SELECT SUM(X) " +
"FROM SYSTEM_RANGE(1, 100000) WHERE X<>ID) FROM TEST ORDER BY ID");
} finally {
cancel.stopNow();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论