Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
9ad1ffae
提交
9ad1ffae
authored
11月 08, 2015
作者:
S.Vladykin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Switched to use linked list like approach + allow to get info from upper levels
上级
bd37e682
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
17 行增加
和
15 行删除
+17
-15
Session.java
h2/src/main/org/h2/engine/Session.java
+4
-11
ViewIndex.java
h2/src/main/org/h2/index/ViewIndex.java
+5
-3
SubQueryInfo.java
h2/src/main/org/h2/table/SubQueryInfo.java
+8
-1
没有找到文件。
h2/src/main/org/h2/engine/Session.java
浏览文件 @
9ad1ffae
...
@@ -5,7 +5,6 @@
...
@@ -5,7 +5,6 @@
*/
*/
package
org
.
h2
.
engine
;
package
org
.
h2
.
engine
;
import
java.util.ArrayDeque
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.HashSet
;
import
java.util.HashSet
;
...
@@ -110,7 +109,7 @@ public class Session extends SessionWithState {
...
@@ -110,7 +109,7 @@ public class Session extends SessionWithState {
private
final
int
queryCacheSize
;
private
final
int
queryCacheSize
;
private
SmallLRUCache
<
String
,
Command
>
queryCache
;
private
SmallLRUCache
<
String
,
Command
>
queryCache
;
private
long
modificationMetaID
=
-
1
;
private
long
modificationMetaID
=
-
1
;
private
ArrayDeque
<
SubQueryInfo
>
subQueryInfoStack
=
new
ArrayDeque
<
SubQueryInfo
>()
;
private
SubQueryInfo
subQueryInfo
;
private
int
parsingView
;
private
int
parsingView
;
/**
/**
...
@@ -145,18 +144,12 @@ public class Session extends SessionWithState {
...
@@ -145,18 +144,12 @@ public class Session extends SessionWithState {
this
.
currentSchemaName
=
Constants
.
SCHEMA_MAIN
;
this
.
currentSchemaName
=
Constants
.
SCHEMA_MAIN
;
}
}
public
void
pushSubQueryInfo
(
SubQueryInfo
subQueryInfo
)
{
public
void
setSubQueryInfo
(
SubQueryInfo
subQueryInfo
)
{
assert
subQueryInfo
!=
null
;
this
.
subQueryInfo
=
subQueryInfo
;
subQueryInfoStack
.
addLast
(
subQueryInfo
);
}
public
void
popSubQueryInfo
(
SubQueryInfo
subQueryInfo
)
{
SubQueryInfo
popped
=
subQueryInfoStack
.
pollLast
();
assert
popped
==
subQueryInfo
;
}
}
public
SubQueryInfo
getSubQueryInfo
()
{
public
SubQueryInfo
getSubQueryInfo
()
{
return
subQueryInfo
Stack
.
peekLast
()
;
return
subQueryInfo
;
}
}
public
void
setParsingView
(
boolean
parsingView
)
{
public
void
setParsingView
(
boolean
parsingView
)
{
...
...
h2/src/main/org/h2/index/ViewIndex.java
浏览文件 @
9ad1ffae
...
@@ -198,12 +198,14 @@ public class ViewIndex extends BaseIndex implements SpatialIndex {
...
@@ -198,12 +198,14 @@ public class ViewIndex extends BaseIndex implements SpatialIndex {
private
static
Query
prepareSubQuery
(
String
sql
,
Session
session
,
int
[]
masks
,
private
static
Query
prepareSubQuery
(
String
sql
,
Session
session
,
int
[]
masks
,
TableFilter
[]
filters
,
int
filter
,
SortOrder
sortOrder
,
boolean
preliminary
)
{
TableFilter
[]
filters
,
int
filter
,
SortOrder
sortOrder
,
boolean
preliminary
)
{
Prepared
p
;
Prepared
p
;
SubQueryInfo
info
=
new
SubQueryInfo
(
masks
,
filters
,
filter
,
sortOrder
,
preliminary
);
SubQueryInfo
upper
=
session
.
getSubQueryInfo
();
session
.
pushSubQueryInfo
(
info
);
SubQueryInfo
info
=
new
SubQueryInfo
(
upper
,
masks
,
filters
,
filter
,
sortOrder
,
preliminary
);
session
.
setSubQueryInfo
(
info
);
try
{
try
{
p
=
session
.
prepare
(
sql
,
true
);
p
=
session
.
prepare
(
sql
,
true
);
}
finally
{
}
finally
{
session
.
popSubQueryInfo
(
info
);
session
.
setSubQueryInfo
(
upper
);
}
}
return
(
Query
)
p
;
return
(
Query
)
p
;
}
}
...
...
h2/src/main/org/h2/table/SubQueryInfo.java
浏览文件 @
9ad1ffae
...
@@ -20,8 +20,10 @@ public class SubQueryInfo {
...
@@ -20,8 +20,10 @@ public class SubQueryInfo {
private
int
filter
;
private
int
filter
;
private
SortOrder
sortOrder
;
private
SortOrder
sortOrder
;
private
boolean
preliminary
;
private
boolean
preliminary
;
private
SubQueryInfo
upper
;
/**
/**
* @param upper upper level sub-query if any
* @param masks index conditions masks
* @param masks index conditions masks
* @param filters table filters
* @param filters table filters
* @param filter current filter
* @param filter current filter
...
@@ -29,8 +31,9 @@ public class SubQueryInfo {
...
@@ -29,8 +31,9 @@ public class SubQueryInfo {
* @param preliminary if this is a preliminary query optimization
* @param preliminary if this is a preliminary query optimization
* without global conditions
* without global conditions
*/
*/
public
SubQueryInfo
(
int
[]
masks
,
TableFilter
[]
filters
,
int
filter
,
public
SubQueryInfo
(
SubQueryInfo
upper
,
int
[]
masks
,
TableFilter
[]
filters
,
int
filter
,
SortOrder
sortOrder
,
boolean
preliminary
)
{
SortOrder
sortOrder
,
boolean
preliminary
)
{
this
.
upper
=
upper
;
this
.
masks
=
masks
;
this
.
masks
=
masks
;
this
.
filters
=
filters
;
this
.
filters
=
filters
;
this
.
filter
=
filter
;
this
.
filter
=
filter
;
...
@@ -38,6 +41,10 @@ public class SubQueryInfo {
...
@@ -38,6 +41,10 @@ public class SubQueryInfo {
this
.
preliminary
=
preliminary
;
this
.
preliminary
=
preliminary
;
}
}
public
SubQueryInfo
getUpper
()
{
return
upper
;
}
public
int
[]
getMasks
()
{
public
int
[]
getMasks
()
{
return
masks
;
return
masks
;
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论