Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
9a3f0ccd
提交
9a3f0ccd
authored
1月 13, 2019
作者:
Andrei Tokar
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
eliminate useless session parameter
上级
596a4bdb
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
18 行增加
和
19 行删除
+18
-19
Parser.java
h2/src/main/org/h2/command/Parser.java
+18
-19
没有找到文件。
h2/src/main/org/h2/command/Parser.java
浏览文件 @
9a3f0ccd
...
@@ -1519,8 +1519,8 @@ public class Parser {
...
@@ -1519,8 +1519,8 @@ public class Parser {
queryAlias
,
querySQLOutput
[
0
],
queryAlias
,
querySQLOutput
[
0
],
columnTemplateList
,
false
/* no recursion */
,
columnTemplateList
,
false
/* no recursion */
,
false
/* do not add to session */
,
false
/* do not add to session */
,
true
/* isTemporary */
,
true
/* isTemporary */
session
);
);
TableFilter
sourceTableFilter
=
new
TableFilter
(
session
,
TableFilter
sourceTableFilter
=
new
TableFilter
(
session
,
temporarySourceTableView
,
queryAlias
,
temporarySourceTableView
,
queryAlias
,
rightsChecked
,
(
Select
)
command
.
getQuery
(),
0
,
null
);
rightsChecked
,
(
Select
)
command
.
getQuery
(),
0
,
null
);
...
@@ -6254,7 +6254,6 @@ public class Parser {
...
@@ -6254,7 +6254,6 @@ public class Parser {
}
else
{
}
else
{
session
.
removeLocalTempTable
(
oldViewFound
);
session
.
removeLocalTempTable
(
oldViewFound
);
}
}
oldViewFound
=
null
;
}
}
/*
/*
* This table is created as a workaround because recursive table
* This table is created as a workaround because recursive table
...
@@ -6284,13 +6283,13 @@ public class Parser {
...
@@ -6284,13 +6283,13 @@ public class Parser {
querySQLOutput
[
0
],
columnTemplateList
,
querySQLOutput
[
0
],
columnTemplateList
,
true
/* allowRecursiveQueryDetection */
,
true
/* allowRecursiveQueryDetection */
,
true
/* add to session */
,
true
/* add to session */
,
isTemporary
,
session
);
isTemporary
);
}
}
private
TableView
createCTEView
(
String
cteViewName
,
String
querySQL
,
private
TableView
createCTEView
(
String
cteViewName
,
String
querySQL
,
List
<
Column
>
columnTemplateList
,
boolean
allowRecursiveQueryDetection
,
List
<
Column
>
columnTemplateList
,
boolean
allowRecursiveQueryDetection
,
boolean
addViewToSession
,
boolean
isTemporary
,
Session
targetSession
)
{
boolean
addViewToSession
,
boolean
isTemporary
)
{
Database
db
=
targetS
ession
.
getDatabase
();
Database
db
=
s
ession
.
getDatabase
();
Schema
schema
=
getSchemaWithDefault
();
Schema
schema
=
getSchemaWithDefault
();
int
id
=
db
.
allocateObjectId
();
int
id
=
db
.
allocateObjectId
();
Column
[]
columnTemplateArray
=
columnTemplateList
.
toArray
(
new
Column
[
0
]);
Column
[]
columnTemplateArray
=
columnTemplateList
.
toArray
(
new
Column
[
0
]);
...
@@ -6299,26 +6298,26 @@ public class Parser {
...
@@ -6299,26 +6298,26 @@ public class Parser {
// it twice - once without the flag set, and if we didn't see a recursive term,
// it twice - once without the flag set, and if we didn't see a recursive term,
// then we just compile it again.
// then we just compile it again.
TableView
view
;
TableView
view
;
synchronized
(
targetS
ession
)
{
synchronized
(
s
ession
)
{
view
=
new
TableView
(
schema
,
id
,
cteViewName
,
querySQL
,
view
=
new
TableView
(
schema
,
id
,
cteViewName
,
querySQL
,
parameters
,
columnTemplateArray
,
targetS
ession
,
parameters
,
columnTemplateArray
,
s
ession
,
allowRecursiveQueryDetection
,
false
/* literalsChecked */
,
true
/* isTableExpression */
,
allowRecursiveQueryDetection
,
false
/* literalsChecked */
,
true
/* isTableExpression */
,
isTemporary
);
isTemporary
);
if
(!
view
.
isRecursiveQueryDetected
()
&&
allowRecursiveQueryDetection
)
{
if
(!
view
.
isRecursiveQueryDetected
()
&&
allowRecursiveQueryDetection
)
{
if
(!
isTemporary
)
{
if
(!
isTemporary
)
{
db
.
addSchemaObject
(
targetS
ession
,
view
);
db
.
addSchemaObject
(
s
ession
,
view
);
view
.
lock
(
targetS
ession
,
true
,
true
);
view
.
lock
(
s
ession
,
true
,
true
);
db
.
removeSchemaObject
(
targetS
ession
,
view
);
db
.
removeSchemaObject
(
s
ession
,
view
);
}
else
{
}
else
{
session
.
removeLocalTempTable
(
view
);
session
.
removeLocalTempTable
(
view
);
}
}
view
=
new
TableView
(
schema
,
id
,
cteViewName
,
querySQL
,
parameters
,
view
=
new
TableView
(
schema
,
id
,
cteViewName
,
querySQL
,
parameters
,
columnTemplateArray
,
targetS
ession
,
columnTemplateArray
,
s
ession
,
false
/* assume recursive */
,
false
/* literalsChecked */
,
true
/* isTableExpression */
,
false
/* assume recursive */
,
false
/* literalsChecked */
,
true
/* isTableExpression */
,
isTemporary
);
isTemporary
);
}
}
// both removeSchemaObject and removeLocalTempTable hold meta locks
// both removeSchemaObject and removeLocalTempTable hold meta locks
db
.
unlockMeta
(
targetS
ession
);
db
.
unlockMeta
(
s
ession
);
}
}
view
.
setTableExpression
(
true
);
view
.
setTableExpression
(
true
);
view
.
setTemporary
(
isTemporary
);
view
.
setTemporary
(
isTemporary
);
...
@@ -6326,11 +6325,11 @@ public class Parser {
...
@@ -6326,11 +6325,11 @@ public class Parser {
view
.
setOnCommitDrop
(
false
);
view
.
setOnCommitDrop
(
false
);
if
(
addViewToSession
)
{
if
(
addViewToSession
)
{
if
(!
isTemporary
)
{
if
(!
isTemporary
)
{
db
.
addSchemaObject
(
targetS
ession
,
view
);
db
.
addSchemaObject
(
s
ession
,
view
);
view
.
unlock
(
targetS
ession
);
view
.
unlock
(
s
ession
);
db
.
unlockMeta
(
targetS
ession
);
db
.
unlockMeta
(
s
ession
);
}
else
{
}
else
{
targetS
ession
.
addLocalTempTable
(
view
);
s
ession
.
addLocalTempTable
(
view
);
}
}
}
}
return
view
;
return
view
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论