Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
728d18f2
提交
728d18f2
authored
11月 29, 2015
作者:
S.Vladykin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
JoinBatch.reset called after query as well as before to cleanup resources immediately
上级
6b374192
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
33 行增加
和
22 行删除
+33
-22
Select.java
h2/src/main/org/h2/command/dml/Select.java
+17
-10
IndexLookupBatch.java
h2/src/main/org/h2/index/IndexLookupBatch.java
+4
-2
JoinBatch.java
h2/src/main/org/h2/table/JoinBatch.java
+10
-8
TableFilter.java
h2/src/main/org/h2/table/TableFilter.java
+1
-1
TestTableEngines.java
h2/src/test/org/h2/test/db/TestTableEngines.java
+1
-1
没有找到文件。
h2/src/main/org/h2/command/dml/Select.java
浏览文件 @
728d18f2
...
...
@@ -639,18 +639,25 @@ public class Select extends Query {
topTableFilter
.
lock
(
session
,
exclusive
,
exclusive
);
ResultTarget
to
=
result
!=
null
?
result
:
target
;
if
(
limitRows
!=
0
)
{
if
(
isQuickAggregateQuery
)
{
queryQuick
(
columnCount
,
to
);
}
else
if
(
isGroupQuery
)
{
if
(
isGroupSortedQuery
)
{
queryGroupSorted
(
columnCount
,
to
);
try
{
if
(
isQuickAggregateQuery
)
{
queryQuick
(
columnCount
,
to
);
}
else
if
(
isGroupQuery
)
{
if
(
isGroupSortedQuery
)
{
queryGroupSorted
(
columnCount
,
to
);
}
else
{
queryGroup
(
columnCount
,
result
);
}
}
else
if
(
isDistinctQuery
)
{
queryDistinct
(
to
,
limitRows
);
}
else
{
queryGroup
(
columnCount
,
result
);
queryFlat
(
columnCount
,
to
,
limitRows
);
}
}
finally
{
JoinBatch
jb
=
getJoinBatch
();
if
(
jb
!=
null
)
{
jb
.
reset
(
false
);
}
}
else
if
(
isDistinctQuery
)
{
queryDistinct
(
to
,
limitRows
);
}
else
{
queryFlat
(
columnCount
,
to
,
limitRows
);
}
}
if
(
offsetExpr
!=
null
)
{
...
...
h2/src/main/org/h2/index/IndexLookupBatch.java
浏览文件 @
728d18f2
...
...
@@ -59,7 +59,9 @@ public interface IndexLookupBatch {
String
getPlanSQL
();
/**
* Reset this batch to clear state. This method will be called before each query execution.
* Reset this batch to clear state. This method will be called before and after each query execution.
*
* @param beforeQuery if it is being called before query execution
*/
void
reset
();
void
reset
(
boolean
beforeQuery
);
}
h2/src/main/org/h2/table/JoinBatch.java
浏览文件 @
728d18f2
...
...
@@ -107,15 +107,17 @@ public final class JoinBatch {
/**
* Reset state of this batch.
*
* @param beforeQuery {@code true} if reset was called before the query run, {@code false} if after
*/
public
void
reset
()
{
public
void
reset
(
boolean
beforeQuery
)
{
current
=
null
;
started
=
false
;
found
=
false
;
for
(
JoinFilter
jf
:
filters
)
{
jf
.
reset
();
jf
.
reset
(
beforeQuery
);
}
if
(
additionalFilter
!=
null
)
{
if
(
beforeQuery
&&
additionalFilter
!=
null
)
{
additionalFilter
.
reset
();
}
}
...
...
@@ -423,9 +425,9 @@ public final class JoinBatch {
assert
lookupBatch
!=
null
||
id
==
0
;
}
private
void
reset
()
{
private
void
reset
(
boolean
beforeQuery
)
{
if
(
lookupBatch
!=
null
)
{
lookupBatch
.
reset
();
lookupBatch
.
reset
(
beforeQuery
);
}
}
...
...
@@ -659,7 +661,7 @@ public final class JoinBatch {
}
@Override
public
void
reset
()
{
public
void
reset
(
boolean
beforeQuery
)
{
full
=
false
;
first
=
last
=
null
;
result
.
set
(
0
,
null
);
...
...
@@ -783,11 +785,11 @@ public final class JoinBatch {
}
@Override
public
void
reset
()
{
public
void
reset
(
boolean
beforeQuery
)
{
if
(
resultSize
!=
0
&&
!
resetAfterFind
())
{
// find was not called, need to just clear runners
for
(
int
i
=
0
;
i
<
resultSize
;
i
++)
{
((
QueryRunnerBase
)
result
.
get
(
i
)
).
clear
();
queryRunner
(
i
).
clear
();
}
resultSize
=
0
;
}
...
...
h2/src/main/org/h2/table/TableFilter.java
浏览文件 @
728d18f2
...
...
@@ -328,7 +328,7 @@ public class TableFilter implements ColumnResolver {
public
void
reset
()
{
if
(
joinBatch
!=
null
&&
joinFilterId
==
0
)
{
// reset join batch only on top table filter
joinBatch
.
reset
();
joinBatch
.
reset
(
true
);
return
;
}
if
(
nestedJoin
!=
null
)
{
...
...
h2/src/test/org/h2/test/db/TestTableEngines.java
浏览文件 @
728d18f2
...
...
@@ -1344,7 +1344,7 @@ public class TestTableEngines extends TestBase {
}
@Override
public
void
reset
()
{
public
void
reset
(
boolean
beforeQuery
)
{
searchRows
.
clear
();
}
};
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论