Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
39c36dd2
提交
39c36dd2
authored
5月 27, 2018
作者:
Evgenij Ryazanov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove some unused assignments
上级
b550c4b1
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
10 行增加
和
17 行删除
+10
-17
Parser.java
h2/src/main/org/h2/command/Parser.java
+10
-17
没有找到文件。
h2/src/main/org/h2/command/Parser.java
浏览文件 @
39c36dd2
...
@@ -735,10 +735,9 @@ public class Parser {
...
@@ -735,10 +735,9 @@ public class Parser {
}
}
private
Column
readTableColumn
(
TableFilter
filter
)
{
private
Column
readTableColumn
(
TableFilter
filter
)
{
String
tableAlias
=
null
;
String
columnName
=
readColumnIdentifier
();
String
columnName
=
readColumnIdentifier
();
if
(
readIf
(
"."
))
{
if
(
readIf
(
"."
))
{
tableAlias
=
columnName
;
String
tableAlias
=
columnName
;
columnName
=
readColumnIdentifier
();
columnName
=
readColumnIdentifier
();
if
(
readIf
(
"."
))
{
if
(
readIf
(
"."
))
{
String
schema
=
tableAlias
;
String
schema
=
tableAlias
;
...
@@ -1969,9 +1968,8 @@ public class Parser {
...
@@ -1969,9 +1968,8 @@ public class Parser {
}
}
private
Query
parseSelect
()
{
private
Query
parseSelect
()
{
Query
command
=
null
;
int
paramIndex
=
parameters
.
size
();
int
paramIndex
=
parameters
.
size
();
command
=
parseSelectUnion
();
Query
command
=
parseSelectUnion
();
int
size
=
parameters
.
size
();
int
size
=
parameters
.
size
();
ArrayList
<
Parameter
>
params
=
new
ArrayList
<>(
size
);
ArrayList
<
Parameter
>
params
=
new
ArrayList
<>(
size
);
for
(
int
i
=
paramIndex
;
i
<
size
;
i
++)
{
for
(
int
i
=
paramIndex
;
i
<
size
;
i
++)
{
...
@@ -2047,10 +2045,7 @@ public class Parser {
...
@@ -2047,10 +2045,7 @@ public class Parser {
}
}
ArrayList
<
SelectOrderBy
>
orderList
=
Utils
.
newSmallArrayList
();
ArrayList
<
SelectOrderBy
>
orderList
=
Utils
.
newSmallArrayList
();
do
{
do
{
boolean
canBeNumber
=
true
;
boolean
canBeNumber
=
!
readIf
(
"="
);
if
(
readIf
(
"="
))
{
canBeNumber
=
false
;
}
SelectOrderBy
order
=
new
SelectOrderBy
();
SelectOrderBy
order
=
new
SelectOrderBy
();
Expression
expr
=
readExpression
();
Expression
expr
=
readExpression
();
if
(
canBeNumber
&&
expr
instanceof
ValueExpression
&&
if
(
canBeNumber
&&
expr
instanceof
ValueExpression
&&
...
@@ -2164,7 +2159,7 @@ public class Parser {
...
@@ -2164,7 +2159,7 @@ public class Parser {
return
command
;
return
command
;
}
}
if
(
readIf
(
"WITH"
))
{
if
(
readIf
(
"WITH"
))
{
Query
query
=
null
;
Query
query
;
try
{
try
{
query
=
(
Query
)
parseWith
();
query
=
(
Query
)
parseWith
();
}
catch
(
ClassCastException
e
)
{
}
catch
(
ClassCastException
e
)
{
...
@@ -2696,7 +2691,7 @@ public class Parser {
...
@@ -2696,7 +2691,7 @@ public class Parser {
}
}
private
JavaFunction
readJavaFunction
(
Schema
schema
,
String
functionName
,
boolean
throwIfNotFound
)
{
private
JavaFunction
readJavaFunction
(
Schema
schema
,
String
functionName
,
boolean
throwIfNotFound
)
{
FunctionAlias
functionAlias
=
null
;
FunctionAlias
functionAlias
;
if
(
schema
!=
null
)
{
if
(
schema
!=
null
)
{
functionAlias
=
schema
.
findFunction
(
functionName
);
functionAlias
=
schema
.
findFunction
(
functionName
);
}
else
{
}
else
{
...
@@ -3765,12 +3760,11 @@ public class Parser {
...
@@ -3765,12 +3760,11 @@ public class Parser {
return
;
return
;
}
}
case
CHAR_DOLLAR_QUOTED_STRING:
{
case
CHAR_DOLLAR_QUOTED_STRING:
{
String
result
=
null
;
int
begin
=
i
-
1
;
int
begin
=
i
-
1
;
while
(
types
[
i
]
==
CHAR_DOLLAR_QUOTED_STRING
)
{
while
(
types
[
i
]
==
CHAR_DOLLAR_QUOTED_STRING
)
{
i
++;
i
++;
}
}
result
=
sqlCommand
.
substring
(
begin
,
i
);
String
result
=
sqlCommand
.
substring
(
begin
,
i
);
currentToken
=
"'"
;
currentToken
=
"'"
;
checkLiterals
(
true
);
checkLiterals
(
true
);
currentValue
=
ValueString
.
get
(
StringUtils
.
cache
(
result
),
currentValue
=
ValueString
.
get
(
StringUtils
.
cache
(
result
),
...
@@ -5178,7 +5172,7 @@ public class Parser {
...
@@ -5178,7 +5172,7 @@ public class Parser {
viewsCreated
.
add
(
parseSingleCommonTableExpression
(
isPersistent
));
viewsCreated
.
add
(
parseSingleCommonTableExpression
(
isPersistent
));
}
while
(
readIf
(
","
));
}
while
(
readIf
(
","
));
Prepared
p
=
null
;
Prepared
p
;
// reverse the order of constructed CTE views - as the destruction order
// reverse the order of constructed CTE views - as the destruction order
// (since later created view may depend on previously created views -
// (since later created view may depend on previously created views -
// we preserve that dependency order in the destruction sequence )
// we preserve that dependency order in the destruction sequence )
...
@@ -5226,7 +5220,6 @@ public class Parser {
...
@@ -5226,7 +5220,6 @@ public class Parser {
private
TableView
parseSingleCommonTableExpression
(
boolean
isPersistent
)
{
private
TableView
parseSingleCommonTableExpression
(
boolean
isPersistent
)
{
String
cteViewName
=
readIdentifierWithSchema
();
String
cteViewName
=
readIdentifierWithSchema
();
Schema
schema
=
getSchema
();
Schema
schema
=
getSchema
();
Table
recursiveTable
=
null
;
ArrayList
<
Column
>
columns
=
Utils
.
newSmallArrayList
();
ArrayList
<
Column
>
columns
=
Utils
.
newSmallArrayList
();
String
[]
cols
=
null
;
String
[]
cols
=
null
;
...
@@ -5241,7 +5234,7 @@ public class Parser {
...
@@ -5241,7 +5234,7 @@ public class Parser {
}
}
}
}
Table
oldViewFound
=
null
;
Table
oldViewFound
;
if
(
isPersistent
)
{
if
(
isPersistent
)
{
oldViewFound
=
getSchema
().
findTableOrView
(
session
,
cteViewName
);
oldViewFound
=
getSchema
().
findTableOrView
(
session
,
cteViewName
);
}
else
{
}
else
{
...
@@ -5273,7 +5266,7 @@ public class Parser {
...
@@ -5273,7 +5266,7 @@ public class Parser {
* work (its removed after creation in this method). Only create table
* work (its removed after creation in this method). Only create table
* data and table if we don't have a working CTE already.
* data and table if we don't have a working CTE already.
*/
*/
recursiveTable
=
TableView
.
createShadowTableForRecursiveTableExpression
(
Table
recursiveTable
=
TableView
.
createShadowTableForRecursiveTableExpression
(
isPersistent
,
session
,
cteViewName
,
schema
,
columns
,
database
);
isPersistent
,
session
,
cteViewName
,
schema
,
columns
,
database
);
List
<
Column
>
columnTemplateList
;
List
<
Column
>
columnTemplateList
;
String
[]
querySQLOutput
=
{
null
};
String
[]
querySQLOutput
=
{
null
};
...
@@ -6171,7 +6164,7 @@ public class Parser {
...
@@ -6171,7 +6164,7 @@ public class Parser {
// Oracle specifies (but will not require) an opening parenthesis
// Oracle specifies (but will not require) an opening parenthesis
boolean
hasOpeningBracket
=
readIf
(
"("
);
boolean
hasOpeningBracket
=
readIf
(
"("
);
String
columnName
=
readColumnIdentifier
();
String
columnName
=
readColumnIdentifier
();
AlterTableAlterColumn
command
=
null
;
AlterTableAlterColumn
command
;
NullConstraintType
nullConstraint
=
parseNotNullConstraint
();
NullConstraintType
nullConstraint
=
parseNotNullConstraint
();
switch
(
nullConstraint
)
{
switch
(
nullConstraint
)
{
case
NULL_IS_ALLOWED:
case
NULL_IS_ALLOWED:
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论