Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
1f0b2ebe
提交
1f0b2ebe
authored
14 年前
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Small improvements.
上级
e64e10f5
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
9 行增加
和
8 行删除
+9
-8
Update.java
h2/src/main/org/h2/command/dml/Update.java
+1
-1
ConstraintReferential.java
h2/src/main/org/h2/constraint/ConstraintReferential.java
+8
-7
没有找到文件。
h2/src/main/org/h2/command/dml/Update.java
浏览文件 @
1f0b2ebe
...
...
@@ -163,7 +163,7 @@ public class Update extends Prepared {
condition
=
condition
.
optimize
(
session
);
condition
.
createIndexConditions
(
session
,
tableFilter
);
}
for
(
int
i
=
0
;
i
<
expressions
.
length
;
i
++)
{
for
(
int
i
=
0
,
len
=
expressions
.
length
;
i
<
len
;
i
++)
{
Expression
expr
=
expressions
[
i
];
if
(
expr
!=
null
)
{
expr
.
mapColumns
(
tableFilter
,
0
);
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/constraint/ConstraintReferential.java
浏览文件 @
1f0b2ebe
...
...
@@ -302,7 +302,7 @@ public class ConstraintReferential extends Constraint {
// special case self referencing constraints:
// check the inserted row first
boolean
self
=
true
;
for
(
int
i
=
0
;
i
<
columns
.
length
;
i
++)
{
for
(
int
i
=
0
,
len
=
columns
.
length
;
i
<
len
;
i
++)
{
int
idx
=
columns
[
i
].
column
.
getColumnId
();
Value
v
=
newRow
.
getValue
(
idx
);
Column
refCol
=
refColumns
[
i
].
column
;
...
...
@@ -318,7 +318,7 @@ public class ConstraintReferential extends Constraint {
}
}
Row
check
=
refTable
.
getTemplateRow
();
for
(
int
i
=
0
;
i
<
columns
.
length
;
i
++)
{
for
(
int
i
=
0
,
len
=
columns
.
length
;
i
<
len
;
i
++)
{
int
idx
=
columns
[
i
].
column
.
getColumnId
();
Value
v
=
newRow
.
getValue
(
idx
);
Column
refCol
=
refColumns
[
i
].
column
;
...
...
@@ -343,7 +343,8 @@ public class ConstraintReferential extends Constraint {
}
Column
[]
cols
=
searchIndex
.
getColumns
();
boolean
allEqual
=
true
;
for
(
int
i
=
0
;
i
<
columns
.
length
&&
i
<
cols
.
length
;
i
++)
{
int
len
=
Math
.
min
(
columns
.
length
,
cols
.
length
);
for
(
int
i
=
0
;
i
<
len
;
i
++)
{
int
idx
=
cols
[
i
].
getColumnId
();
Value
c
=
check
.
getValue
(
idx
);
Value
f
=
found
.
getValue
(
idx
);
...
...
@@ -365,7 +366,7 @@ public class ConstraintReferential extends Constraint {
private
void
checkRow
(
Session
session
,
Row
oldRow
)
{
SearchRow
check
=
table
.
getTemplateSimpleRow
(
false
);
for
(
int
i
=
0
;
i
<
columns
.
length
;
i
++)
{
for
(
int
i
=
0
,
len
=
columns
.
length
;
i
<
len
;
i
++)
{
Column
refCol
=
refColumns
[
i
].
column
;
int
refIdx
=
refCol
.
getColumnId
();
Column
col
=
columns
[
i
].
column
;
...
...
@@ -410,7 +411,7 @@ public class ConstraintReferential extends Constraint {
Prepared
updateCommand
=
getUpdate
(
session
);
if
(
updateAction
==
CASCADE
)
{
ArrayList
<
Parameter
>
params
=
updateCommand
.
getParameters
();
for
(
int
i
=
0
;
i
<
columns
.
length
;
i
++)
{
for
(
int
i
=
0
,
len
=
columns
.
length
;
i
<
len
;
i
++)
{
Parameter
param
=
params
.
get
(
i
);
Column
refCol
=
refColumns
[
i
].
column
;
param
.
setValue
(
newRow
.
getValue
(
refCol
.
getColumnId
()));
...
...
@@ -436,7 +437,7 @@ public class ConstraintReferential extends Constraint {
}
private
void
setWhere
(
Prepared
command
,
int
pos
,
Row
row
)
{
for
(
int
i
=
0
;
i
<
refColumns
.
length
;
i
++)
{
for
(
int
i
=
0
,
len
=
refColumns
.
length
;
i
<
len
;
i
++)
{
int
idx
=
refColumns
[
i
].
column
.
getColumnId
();
Value
v
=
row
.
getValue
(
idx
);
ArrayList
<
Parameter
>
params
=
command
.
getParameters
();
...
...
@@ -526,7 +527,7 @@ public class ConstraintReferential extends Constraint {
Prepared
command
=
session
.
prepare
(
sql
);
if
(
action
!=
CASCADE
)
{
ArrayList
<
Parameter
>
params
=
command
.
getParameters
();
for
(
int
i
=
0
;
i
<
columns
.
length
;
i
++)
{
for
(
int
i
=
0
,
len
=
columns
.
length
;
i
<
len
;
i
++)
{
Column
column
=
columns
[
i
].
column
;
Parameter
param
=
params
.
get
(
i
);
Value
value
;
...
...
This diff is collapsed.
Click to expand it.
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论