Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
a21876c1
提交
a21876c1
authored
11月 10, 2016
作者:
Noel Grandin
提交者:
GitHub
11月 10, 2016
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #397 from stevemcleod/bitget_function
Added BITGET function
上级
1264a3eb
7608cd28
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
29 行增加
和
4 行删除
+29
-4
help.csv
h2/src/docsrc/help/help.csv
+11
-0
changelog.html
h2/src/docsrc/html/changelog.html
+4
-2
Function.java
h2/src/main/org/h2/expression/Function.java
+6
-1
testScript.sql
h2/src/test/org/h2/test/testScript.sql
+7
-0
dictionary.txt
h2/src/tools/org/h2/build/doc/dictionary.txt
+1
-1
没有找到文件。
h2/src/docsrc/help/help.csv
浏览文件 @
a21876c1
...
@@ -2796,6 +2796,17 @@ See also Java operator &.
...
@@ -2796,6 +2796,17 @@ See also Java operator &.
BITAND(A, B)
BITAND(A, B)
"
"
"Functions (Numeric)","BITGET","
BITGET(long, int)
","
Returns true if and only if the first parameter has a bit set in the
position specified by the second parameter.
This method returns a boolean.
The second parameter is zero-indexed; the least significant bit has position 0.
","
BITGET(A, 1)
"
"Functions (Numeric)","BITOR","
"Functions (Numeric)","BITOR","
BITOR(long, long)
BITOR(long, long)
","
","
...
...
h2/src/docsrc/html/changelog.html
浏览文件 @
a21876c1
...
@@ -21,9 +21,11 @@ Change Log
...
@@ -21,9 +21,11 @@ Change Log
<h2>
Next Version (unreleased)
</h2>
<h2>
Next Version (unreleased)
</h2>
<ul>
<ul>
<li>
Added BITGET function
</li>
<li>
Fixed bug in FilePathRetryOnInterrupt that caused infinite loop
<li>
Fixed bug in FilePathRetryOnInterrupt that caused infinite loop
</li>
</li>
<li>
PR #389, Handle LocalTime with nanosecond resolution, patch by katzyn
<li>
PR #389, Handle LocalTime with nanosecond resolution, patch by katzyn
</li>
</li>
<li>
PR #382, Recover for "page store" H2 breaks LOBs consistency, patch by vitalus
<li>
PR #382, Recover for "page store" H2 breaks LOBs consistency, patch by vitalus
</li>
</li>
...
...
h2/src/main/org/h2/expression/Function.java
浏览文件 @
a21876c1
...
@@ -82,7 +82,8 @@ public class Function extends Expression implements FunctionCall {
...
@@ -82,7 +82,8 @@ public class Function extends Expression implements FunctionCall {
ROUNDMAGIC
=
22
,
SIGN
=
23
,
SIN
=
24
,
SQRT
=
25
,
TAN
=
26
,
ROUNDMAGIC
=
22
,
SIGN
=
23
,
SIN
=
24
,
SQRT
=
25
,
TAN
=
26
,
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
;
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
,
...
@@ -208,6 +209,7 @@ public class Function extends Expression implements FunctionCall {
...
@@ -208,6 +209,7 @@ public class Function extends Expression implements FunctionCall {
addFunction
(
"ATAN"
,
ATAN
,
1
,
Value
.
DOUBLE
);
addFunction
(
"ATAN"
,
ATAN
,
1
,
Value
.
DOUBLE
);
addFunction
(
"ATAN2"
,
ATAN2
,
2
,
Value
.
DOUBLE
);
addFunction
(
"ATAN2"
,
ATAN2
,
2
,
Value
.
DOUBLE
);
addFunction
(
"BITAND"
,
BITAND
,
2
,
Value
.
LONG
);
addFunction
(
"BITAND"
,
BITAND
,
2
,
Value
.
LONG
);
addFunction
(
"BITGET"
,
BITGET
,
2
,
Value
.
BOOLEAN
);
addFunction
(
"BITOR"
,
BITOR
,
2
,
Value
.
LONG
);
addFunction
(
"BITOR"
,
BITOR
,
2
,
Value
.
LONG
);
addFunction
(
"BITXOR"
,
BITXOR
,
2
,
Value
.
LONG
);
addFunction
(
"BITXOR"
,
BITXOR
,
2
,
Value
.
LONG
);
addFunction
(
"CEILING"
,
CEILING
,
1
,
Value
.
DOUBLE
);
addFunction
(
"CEILING"
,
CEILING
,
1
,
Value
.
DOUBLE
);
...
@@ -1208,6 +1210,9 @@ public class Function extends Expression implements FunctionCall {
...
@@ -1208,6 +1210,9 @@ public class Function extends Expression implements FunctionCall {
case
BITAND:
case
BITAND:
result
=
ValueLong
.
get
(
v0
.
getLong
()
&
v1
.
getLong
());
result
=
ValueLong
.
get
(
v0
.
getLong
()
&
v1
.
getLong
());
break
;
break
;
case
BITGET:
result
=
ValueBoolean
.
get
((
v0
.
getLong
()
&
(
1L
<<
v1
.
getInt
()))
!=
0
);
break
;
case
BITOR:
case
BITOR:
result
=
ValueLong
.
get
(
v0
.
getLong
()
|
v1
.
getLong
());
result
=
ValueLong
.
get
(
v0
.
getLong
()
|
v1
.
getLong
());
break
;
break
;
...
...
h2/src/test/org/h2/test/testScript.sql
浏览文件 @
a21876c1
...
@@ -3055,6 +3055,13 @@ select min(8=bitand(12, PARSE_INT2(SUBSTRING(random_uuid(), 20,1), 16))) from sy
...
@@ -3055,6 +3055,13 @@ select min(8=bitand(12, PARSE_INT2(SUBSTRING(random_uuid(), 20,1), 16))) from sy
> TRUE
> TRUE
> rows: 1
> rows: 1
select BITGET(x, 0) AS IS_SET from system_range(1, 2);
> IS_SET
> ---------------------------------------------------------------------------
> TRUE
> FALSE
> rows: 2
drop alias PARSE_INT2;
drop alias PARSE_INT2;
> ok
> ok
...
...
h2/src/tools/org/h2/build/doc/dictionary.txt
浏览文件 @
a21876c1
...
@@ -728,4 +728,4 @@ experiment throughout staging booth akkuzin observed maxinplace russian
...
@@ -728,4 +728,4 @@ experiment throughout staging booth akkuzin observed maxinplace russian
ema sch bodewig forbid compat calc midway prohibit measuring playing kostya
ema sch bodewig forbid compat calc midway prohibit measuring playing kostya
pstmt rosenbaum pretending inverse safer lived blo sane othe multiplicative
pstmt rosenbaum pretending inverse safer lived blo sane othe multiplicative
introduces bcd nave picking templating clamp temporal berlin intermittently
introduces bcd nave picking templating clamp temporal berlin intermittently
pstat props
pstat props bitget travis
\ No newline at end of file
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论