Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
4ee576d6
提交
4ee576d6
authored
4月 23, 2017
作者:
thomasmueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Documentation, Javadocs, formatting
上级
5b21a636
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
25 行增加
和
6 行删除
+25
-6
Query.java
h2/src/main/org/h2/command/dml/Query.java
+2
-2
JdbcConnection.java
h2/src/main/org/h2/jdbc/JdbcConnection.java
+2
-1
JdbcStatement.java
h2/src/main/org/h2/jdbc/JdbcStatement.java
+6
-0
LazyResult.java
h2/src/main/org/h2/result/LazyResult.java
+2
-2
TestBase.java
h2/src/test/org/h2/test/TestBase.java
+11
-0
TestCancel.java
h2/src/test/org/h2/test/jdbc/TestCancel.java
+2
-1
没有找到文件。
h2/src/main/org/h2/command/dml/Query.java
浏览文件 @
4ee576d6
...
@@ -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
();
...
...
h2/src/main/org/h2/jdbc/JdbcConnection.java
浏览文件 @
4ee576d6
...
@@ -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
;
}
}
...
...
h2/src/main/org/h2/jdbc/JdbcStatement.java
浏览文件 @
4ee576d6
...
@@ -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
();
...
...
h2/src/main/org/h2/result/LazyResult.java
浏览文件 @
4ee576d6
...
@@ -12,7 +12,7 @@ import org.h2.value.Value;
...
@@ -12,7 +12,7 @@ import org.h2.value.Value;
/**
/**
* Lazy execution support for queries.
* Lazy execution support for queries.
*
*
* @author Sergi Vladykin
* @author Sergi Vladykin
*/
*/
public
abstract
class
LazyResult
implements
ResultInterface
{
public
abstract
class
LazyResult
implements
ResultInterface
{
...
@@ -83,7 +83,7 @@ public abstract class LazyResult implements ResultInterface {
...
@@ -83,7 +83,7 @@ public abstract class LazyResult implements ResultInterface {
/**
/**
* Fetch next row or null if none available.
* Fetch next row or null if none available.
*
*
* @return next row or null
* @return next row or null
*/
*/
protected
abstract
Value
[]
fetchNextRow
();
protected
abstract
Value
[]
fetchNextRow
();
...
...
h2/src/test/org/h2/test/TestBase.java
浏览文件 @
4ee576d6
...
@@ -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
);
...
...
h2/src/test/org/h2/test/jdbc/TestCancel.java
浏览文件 @
4ee576d6
...
@@ -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
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论