Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
950f82d5
提交
950f82d5
authored
2月 12, 2019
作者:
Evgenij Ryazanov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Replace more suspicious invocations of Column.getName() with getSQL()
上级
b056815f
显示空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
36 行增加
和
38 行删除
+36
-38
Insert.java
h2/src/main/org/h2/command/dml/Insert.java
+2
-2
ScriptCommand.java
h2/src/main/org/h2/command/dml/ScriptCommand.java
+22
-25
Select.java
h2/src/main/org/h2/command/dml/Select.java
+1
-5
ConstraintReferential.java
h2/src/main/org/h2/constraint/ConstraintReferential.java
+2
-2
ConstraintUnique.java
h2/src/main/org/h2/constraint/ConstraintUnique.java
+1
-1
Function.java
h2/src/main/org/h2/expression/function/Function.java
+8
-3
没有找到文件。
h2/src/main/org/h2/command/dml/Insert.java
浏览文件 @
950f82d5
...
@@ -388,8 +388,8 @@ public class Insert extends CommandWithValues implements ResultTarget {
...
@@ -388,8 +388,8 @@ public class Insert extends CommandWithValues implements ResultTarget {
Expression
[]
row
=
(
currentRow
==
null
)
?
valuesExpressionList
.
get
((
int
)
getCurrentRowNumber
()
-
1
)
Expression
[]
row
=
(
currentRow
==
null
)
?
valuesExpressionList
.
get
((
int
)
getCurrentRowNumber
()
-
1
)
:
new
Expression
[
columns
.
length
];
:
new
Expression
[
columns
.
length
];
for
(
int
i
=
0
;
i
<
columns
.
length
;
i
++)
{
for
(
int
i
=
0
;
i
<
columns
.
length
;
i
++)
{
String
key
=
table
.
getSchema
().
getName
()
+
"."
+
String
Builder
builder
=
table
.
getSQL
(
new
StringBuilder
()).
append
(
'.'
);
table
.
getName
()
+
"."
+
columns
[
i
].
getName
();
String
key
=
columns
[
i
].
getSQL
(
builder
).
toString
();
variableNames
.
add
(
key
);
variableNames
.
add
(
key
);
Value
value
;
Value
value
;
if
(
currentRow
!=
null
)
{
if
(
currentRow
!=
null
)
{
...
...
h2/src/main/org/h2/command/dml/ScriptCommand.java
浏览文件 @
950f82d5
...
@@ -388,58 +388,55 @@ public class ScriptCommand extends ScriptBase {
...
@@ -388,58 +388,55 @@ public class ScriptCommand extends ScriptBase {
Index
index
=
plan
.
getIndex
();
Index
index
=
plan
.
getIndex
();
Cursor
cursor
=
index
.
find
(
session
,
null
,
null
);
Cursor
cursor
=
index
.
find
(
session
,
null
,
null
);
Column
[]
columns
=
table
.
getColumns
();
Column
[]
columns
=
table
.
getColumns
();
StatementBuilder
buff
=
new
StatementBuilder
(
"INSERT INTO "
);
StringBuilder
builder
=
new
StringBuilder
(
"INSERT INTO "
);
table
.
getSQL
(
buff
.
builder
()).
append
(
'('
);
table
.
getSQL
(
builder
).
append
(
'('
);
for
(
Column
col
:
columns
)
{
Column
.
writeColumns
(
builder
,
columns
);
buff
.
appendExceptFirst
(
", "
);
builder
.
append
(
") VALUES"
);
Parser
.
quoteIdentifier
(
buff
.
builder
(),
col
.
getName
());
}
buff
.
append
(
") VALUES"
);
if
(!
simple
)
{
if
(!
simple
)
{
bu
ff
.
append
(
'\n'
);
bu
ilder
.
append
(
'\n'
);
}
}
bu
ff
.
append
(
'('
);
bu
ilder
.
append
(
'('
);
String
ins
=
bu
ff
.
toString
();
String
ins
=
bu
ilder
.
toString
();
bu
ff
=
null
;
bu
ilder
=
null
;
while
(
cursor
.
next
())
{
while
(
cursor
.
next
())
{
Row
row
=
cursor
.
get
();
Row
row
=
cursor
.
get
();
if
(
bu
ff
==
null
)
{
if
(
bu
ilder
==
null
)
{
bu
ff
=
new
Statement
Builder
(
ins
);
bu
ilder
=
new
String
Builder
(
ins
);
}
else
{
}
else
{
bu
ff
.
append
(
",\n("
);
bu
ilder
.
append
(
",\n("
);
}
}
for
(
int
j
=
0
;
j
<
row
.
getColumnCount
();
j
++)
{
for
(
int
j
=
0
;
j
<
row
.
getColumnCount
();
j
++)
{
if
(
j
>
0
)
{
if
(
j
>
0
)
{
bu
ff
.
append
(
", "
);
bu
ilder
.
append
(
", "
);
}
}
Value
v
=
row
.
getValue
(
j
);
Value
v
=
row
.
getValue
(
j
);
if
(
v
.
getType
().
getPrecision
()
>
lobBlockSize
)
{
if
(
v
.
getType
().
getPrecision
()
>
lobBlockSize
)
{
int
id
;
int
id
;
if
(
v
.
getValueType
()
==
Value
.
CLOB
)
{
if
(
v
.
getValueType
()
==
Value
.
CLOB
)
{
id
=
writeLobStream
(
v
);
id
=
writeLobStream
(
v
);
bu
ff
.
append
(
"SYSTEM_COMBINE_CLOB("
).
append
(
id
).
append
(
')'
);
bu
ilder
.
append
(
"SYSTEM_COMBINE_CLOB("
).
append
(
id
).
append
(
')'
);
}
else
if
(
v
.
getValueType
()
==
Value
.
BLOB
)
{
}
else
if
(
v
.
getValueType
()
==
Value
.
BLOB
)
{
id
=
writeLobStream
(
v
);
id
=
writeLobStream
(
v
);
bu
ff
.
append
(
"SYSTEM_COMBINE_BLOB("
).
append
(
id
).
append
(
')'
);
bu
ilder
.
append
(
"SYSTEM_COMBINE_BLOB("
).
append
(
id
).
append
(
')'
);
}
else
{
}
else
{
v
.
getSQL
(
bu
ff
.
builder
()
);
v
.
getSQL
(
bu
ilder
);
}
}
}
else
{
}
else
{
v
.
getSQL
(
bu
ff
.
builder
()
);
v
.
getSQL
(
bu
ilder
);
}
}
}
}
bu
ff
.
append
(
')'
);
bu
ilder
.
append
(
')'
);
count
++;
count
++;
if
((
count
&
127
)
==
0
)
{
if
((
count
&
127
)
==
0
)
{
checkCanceled
();
checkCanceled
();
}
}
if
(
simple
||
bu
ff
.
length
()
>
Constants
.
IO_BUFFER_SIZE
)
{
if
(
simple
||
bu
ilder
.
length
()
>
Constants
.
IO_BUFFER_SIZE
)
{
add
(
bu
ff
.
toString
(),
true
);
add
(
bu
ilder
.
toString
(),
true
);
bu
ff
=
null
;
bu
ilder
=
null
;
}
}
}
}
if
(
bu
ff
!=
null
)
{
if
(
bu
ilder
!=
null
)
{
add
(
bu
ff
.
toString
(),
true
);
add
(
bu
ilder
.
toString
(),
true
);
}
}
return
count
;
return
count
;
}
}
...
...
h2/src/main/org/h2/command/dml/Select.java
浏览文件 @
950f82d5
...
@@ -1478,11 +1478,7 @@ public class Select extends Query {
...
@@ -1478,11 +1478,7 @@ public class Select extends Query {
t
.
getSchema
().
getSQL
(
buff
.
builder
()).
append
(
'.'
);
t
.
getSchema
().
getSQL
(
buff
.
builder
()).
append
(
'.'
);
Parser
.
quoteIdentifier
(
buff
.
builder
(),
t
.
getName
())
Parser
.
quoteIdentifier
(
buff
.
builder
(),
t
.
getName
())
.
append
(
'('
);
.
append
(
'('
);
buff
.
resetCount
();
Column
.
writeColumns
(
buff
.
builder
(),
t
.
getColumns
());
for
(
Column
c
:
t
.
getColumns
())
{
buff
.
appendExceptFirst
(
","
);
buff
.
append
(
c
.
getName
());
}
buff
.
append
(
") AS "
);
buff
.
append
(
") AS "
);
t
.
getSQL
(
buff
.
builder
()).
append
(
'\n'
);
t
.
getSQL
(
buff
.
builder
()).
append
(
'\n'
);
}
}
...
...
h2/src/main/org/h2/constraint/ConstraintReferential.java
浏览文件 @
950f82d5
...
@@ -575,7 +575,7 @@ public class ConstraintReferential extends Constraint {
...
@@ -575,7 +575,7 @@ public class ConstraintReferential extends Constraint {
buff
.
resetCount
();
buff
.
resetCount
();
for
(
IndexColumn
c
:
columns
)
{
for
(
IndexColumn
c
:
columns
)
{
buff
.
appendExceptFirst
(
", "
);
buff
.
appendExceptFirst
(
", "
);
Parser
.
quoteIdentifier
(
buff
.
builder
(),
c
.
column
.
getName
()).
append
(
"=?"
);
c
.
column
.
getSQL
(
buff
.
builder
()).
append
(
"=?"
);
}
}
}
}
...
@@ -584,7 +584,7 @@ public class ConstraintReferential extends Constraint {
...
@@ -584,7 +584,7 @@ public class ConstraintReferential extends Constraint {
buff
.
resetCount
();
buff
.
resetCount
();
for
(
IndexColumn
c
:
columns
)
{
for
(
IndexColumn
c
:
columns
)
{
buff
.
appendExceptFirst
(
" AND "
);
buff
.
appendExceptFirst
(
" AND "
);
Parser
.
quoteIdentifier
(
buff
.
builder
(),
c
.
column
.
getName
()).
append
(
"=?"
);
c
.
column
.
getSQL
(
buff
.
builder
()).
append
(
"=?"
);
}
}
}
}
...
...
h2/src/main/org/h2/constraint/ConstraintUnique.java
浏览文件 @
950f82d5
...
@@ -58,7 +58,7 @@ public class ConstraintUnique extends Constraint {
...
@@ -58,7 +58,7 @@ public class ConstraintUnique extends Constraint {
buff
.
append
(
' '
).
append
(
getConstraintType
().
getSqlName
()).
append
(
'('
);
buff
.
append
(
' '
).
append
(
getConstraintType
().
getSqlName
()).
append
(
'('
);
for
(
IndexColumn
c
:
columns
)
{
for
(
IndexColumn
c
:
columns
)
{
buff
.
appendExceptFirst
(
", "
);
buff
.
appendExceptFirst
(
", "
);
Parser
.
quoteIdentifier
(
buff
.
builder
(),
c
.
column
.
getName
());
c
.
column
.
getSQL
(
buff
.
builder
());
}
}
buff
.
append
(
')'
);
buff
.
append
(
')'
);
if
(
internalIndex
&&
indexOwner
&&
forTable
==
this
.
table
)
{
if
(
internalIndex
&&
indexOwner
&&
forTable
==
this
.
table
)
{
...
...
h2/src/main/org/h2/expression/function/Function.java
浏览文件 @
950f82d5
...
@@ -1713,10 +1713,15 @@ public class Function extends Expression implements FunctionCall {
...
@@ -1713,10 +1713,15 @@ public class Function extends Expression implements FunctionCall {
}
}
break
;
break
;
}
}
case
VALUES:
case
VALUES:
{
result
=
session
.
getVariable
(
args
[
0
].
getSchemaName
()
+
"."
+
Expression
a0
=
args
[
0
];
args
[
0
].
getTableName
()
+
"."
+
args
[
0
].
getColumnName
());
StringBuilder
builder
=
new
StringBuilder
();
Parser
.
quoteIdentifier
(
builder
,
a0
.
getSchemaName
()).
append
(
'.'
);
Parser
.
quoteIdentifier
(
builder
,
a0
.
getTableName
()).
append
(
'.'
);
Parser
.
quoteIdentifier
(
builder
,
a0
.
getColumnName
());
result
=
session
.
getVariable
(
builder
.
toString
());
break
;
break
;
}
case
SIGNAL:
{
case
SIGNAL:
{
String
sqlState
=
v0
.
getString
();
String
sqlState
=
v0
.
getString
();
if
(
sqlState
.
startsWith
(
"00"
)
||
!
SIGNAL_PATTERN
.
matcher
(
sqlState
).
matches
())
{
if
(
sqlState
.
startsWith
(
"00"
)
||
!
SIGNAL_PATTERN
.
matcher
(
sqlState
).
matches
())
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论