Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
06b6fe93
提交
06b6fe93
authored
15 年前
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remove unnecessary parameter
上级
8b2c84f7
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
10 行增加
和
11 行删除
+10
-11
BaseIndex.java
h2/src/main/org/h2/index/BaseIndex.java
+2
-2
BtreeIndex.java
h2/src/main/org/h2/index/BtreeIndex.java
+2
-2
BtreeLeaf.java
h2/src/main/org/h2/index/BtreeLeaf.java
+1
-1
BtreeNode.java
h2/src/main/org/h2/index/BtreeNode.java
+1
-1
Index.java
h2/src/main/org/h2/index/Index.java
+1
-2
MultiVersionIndex.java
h2/src/main/org/h2/index/MultiVersionIndex.java
+2
-2
TreeIndex.java
h2/src/main/org/h2/index/TreeIndex.java
+1
-1
没有找到文件。
h2/src/main/org/h2/index/BaseIndex.java
浏览文件 @
06b6fe93
...
...
@@ -243,8 +243,8 @@ public abstract class BaseIndex extends SchemaObjectBase implements Index {
return
0
;
}
public
boolean
containsNullAndAllowMultipleNull
(
Se
ssion
session
,
Row
newRow
)
{
Mode
mode
=
session
.
getDatabase
()
.
getMode
();
public
boolean
containsNullAndAllowMultipleNull
(
Se
arch
Row
newRow
)
{
Mode
mode
=
database
.
getMode
();
if
(
mode
.
uniqueIndexSingleNull
)
{
return
false
;
}
else
if
(
mode
.
uniqueIndexSingleNullExceptAllColumnsAreNull
)
{
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/index/BtreeIndex.java
浏览文件 @
06b6fe93
...
...
@@ -191,7 +191,7 @@ public class BtreeIndex extends BaseIndex implements RecordReader {
lastChange
=
0
;
if
(
storage
!=
null
)
{
storage
.
getDiskFile
().
flush
();
if
(!
database
.
get
ReadOnly
())
{
if
(!
database
.
is
ReadOnly
())
{
deletePage
(
session
,
head
);
// if we log index changes now, then the index is consistent
// if we don't log index changes, then the index is only consistent
...
...
@@ -348,7 +348,7 @@ public class BtreeIndex extends BaseIndex implements RecordReader {
private
void
flushHead
(
Session
session
)
throws
SQLException
{
updatePage
(
session
,
head
);
if
(!
database
.
getLogIndexChanges
()
&&
!
database
.
get
ReadOnly
())
{
if
(!
database
.
getLogIndexChanges
()
&&
!
database
.
is
ReadOnly
())
{
storage
.
flushRecord
(
head
);
}
if
(
trace
.
isDebugEnabled
())
{
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/index/BtreeLeaf.java
浏览文件 @
06b6fe93
...
...
@@ -63,7 +63,7 @@ public class BtreeLeaf extends BtreePage {
int
comp
=
index
.
compareRows
(
row
,
newRow
);
if
(
comp
==
0
)
{
if
(
index
.
indexType
.
getUnique
())
{
if
(!
index
.
containsNullAndAllowMultipleNull
(
session
,
newRow
))
{
if
(!
index
.
containsNullAndAllowMultipleNull
(
newRow
))
{
throw
index
.
getDuplicateKeyException
();
}
}
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/index/BtreeNode.java
浏览文件 @
06b6fe93
...
...
@@ -83,7 +83,7 @@ public class BtreeNode extends BtreePage {
int
comp
=
index
.
compareRows
(
row
,
newRow
);
if
(
comp
==
0
)
{
if
(
index
.
indexType
.
getUnique
())
{
if
(!
index
.
containsNullAndAllowMultipleNull
(
session
,
newRow
))
{
if
(!
index
.
containsNullAndAllowMultipleNull
(
newRow
))
{
throw
index
.
getDuplicateKeyException
();
}
}
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/index/Index.java
浏览文件 @
06b6fe93
...
...
@@ -190,12 +190,11 @@ public interface Index extends SchemaObject {
* allowed using the current compatibility mode for unique indexes. Note:
* NULL behavior is complicated in SQL.
*
* @param session the session
* @param newRow the row to check
* @return true if one of the columns is null and multiple nulls in unique
* indexes are allowed
*/
boolean
containsNullAndAllowMultipleNull
(
Se
ssion
session
,
Row
newRow
);
boolean
containsNullAndAllowMultipleNull
(
Se
arch
Row
newRow
);
/**
* Compare the positions of two rows.
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/index/MultiVersionIndex.java
浏览文件 @
06b6fe93
...
...
@@ -237,8 +237,8 @@ public class MultiVersionIndex implements Index {
return
base
.
getType
();
}
public
boolean
containsNullAndAllowMultipleNull
(
Se
ssion
session
,
Row
newRow
)
{
return
base
.
containsNullAndAllowMultipleNull
(
session
,
newRow
);
public
boolean
containsNullAndAllowMultipleNull
(
Se
arch
Row
newRow
)
{
return
base
.
containsNullAndAllowMultipleNull
(
newRow
);
}
public
void
removeChildrenAndResources
(
Session
session
)
throws
SQLException
{
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/index/TreeIndex.java
浏览文件 @
06b6fe93
...
...
@@ -54,7 +54,7 @@ public class TreeIndex extends BaseIndex {
int
compare
=
compareRows
(
row
,
r
);
if
(
compare
==
0
)
{
if
(
indexType
.
getUnique
())
{
if
(!
containsNullAndAllowMultipleNull
(
session
,
row
))
{
if
(!
containsNullAndAllowMultipleNull
(
row
))
{
throw
getDuplicateKeyException
();
}
}
...
...
This diff is collapsed.
Click to expand it.
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论