Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
fac08d62
提交
fac08d62
authored
8月 20, 2015
作者:
Thomas Mueller Graf
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix typo: rename compareTypeSave to compareTypeSafe
上级
56434ba1
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
17 行增加
和
15 行删除
+17
-15
ConstraintReferential.java
h2/src/main/org/h2/constraint/ConstraintReferential.java
+1
-1
Database.java
h2/src/main/org/h2/engine/Database.java
+5
-3
Function.java
h2/src/main/org/h2/expression/Function.java
+1
-1
BaseIndex.java
h2/src/main/org/h2/index/BaseIndex.java
+1
-1
ValueDataType.java
h2/src/main/org/h2/mvstore/db/ValueDataType.java
+3
-3
Table.java
h2/src/main/org/h2/table/Table.java
+2
-2
Value.java
h2/src/main/org/h2/value/Value.java
+1
-1
TestValue.java
h2/src/test/org/h2/test/unit/TestValue.java
+3
-3
没有找到文件。
h2/src/main/org/h2/constraint/ConstraintReferential.java
浏览文件 @
fac08d62
...
@@ -392,7 +392,7 @@ public class ConstraintReferential extends Constraint {
...
@@ -392,7 +392,7 @@ public class ConstraintReferential extends Constraint {
int
idx
=
cols
[
i
].
getColumnId
();
int
idx
=
cols
[
i
].
getColumnId
();
Value
c
=
check
.
getValue
(
idx
);
Value
c
=
check
.
getValue
(
idx
);
Value
f
=
found
.
getValue
(
idx
);
Value
f
=
found
.
getValue
(
idx
);
if
(
searchTable
.
compareTypeSa
v
e
(
c
,
f
)
!=
0
)
{
if
(
searchTable
.
compareTypeSa
f
e
(
c
,
f
)
!=
0
)
{
allEqual
=
false
;
allEqual
=
false
;
break
;
break
;
}
}
...
...
h2/src/main/org/h2/engine/Database.java
浏览文件 @
fac08d62
...
@@ -354,8 +354,8 @@ public class Database implements DataHandler {
...
@@ -354,8 +354,8 @@ public class Database implements DataHandler {
* @return 0 if both values are equal, -1 if the first value is smaller, and
* @return 0 if both values are equal, -1 if the first value is smaller, and
* 1 otherwise
* 1 otherwise
*/
*/
public
int
compareTypeSa
v
e
(
Value
a
,
Value
b
)
{
public
int
compareTypeSa
f
e
(
Value
a
,
Value
b
)
{
return
a
.
compareTypeSa
v
e
(
b
,
compareMode
);
return
a
.
compareTypeSa
f
e
(
b
,
compareMode
);
}
}
public
long
getModificationDataId
()
{
public
long
getModificationDataId
()
{
...
@@ -1621,7 +1621,9 @@ public class Database implements DataHandler {
...
@@ -1621,7 +1621,9 @@ public class Database implements DataHandler {
removeMeta
(
session
,
id
);
removeMeta
(
session
,
id
);
addMeta
(
session
,
obj
);
addMeta
(
session
,
obj
);
// for temporary objects
// for temporary objects
objectIds
.
set
(
id
);
if
(
id
>
0
)
{
objectIds
.
set
(
id
);
}
}
}
/**
/**
...
...
h2/src/main/org/h2/expression/Function.java
浏览文件 @
fac08d62
...
@@ -1019,7 +1019,7 @@ public class Function extends Expression implements FunctionCall {
...
@@ -1019,7 +1019,7 @@ public class Function extends Expression implements FunctionCall {
if
(
result
==
ValueNull
.
INSTANCE
)
{
if
(
result
==
ValueNull
.
INSTANCE
)
{
result
=
v
;
result
=
v
;
}
else
{
}
else
{
int
comp
=
database
.
compareTypeSa
v
e
(
result
,
v
);
int
comp
=
database
.
compareTypeSa
f
e
(
result
,
v
);
if
(
info
.
type
==
GREATEST
&&
comp
<
0
)
{
if
(
info
.
type
==
GREATEST
&&
comp
<
0
)
{
result
=
v
;
result
=
v
;
}
else
if
(
info
.
type
==
LEAST
&&
comp
>
0
)
{
}
else
if
(
info
.
type
==
LEAST
&&
comp
>
0
)
{
...
...
h2/src/main/org/h2/index/BaseIndex.java
浏览文件 @
fac08d62
...
@@ -315,7 +315,7 @@ public abstract class BaseIndex extends SchemaObjectBase implements Index {
...
@@ -315,7 +315,7 @@ public abstract class BaseIndex extends SchemaObjectBase implements Index {
if
(
aNull
||
bNull
)
{
if
(
aNull
||
bNull
)
{
return
SortOrder
.
compareNull
(
aNull
,
sortType
);
return
SortOrder
.
compareNull
(
aNull
,
sortType
);
}
}
int
comp
=
table
.
compareTypeSa
v
e
(
a
,
b
);
int
comp
=
table
.
compareTypeSa
f
e
(
a
,
b
);
if
((
sortType
&
SortOrder
.
DESCENDING
)
!=
0
)
{
if
((
sortType
&
SortOrder
.
DESCENDING
)
!=
0
)
{
comp
=
-
comp
;
comp
=
-
comp
;
}
}
...
...
h2/src/main/org/h2/mvstore/db/ValueDataType.java
浏览文件 @
fac08d62
...
@@ -133,18 +133,18 @@ public class ValueDataType implements DataType {
...
@@ -133,18 +133,18 @@ public class ValueDataType implements DataType {
if
(
aNull
||
bNull
)
{
if
(
aNull
||
bNull
)
{
return
SortOrder
.
compareNull
(
aNull
,
sortType
);
return
SortOrder
.
compareNull
(
aNull
,
sortType
);
}
}
int
comp
=
compareTypeSa
v
e
(
a
,
b
);
int
comp
=
compareTypeSa
f
e
(
a
,
b
);
if
((
sortType
&
SortOrder
.
DESCENDING
)
!=
0
)
{
if
((
sortType
&
SortOrder
.
DESCENDING
)
!=
0
)
{
comp
=
-
comp
;
comp
=
-
comp
;
}
}
return
comp
;
return
comp
;
}
}
private
int
compareTypeSa
v
e
(
Value
a
,
Value
b
)
{
private
int
compareTypeSa
f
e
(
Value
a
,
Value
b
)
{
if
(
a
==
b
)
{
if
(
a
==
b
)
{
return
0
;
return
0
;
}
}
return
a
.
compareTypeSa
v
e
(
b
,
compareMode
);
return
a
.
compareTypeSa
f
e
(
b
,
compareMode
);
}
}
@Override
@Override
...
...
h2/src/main/org/h2/table/Table.java
浏览文件 @
fac08d62
...
@@ -1089,14 +1089,14 @@ public abstract class Table extends SchemaObjectBase {
...
@@ -1089,14 +1089,14 @@ public abstract class Table extends SchemaObjectBase {
* @return 0 if both values are equal, -1 if the first value is smaller, and
* @return 0 if both values are equal, -1 if the first value is smaller, and
* 1 otherwise
* 1 otherwise
*/
*/
public
int
compareTypeSa
v
e
(
Value
a
,
Value
b
)
{
public
int
compareTypeSa
f
e
(
Value
a
,
Value
b
)
{
if
(
a
==
b
)
{
if
(
a
==
b
)
{
return
0
;
return
0
;
}
}
int
dataType
=
Value
.
getHigherOrder
(
a
.
getType
(),
b
.
getType
());
int
dataType
=
Value
.
getHigherOrder
(
a
.
getType
(),
b
.
getType
());
a
=
a
.
convertTo
(
dataType
);
a
=
a
.
convertTo
(
dataType
);
b
=
b
.
convertTo
(
dataType
);
b
=
b
.
convertTo
(
dataType
);
return
a
.
compareTypeSa
v
e
(
b
,
compareMode
);
return
a
.
compareTypeSa
f
e
(
b
,
compareMode
);
}
}
public
CompareMode
getCompareMode
()
{
public
CompareMode
getCompareMode
()
{
...
...
h2/src/main/org/h2/value/Value.java
浏览文件 @
fac08d62
...
@@ -913,7 +913,7 @@ public abstract class Value {
...
@@ -913,7 +913,7 @@ public abstract class Value {
* @return 0 if both values are equal, -1 if the other value is smaller, and
* @return 0 if both values are equal, -1 if the other value is smaller, and
* 1 otherwise
* 1 otherwise
*/
*/
public
final
int
compareTypeSa
v
e
(
Value
v
,
CompareMode
mode
)
{
public
final
int
compareTypeSa
f
e
(
Value
v
,
CompareMode
mode
)
{
if
(
this
==
v
)
{
if
(
this
==
v
)
{
return
0
;
return
0
;
}
else
if
(
this
==
ValueNull
.
INSTANCE
)
{
}
else
if
(
this
==
ValueNull
.
INSTANCE
)
{
...
...
h2/src/test/org/h2/test/unit/TestValue.java
浏览文件 @
fac08d62
...
@@ -258,13 +258,13 @@ public class TestValue extends TestBase {
...
@@ -258,13 +258,13 @@ public class TestValue extends TestBase {
Value
v
=
useFloat
?
(
Value
)
ValueFloat
.
get
((
float
)
d
[
i
])
Value
v
=
useFloat
?
(
Value
)
ValueFloat
.
get
((
float
)
d
[
i
])
:
(
Value
)
ValueDouble
.
get
(
d
[
i
]);
:
(
Value
)
ValueDouble
.
get
(
d
[
i
]);
values
[
i
]
=
v
;
values
[
i
]
=
v
;
assertTrue
(
values
[
i
].
compareTypeSa
v
e
(
values
[
i
],
null
)
==
0
);
assertTrue
(
values
[
i
].
compareTypeSa
f
e
(
values
[
i
],
null
)
==
0
);
assertTrue
(
v
.
equals
(
v
));
assertTrue
(
v
.
equals
(
v
));
assertEquals
(
i
<
2
?
-
1
:
i
>
2
?
1
:
0
,
v
.
getSignum
());
assertEquals
(
i
<
2
?
-
1
:
i
>
2
?
1
:
0
,
v
.
getSignum
());
}
}
for
(
int
i
=
0
;
i
<
d
.
length
-
1
;
i
++)
{
for
(
int
i
=
0
;
i
<
d
.
length
-
1
;
i
++)
{
assertTrue
(
values
[
i
].
compareTypeSa
v
e
(
values
[
i
+
1
],
null
)
<
0
);
assertTrue
(
values
[
i
].
compareTypeSa
f
e
(
values
[
i
+
1
],
null
)
<
0
);
assertTrue
(
values
[
i
+
1
].
compareTypeSa
v
e
(
values
[
i
],
null
)
>
0
);
assertTrue
(
values
[
i
+
1
].
compareTypeSa
f
e
(
values
[
i
],
null
)
>
0
);
assertTrue
(!
values
[
i
].
equals
(
values
[
i
+
1
]));
assertTrue
(!
values
[
i
].
equals
(
values
[
i
+
1
]));
}
}
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论