Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
7c27a8da
提交
7c27a8da
authored
12月 21, 2018
作者:
Evgenij Ryazanov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use correct ARRAY syntax in array tests
上级
4412a506
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
14 行增加
和
14 行删除
+14
-14
TestFunctions.java
h2/src/test/org/h2/test/db/TestFunctions.java
+1
-1
TestMetaData.java
h2/src/test/org/h2/test/jdbc/TestMetaData.java
+1
-1
array-contains.sql
...t/org/h2/test/scripts/functions/system/array-contains.sql
+9
-9
testScript.sql
h2/src/test/org/h2/test/scripts/testScript.sql
+3
-3
没有找到文件。
h2/src/test/org/h2/test/db/TestFunctions.java
浏览文件 @
7c27a8da
...
@@ -440,7 +440,7 @@ public class TestFunctions extends TestDb implements AggregateFunction {
...
@@ -440,7 +440,7 @@ public class TestFunctions extends TestDb implements AggregateFunction {
stat
.
execute
(
"create alias dynamic deterministic for \""
+
stat
.
execute
(
"create alias dynamic deterministic for \""
+
getClass
().
getName
()
+
".dynamic\""
);
getClass
().
getName
()
+
".dynamic\""
);
setCount
(
0
);
setCount
(
0
);
rs
=
stat
.
executeQuery
(
"call dynamic(
('a', 1)
)[1]"
);
rs
=
stat
.
executeQuery
(
"call dynamic(
ARRAY['a', 1]
)[1]"
);
rs
.
next
();
rs
.
next
();
String
a
=
rs
.
getString
(
1
);
String
a
=
rs
.
getString
(
1
);
assertEquals
(
"a1"
,
a
);
assertEquals
(
"a1"
,
a
);
...
...
h2/src/test/org/h2/test/jdbc/TestMetaData.java
浏览文件 @
7c27a8da
...
@@ -176,7 +176,7 @@ public class TestMetaData extends TestDb {
...
@@ -176,7 +176,7 @@ public class TestMetaData extends TestDb {
Statement
stat
=
conn
.
createStatement
();
Statement
stat
=
conn
.
createStatement
();
stat
.
execute
(
"create table a(x array)"
);
stat
.
execute
(
"create table a(x array)"
);
stat
.
execute
(
"insert into a values(
(1, 2)
)"
);
stat
.
execute
(
"insert into a values(
ARRAY[1, 2]
)"
);
rs
=
stat
.
executeQuery
(
"SELECT x[1] FROM a"
);
rs
=
stat
.
executeQuery
(
"SELECT x[1] FROM a"
);
ResultSetMetaData
rsMeta
=
rs
.
getMetaData
();
ResultSetMetaData
rsMeta
=
rs
.
getMetaData
();
assertEquals
(
Types
.
NULL
,
rsMeta
.
getColumnType
(
1
));
assertEquals
(
Types
.
NULL
,
rsMeta
.
getColumnType
(
1
));
...
...
h2/src/test/org/h2/test/scripts/functions/system/array-contains.sql
浏览文件 @
7c27a8da
...
@@ -3,37 +3,37 @@
...
@@ -3,37 +3,37 @@
-- Initial Developer: H2 Group
-- Initial Developer: H2 Group
--
--
select
array_contains
(
(
4
.
0
,
2
.
0
,
2
.
0
)
,
2
.
0
);
select
array_contains
(
ARRAY
[
4
.
0
,
2
.
0
,
2
.
0
]
,
2
.
0
);
>>
TRUE
>>
TRUE
select
array_contains
(
(
4
.
0
,
2
.
0
,
2
.
0
)
,
5
.
0
);
select
array_contains
(
ARRAY
[
4
.
0
,
2
.
0
,
2
.
0
]
,
5
.
0
);
>>
FALSE
>>
FALSE
select
array_contains
(
(
'one'
,
'two'
)
,
'one'
);
select
array_contains
(
ARRAY
[
'one'
,
'two'
]
,
'one'
);
>>
TRUE
>>
TRUE
select
array_contains
(
(
'one'
,
'two'
)
,
'xxx'
);
select
array_contains
(
ARRAY
[
'one'
,
'two'
]
,
'xxx'
);
>>
FALSE
>>
FALSE
select
array_contains
(
(
'one'
,
'two'
)
,
null
);
select
array_contains
(
ARRAY
[
'one'
,
'two'
]
,
null
);
>>
FALSE
>>
FALSE
select
array_contains
(
(
null
,
'two'
)
,
null
);
select
array_contains
(
ARRAY
[
null
,
'two'
]
,
null
);
>>
TRUE
>>
TRUE
select
array_contains
(
null
,
'one'
);
select
array_contains
(
null
,
'one'
);
>>
null
>>
null
select
array_contains
(
((
1
,
2
),
(
3
,
4
)),
(
1
,
2
)
);
select
array_contains
(
ARRAY
[
ARRAY
[
1
,
2
],
ARRAY
[
3
,
4
]],
ARRAY
[
1
,
2
]
);
>>
TRUE
>>
TRUE
select
array_contains
(
((
1
,
2
),
(
3
,
4
)),
(
5
,
6
)
);
select
array_contains
(
ARRAY
[
ARRAY
[
1
,
2
],
ARRAY
[
3
,
4
]],
ARRAY
[
5
,
6
]
);
>>
FALSE
>>
FALSE
CREATE
TABLE
TEST
(
ID
INT
PRIMARY
KEY
AUTO_INCREMENT
,
A
ARRAY
);
CREATE
TABLE
TEST
(
ID
INT
PRIMARY
KEY
AUTO_INCREMENT
,
A
ARRAY
);
>
ok
>
ok
INSERT
INTO
TEST
(
A
)
VALUES
(
(
1
L
,
2
L
)),
((
3
L
,
4
L
)
);
INSERT
INTO
TEST
(
A
)
VALUES
(
ARRAY
[
1
L
,
2
L
]),
(
ARRAY
[
3
L
,
4
L
]
);
>
update
count
:
2
>
update
count
:
2
SELECT
ID
,
ARRAY_CONTAINS
(
A
,
1
L
),
ARRAY_CONTAINS
(
A
,
2
L
),
ARRAY_CONTAINS
(
A
,
3
L
),
ARRAY_CONTAINS
(
A
,
4
L
)
FROM
TEST
;
SELECT
ID
,
ARRAY_CONTAINS
(
A
,
1
L
),
ARRAY_CONTAINS
(
A
,
2
L
),
ARRAY_CONTAINS
(
A
,
3
L
),
ARRAY_CONTAINS
(
A
,
4
L
)
FROM
TEST
;
...
...
h2/src/test/org/h2/test/scripts/testScript.sql
浏览文件 @
7c27a8da
...
@@ -1395,7 +1395,7 @@ drop table test;
...
@@ -1395,7 +1395,7 @@ drop table test;
create table test(id int primary key, data array);
create table test(id int primary key, data array);
> ok
> ok
insert into test values(1,
(1, 1)), (2, (1, 2)), (3, (1, 1, 1)
);
insert into test values(1,
ARRAY[1, 1]), (2, ARRAY[1, 2]), (3, ARRAY[1, 1, 1]
);
> update count: 3
> update count: 3
select * from test order by data;
select * from test order by data;
...
@@ -2011,10 +2011,10 @@ select (1, 2);
...
@@ -2011,10 +2011,10 @@ select (1, 2);
create table array_test(x array);
create table array_test(x array);
> ok
> ok
insert into array_test values(
(1, 2, 3)), ((2, 3, 4)
);
insert into array_test values(
ARRAY[1, 2, 3]), (ARRAY[2, 3, 4]
);
> update count: 2
> update count: 2
select * from array_test where x =
(1, 2, 3)
;
select * from array_test where x =
ARRAY[1, 2, 3]
;
> X
> X
> ---------
> ---------
> [1, 2, 3]
> [1, 2, 3]
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论