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