Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
789d7322
提交
789d7322
authored
4月 12, 2018
作者:
Evgenij Ryazanov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Make ORA_HASH() a numeric function and add it to help.csv
上级
c439c507
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
21 行增加
和
8 行删除
+21
-8
help.csv
h2/src/docsrc/help/help.csv
+13
-0
Function.java
h2/src/main/org/h2/expression/Function.java
+8
-8
没有找到文件。
h2/src/docsrc/help/help.csv
浏览文件 @
789d7322
...
@@ -3291,6 +3291,19 @@ This method returns a double.
...
@@ -3291,6 +3291,19 @@ This method returns a double.
LOG10(A)
LOG10(A)
"
"
"Functions (Numeric)","ORA_HASH","
ORA_HASH(expression [, bucketLong [, seedLong]])
","
Computes a hash value.
Optional bucket argument determines the maximum returned value.
This argument should be between 0 and 4294967295, default is 4294967295.
Optional seed argument is combined with the given expression to return the different values for the same expression.
This argument should be between 0 and 4294967295, default is 0.
This method returns a long value between 0 and the specified or default bucket value inclusive.
","
ORA_HASH(A)
"
"Functions (Numeric)","RADIANS","
"Functions (Numeric)","RADIANS","
RADIANS(numeric)
RADIANS(numeric)
","
","
...
...
h2/src/main/org/h2/expression/Function.java
浏览文件 @
789d7322
...
@@ -81,7 +81,7 @@ public class Function extends Expression implements FunctionCall {
...
@@ -81,7 +81,7 @@ public class Function extends Expression implements FunctionCall {
TRUNCATE
=
27
,
SECURE_RAND
=
28
,
HASH
=
29
,
ENCRYPT
=
30
,
TRUNCATE
=
27
,
SECURE_RAND
=
28
,
HASH
=
29
,
ENCRYPT
=
30
,
DECRYPT
=
31
,
COMPRESS
=
32
,
EXPAND
=
33
,
ZERO
=
34
,
DECRYPT
=
31
,
COMPRESS
=
32
,
EXPAND
=
33
,
ZERO
=
34
,
RANDOM_UUID
=
35
,
COSH
=
36
,
SINH
=
37
,
TANH
=
38
,
LN
=
39
,
RANDOM_UUID
=
35
,
COSH
=
36
,
SINH
=
37
,
TANH
=
38
,
LN
=
39
,
BITGET
=
40
;
BITGET
=
40
,
ORA_HASH
=
41
;
public
static
final
int
ASCII
=
50
,
BIT_LENGTH
=
51
,
CHAR
=
52
,
public
static
final
int
ASCII
=
50
,
BIT_LENGTH
=
51
,
CHAR
=
52
,
CHAR_LENGTH
=
53
,
CONCAT
=
54
,
DIFFERENCE
=
55
,
HEXTORAW
=
56
,
CHAR_LENGTH
=
53
,
CONCAT
=
54
,
DIFFERENCE
=
55
,
HEXTORAW
=
56
,
...
@@ -93,7 +93,7 @@ public class Function extends Expression implements FunctionCall {
...
@@ -93,7 +93,7 @@ public class Function extends Expression implements FunctionCall {
STRINGDECODE
=
80
,
STRINGTOUTF8
=
81
,
UTF8TOSTRING
=
82
,
STRINGDECODE
=
80
,
STRINGTOUTF8
=
81
,
UTF8TOSTRING
=
82
,
XMLATTR
=
83
,
XMLNODE
=
84
,
XMLCOMMENT
=
85
,
XMLCDATA
=
86
,
XMLATTR
=
83
,
XMLNODE
=
84
,
XMLCOMMENT
=
85
,
XMLCDATA
=
86
,
XMLSTARTDOC
=
87
,
XMLTEXT
=
88
,
REGEXP_REPLACE
=
89
,
RPAD
=
90
,
XMLSTARTDOC
=
87
,
XMLTEXT
=
88
,
REGEXP_REPLACE
=
89
,
RPAD
=
90
,
LPAD
=
91
,
CONCAT_WS
=
92
,
TO_CHAR
=
93
,
TRANSLATE
=
94
,
ORA_HASH
=
95
,
LPAD
=
91
,
CONCAT_WS
=
92
,
TO_CHAR
=
93
,
TRANSLATE
=
94
,
/* 95 */
TO_DATE
=
96
,
TO_TIMESTAMP
=
97
,
ADD_MONTHS
=
98
,
TO_TIMESTAMP_TZ
=
99
;
TO_DATE
=
96
,
TO_TIMESTAMP
=
97
,
ADD_MONTHS
=
98
,
TO_TIMESTAMP_TZ
=
99
;
public
static
final
int
CURDATE
=
100
,
CURTIME
=
101
,
DATE_ADD
=
102
,
public
static
final
int
CURDATE
=
100
,
CURTIME
=
101
,
DATE_ADD
=
102
,
...
@@ -223,6 +223,7 @@ public class Function extends Expression implements FunctionCall {
...
@@ -223,6 +223,7 @@ public class Function extends Expression implements FunctionCall {
addFunctionNotDeterministic
(
"RANDOM_UUID"
,
RANDOM_UUID
,
0
,
Value
.
UUID
);
addFunctionNotDeterministic
(
"RANDOM_UUID"
,
RANDOM_UUID
,
0
,
Value
.
UUID
);
addFunctionNotDeterministic
(
"SYS_GUID"
,
RANDOM_UUID
,
0
,
Value
.
UUID
);
addFunctionNotDeterministic
(
"SYS_GUID"
,
RANDOM_UUID
,
0
,
Value
.
UUID
);
addFunctionNotDeterministic
(
"UUID"
,
RANDOM_UUID
,
0
,
Value
.
UUID
);
addFunctionNotDeterministic
(
"UUID"
,
RANDOM_UUID
,
0
,
Value
.
UUID
);
addFunction
(
"ORA_HASH"
,
ORA_HASH
,
VAR_ARGS
,
Value
.
LONG
);
// string
// string
addFunction
(
"ASCII"
,
ASCII
,
1
,
Value
.
INT
);
addFunction
(
"ASCII"
,
ASCII
,
1
,
Value
.
INT
);
addFunction
(
"BIT_LENGTH"
,
BIT_LENGTH
,
1
,
Value
.
LONG
);
addFunction
(
"BIT_LENGTH"
,
BIT_LENGTH
,
1
,
Value
.
LONG
);
...
@@ -276,7 +277,6 @@ public class Function extends Expression implements FunctionCall {
...
@@ -276,7 +277,6 @@ public class Function extends Expression implements FunctionCall {
addFunction
(
"RPAD"
,
RPAD
,
VAR_ARGS
,
Value
.
STRING
);
addFunction
(
"RPAD"
,
RPAD
,
VAR_ARGS
,
Value
.
STRING
);
addFunction
(
"LPAD"
,
LPAD
,
VAR_ARGS
,
Value
.
STRING
);
addFunction
(
"LPAD"
,
LPAD
,
VAR_ARGS
,
Value
.
STRING
);
addFunction
(
"TO_CHAR"
,
TO_CHAR
,
VAR_ARGS
,
Value
.
STRING
);
addFunction
(
"TO_CHAR"
,
TO_CHAR
,
VAR_ARGS
,
Value
.
STRING
);
addFunction
(
"ORA_HASH"
,
ORA_HASH
,
VAR_ARGS
,
Value
.
LONG
);
addFunction
(
"TRANSLATE"
,
TRANSLATE
,
3
,
Value
.
STRING
);
addFunction
(
"TRANSLATE"
,
TRANSLATE
,
3
,
Value
.
STRING
);
addFunction
(
"REGEXP_LIKE"
,
REGEXP_LIKE
,
VAR_ARGS
,
Value
.
BOOLEAN
);
addFunction
(
"REGEXP_LIKE"
,
REGEXP_LIKE
,
VAR_ARGS
,
Value
.
BOOLEAN
);
...
@@ -1223,6 +1223,11 @@ public class Function extends Expression implements FunctionCall {
...
@@ -1223,6 +1223,11 @@ public class Function extends Expression implements FunctionCall {
compress
(
v0
.
getBytesNoCopy
(),
algorithm
));
compress
(
v0
.
getBytesNoCopy
(),
algorithm
));
break
;
break
;
}
}
case
ORA_HASH:
result
=
oraHash
(
v0
,
v1
==
null
?
0xffff_ffff
L
:
v1
.
getLong
(),
v2
==
null
?
0L
:
v2
.
getLong
());
break
;
case
DIFFERENCE:
case
DIFFERENCE:
result
=
ValueInt
.
get
(
getDifference
(
result
=
ValueInt
.
get
(
getDifference
(
v0
.
getString
(),
v1
.
getString
()));
v0
.
getString
(),
v1
.
getString
()));
...
@@ -1373,11 +1378,6 @@ public class Function extends Expression implements FunctionCall {
...
@@ -1373,11 +1378,6 @@ public class Function extends Expression implements FunctionCall {
v1
.
getInt
(),
v2
==
null
?
null
:
v2
.
getString
(),
false
),
v1
.
getInt
(),
v2
==
null
?
null
:
v2
.
getString
(),
false
),
database
.
getMode
().
treatEmptyStringsAsNull
);
database
.
getMode
().
treatEmptyStringsAsNull
);
break
;
break
;
case
ORA_HASH:
result
=
oraHash
(
v0
,
v1
==
null
?
0xffff_ffff
L
:
v1
.
getLong
(),
v2
==
null
?
0L
:
v2
.
getLong
());
break
;
case
TO_CHAR:
case
TO_CHAR:
switch
(
v0
.
getType
()){
switch
(
v0
.
getType
()){
case
Value
.
TIME
:
case
Value
.
TIME
:
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论