Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
b4d4c796
Unverified
提交
b4d4c796
authored
7 年前
作者:
Noel Grandin
提交者:
GitHub
7 年前
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #904 from katzyn/join
Remove unused parameters from readJoin() and readTableFilter()
上级
801913db
371783fa
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
16 行增加
和
17 行删除
+16
-17
Parser.java
h2/src/main/org/h2/command/Parser.java
+16
-17
没有找到文件。
h2/src/main/org/h2/command/Parser.java
浏览文件 @
b4d4c796
...
@@ -1348,7 +1348,7 @@ public class Parser {
...
@@ -1348,7 +1348,7 @@ public class Parser {
return
command
;
return
command
;
}
}
private
TableFilter
readTableFilter
(
boolean
fromOuter
)
{
private
TableFilter
readTableFilter
()
{
Table
table
;
Table
table
;
String
alias
=
null
;
String
alias
=
null
;
if
(
readIf
(
"("
))
{
if
(
readIf
(
"("
))
{
...
@@ -1368,8 +1368,8 @@ public class Parser {
...
@@ -1368,8 +1368,8 @@ public class Parser {
query
,
currentSelect
);
query
,
currentSelect
);
}
else
{
}
else
{
TableFilter
top
;
TableFilter
top
;
top
=
readTableFilter
(
false
);
top
=
readTableFilter
();
top
=
readJoin
(
top
,
currentSelect
,
false
,
false
);
top
=
readJoin
(
top
,
false
);
top
=
getNested
(
top
);
top
=
getNested
(
top
);
read
(
")"
);
read
(
")"
);
alias
=
readFromAlias
(
null
);
alias
=
readFromAlias
(
null
);
...
@@ -1717,8 +1717,7 @@ public class Parser {
...
@@ -1717,8 +1717,7 @@ public class Parser {
return
command
;
return
command
;
}
}
private
TableFilter
readJoin
(
TableFilter
top
,
Select
command
,
private
TableFilter
readJoin
(
TableFilter
top
,
boolean
nested
)
{
boolean
nested
,
boolean
fromOuter
)
{
boolean
joined
=
false
;
boolean
joined
=
false
;
TableFilter
last
=
top
;
TableFilter
last
=
top
;
while
(
true
)
{
while
(
true
)
{
...
@@ -1727,8 +1726,8 @@ public class Parser {
...
@@ -1727,8 +1726,8 @@ public class Parser {
readIf
(
"OUTER"
);
readIf
(
"OUTER"
);
read
(
"JOIN"
);
read
(
"JOIN"
);
// the right hand side is the 'inner' table usually
// the right hand side is the 'inner' table usually
join
=
readTableFilter
(
fromOuter
);
join
=
readTableFilter
();
join
=
readJoin
(
join
,
command
,
nested
,
true
);
join
=
readJoin
(
join
,
nested
);
Expression
on
=
null
;
Expression
on
=
null
;
if
(
readIf
(
"ON"
))
{
if
(
readIf
(
"ON"
))
{
on
=
readExpression
();
on
=
readExpression
();
...
@@ -1739,8 +1738,8 @@ public class Parser {
...
@@ -1739,8 +1738,8 @@ public class Parser {
}
else
if
(
readIf
(
"LEFT"
))
{
}
else
if
(
readIf
(
"LEFT"
))
{
readIf
(
"OUTER"
);
readIf
(
"OUTER"
);
read
(
"JOIN"
);
read
(
"JOIN"
);
join
=
readTableFilter
(
true
);
join
=
readTableFilter
();
join
=
readJoin
(
join
,
command
,
true
,
true
);
join
=
readJoin
(
join
,
true
);
Expression
on
=
null
;
Expression
on
=
null
;
if
(
readIf
(
"ON"
))
{
if
(
readIf
(
"ON"
))
{
on
=
readExpression
();
on
=
readExpression
();
...
@@ -1750,16 +1749,16 @@ public class Parser {
...
@@ -1750,16 +1749,16 @@ public class Parser {
throw
getSyntaxError
();
throw
getSyntaxError
();
}
else
if
(
readIf
(
"INNER"
))
{
}
else
if
(
readIf
(
"INNER"
))
{
read
(
"JOIN"
);
read
(
"JOIN"
);
join
=
readTableFilter
(
fromOuter
);
join
=
readTableFilter
();
top
=
readJoin
(
top
,
command
,
false
,
false
);
top
=
readJoin
(
top
,
false
);
Expression
on
=
null
;
Expression
on
=
null
;
if
(
readIf
(
"ON"
))
{
if
(
readIf
(
"ON"
))
{
on
=
readExpression
();
on
=
readExpression
();
}
}
top
.
addJoin
(
join
,
false
,
false
,
on
);
top
.
addJoin
(
join
,
false
,
false
,
on
);
}
else
if
(
readIf
(
"JOIN"
))
{
}
else
if
(
readIf
(
"JOIN"
))
{
join
=
readTableFilter
(
fromOuter
);
join
=
readTableFilter
();
top
=
readJoin
(
top
,
command
,
false
,
false
);
top
=
readJoin
(
top
,
false
);
Expression
on
=
null
;
Expression
on
=
null
;
if
(
readIf
(
"ON"
))
{
if
(
readIf
(
"ON"
))
{
on
=
readExpression
();
on
=
readExpression
();
...
@@ -1767,11 +1766,11 @@ public class Parser {
...
@@ -1767,11 +1766,11 @@ public class Parser {
top
.
addJoin
(
join
,
false
,
false
,
on
);
top
.
addJoin
(
join
,
false
,
false
,
on
);
}
else
if
(
readIf
(
"CROSS"
))
{
}
else
if
(
readIf
(
"CROSS"
))
{
read
(
"JOIN"
);
read
(
"JOIN"
);
join
=
readTableFilter
(
fromOuter
);
join
=
readTableFilter
();
top
.
addJoin
(
join
,
false
,
false
,
null
);
top
.
addJoin
(
join
,
false
,
false
,
null
);
}
else
if
(
readIf
(
"NATURAL"
))
{
}
else
if
(
readIf
(
"NATURAL"
))
{
read
(
"JOIN"
);
read
(
"JOIN"
);
join
=
readTableFilter
(
fromOuter
);
join
=
readTableFilter
();
Column
[]
tableCols
=
last
.
getTable
().
getColumns
();
Column
[]
tableCols
=
last
.
getTable
().
getColumns
();
Column
[]
joinCols
=
join
.
getTable
().
getColumns
();
Column
[]
joinCols
=
join
.
getTable
().
getColumns
();
String
tableSchema
=
last
.
getTable
().
getSchema
().
getName
();
String
tableSchema
=
last
.
getTable
().
getSchema
().
getName
();
...
@@ -2105,7 +2104,7 @@ public class Parser {
...
@@ -2105,7 +2104,7 @@ public class Parser {
private
void
parseSelectSimpleFromPart
(
Select
command
)
{
private
void
parseSelectSimpleFromPart
(
Select
command
)
{
do
{
do
{
TableFilter
filter
=
readTableFilter
(
false
);
TableFilter
filter
=
readTableFilter
();
parseJoinTableFilter
(
filter
,
command
);
parseJoinTableFilter
(
filter
,
command
);
}
while
(
readIf
(
","
));
}
while
(
readIf
(
","
));
...
@@ -2150,7 +2149,7 @@ public class Parser {
...
@@ -2150,7 +2149,7 @@ public class Parser {
}
}
private
void
parseJoinTableFilter
(
TableFilter
top
,
final
Select
command
)
{
private
void
parseJoinTableFilter
(
TableFilter
top
,
final
Select
command
)
{
top
=
readJoin
(
top
,
command
,
false
,
top
.
isJoinOuter
()
);
top
=
readJoin
(
top
,
false
);
command
.
addTableFilter
(
top
,
true
);
command
.
addTableFilter
(
top
,
true
);
boolean
isOuter
=
false
;
boolean
isOuter
=
false
;
while
(
true
)
{
while
(
true
)
{
...
...
This diff is collapsed.
Click to expand it.
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论