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

Documentation, Javadocs, formatting

上级 5b21a636
...@@ -342,8 +342,8 @@ public abstract class Query extends Prepared { ...@@ -342,8 +342,8 @@ public abstract class Query extends Prepared {
*/ */
public final ResultInterface query(int limit, ResultTarget target) { public final ResultInterface query(int limit, ResultTarget target) {
if (isUnion()) { if (isUnion()) {
// union doesn't always know the parameter list of the left and right // union doesn't always know the parameter list of the left and
// queries // right queries
return queryWithoutCacheLazyCheck(limit, target); return queryWithoutCacheLazyCheck(limit, target);
} }
fireBeforeSelectTriggers(); fireBeforeSelectTriggers();
......
...@@ -1548,7 +1548,8 @@ public class JdbcConnection extends TraceObject implements Connection, ...@@ -1548,7 +1548,8 @@ public class JdbcConnection extends TraceObject implements Connection,
"SELECT SCOPE_IDENTITY() " + "SELECT SCOPE_IDENTITY() " +
"WHERE SCOPE_IDENTITY() IS NOT NULL", getGeneratedKeys); "WHERE SCOPE_IDENTITY() IS NOT NULL", getGeneratedKeys);
ResultInterface result = getGeneratedKeys.executeQuery(0, false); 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; return rs;
} }
......
...@@ -1044,6 +1044,12 @@ public class JdbcStatement extends TraceObject implements Statement, JdbcStateme ...@@ -1044,6 +1044,12 @@ public class JdbcStatement extends TraceObject implements Statement, JdbcStateme
executingCommand = c; 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) { void onLazyResultSetClose(CommandInterface command, boolean closeCommand) {
setExecutingStatement(null); setExecutingStatement(null);
command.stop(); command.stop();
......
...@@ -1067,10 +1067,21 @@ public abstract class TestBase { ...@@ -1067,10 +1067,21 @@ public abstract class TestBase {
} }
} }
/**
* Execute the statement.
*
* @param stat the statement
*/
protected void execute(PreparedStatement stat) throws SQLException { protected void execute(PreparedStatement stat) throws SQLException {
execute(stat, null); execute(stat, null);
} }
/**
* Execute the statement.
*
* @param stat the statement
* @param sql the SQL command
*/
protected void execute(Statement stat, String sql) throws SQLException { protected void execute(Statement stat, String sql) throws SQLException {
boolean query = sql == null ? ((PreparedStatement) stat).execute() : boolean query = sql == null ? ((PreparedStatement) stat).execute() :
stat.execute(sql); stat.execute(sql);
......
...@@ -189,7 +189,8 @@ public class TestCancel extends TestBase { ...@@ -189,7 +189,8 @@ public class TestCancel extends TestBase {
cancel.start(); cancel.start();
try { try {
Thread.yield(); 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"); "FROM SYSTEM_RANGE(1, 100000) WHERE X<>ID) FROM TEST ORDER BY ID");
} finally { } finally {
cancel.stopNow(); cancel.stopNow();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论