Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
10ba7102
Unverified
提交
10ba7102
authored
3月 08, 2018
作者:
Evgenij Ryazanov
提交者:
GitHub
3月 08, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #941 from katzyn/tests
Use >> syntax in median.sql and move out more tests from testScript.sql
上级
5e78f932
4ec22ff8
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
138 行增加
和
302 行删除
+138
-302
median.sql
...c/test/org/h2/test/scripts/functions/aggregate/median.sql
+76
-228
abs.sql
h2/src/test/org/h2/test/scripts/functions/numeric/abs.sql
+6
-0
cast.sql
h2/src/test/org/h2/test/scripts/functions/system/cast.sql
+12
-0
decode.sql
h2/src/test/org/h2/test/scripts/functions/system/decode.sql
+3
-0
table.sql
h2/src/test/org/h2/test/scripts/functions/system/table.sql
+41
-0
testScript.sql
h2/src/test/org/h2/test/scripts/testScript.sql
+0
-74
没有找到文件。
h2/src/test/org/h2/test/scripts/functions/aggregate/median.sql
浏览文件 @
10ba7102
差异被折叠。
点击展开。
h2/src/test/org/h2/test/scripts/functions/numeric/abs.sql
浏览文件 @
10ba7102
...
...
@@ -24,3 +24,9 @@ select abs(null) vn, abs(-1) r1, abs(1) r2, abs(0) r3, abs(-0.1) r4, abs(0.1) r5
>
null
1
1
0
0
.
1
0
.
1
>
rows
:
1
select
*
from
table
(
id
int
=
(
1
,
2
),
name
varchar
=
(
'Hello'
,
'World'
))
x
order
by
id
;
>
ID
NAME
>
-- -----
>
1
Hello
>
2
World
>
rows
(
ordered
):
2
h2/src/test/org/h2/test/scripts/functions/system/cast.sql
浏览文件 @
10ba7102
...
...
@@ -87,3 +87,15 @@ select cast(cast(95605327.73 as float) as decimal);
select
cast
(
cast
(
'01020304-0506-0708-090a-0b0c0d0e0f00'
as
uuid
)
as
binary
);
>>
0102030405060708090
a0b0c0d0e0f00
call
cast
(
'null'
as
uuid
);
>
exception
select
cast
(
'12345678123456781234567812345678'
as
uuid
);
>>
12345678
-
1234
-
5678
-
1234
-
567812345678
select
cast
(
'000102030405060708090a0b0c0d0e0f'
as
uuid
);
>>
00010203
-
0405
-
0607
-
0809
-
0
a0b0c0d0e0f
select
-
cast
(
0
as
double
);
>>
0
.
0
h2/src/test/org/h2/test/scripts/functions/system/decode.sql
浏览文件 @
10ba7102
...
...
@@ -26,3 +26,6 @@ select decode('3', 2.0, 2.0, 3, 3.0);
select
decode
(
4
.
0
,
2
.
0
,
2
.
0
,
3
.
0
,
3
.
0
,
4
.
0
,
4
.
0
,
9
.
0
);
>>
4
.
0
select
decode
(
1
,
1
,
'1'
,
1
,
'11'
)
from
dual
;
>>
1
h2/src/test/org/h2/test/scripts/functions/system/table.sql
浏览文件 @
10ba7102
...
...
@@ -2,3 +2,44 @@
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
select
*
from
table
(
a
int
=
(
1
)),
table
(
b
int
=
(
2
));
>
A
B
>
-
-
>
1
2
>
rows
:
1
create
table
test
as
select
*
from
table
(
id
int
=
(
1
,
2
,
3
));
>
ok
SELECT
*
FROM
(
SELECT
*
FROM
TEST
)
ORDER
BY
id
;
>
ID
>
--
>
1
>
2
>
3
>
rows
(
ordered
):
3
SELECT
*
FROM
(
SELECT
*
FROM
TEST
)
x
ORDER
BY
id
;
>
ID
>
--
>
1
>
2
>
3
>
rows
(
ordered
):
3
drop
table
test
;
>
ok
explain
select
*
from
table
(
id
int
=
(
1
,
2
),
name
varchar
=
(
'Hello'
,
'World'
));
>
PLAN
>
-----------------------------------------------------------------------------------------------------
>
SELECT
TABLE
.
ID
,
TABLE
.
NAME
FROM
TABLE
(
ID
INT
=
(
1
,
2
),
NAME
VARCHAR
=
(
'Hello'
,
'World'
))
/* function */
>
rows
:
1
select
*
from
table
(
id
int
=
(
1
,
2
),
name
varchar
=
(
'Hello'
,
'World'
))
x
order
by
id
;
>
ID
NAME
>
-- -----
>
1
Hello
>
2
World
>
rows
(
ordered
):
2
h2/src/test/org/h2/test/scripts/testScript.sql
浏览文件 @
10ba7102
...
...
@@ -15,18 +15,6 @@ select * from test where id in (select id from test order by 'x');
drop
table
test
;
>
ok
select
abs
(
cast
(
0
.
0
as
double
))
x
;
>
X
>
---
>
0
.
0
>
rows
:
1
select
*
from
table
(
a
int
=
(
1
)),
table
(
b
int
=
(
2
));
>
A
B
>
-
-
>
1
2
>
rows
:
1
select
x
,
x
in
(
2
,
3
)
i
from
system_range
(
1
,
2
)
group
by
x
;
>
X
I
>
-
-----
...
...
@@ -144,12 +132,6 @@ select case seq.nextval when 2 then 'two' when 3 then 'three' when 1 then 'one'
drop
sequence
seq
;
>
ok
select
decode
(
1
,
1
,
'1'
,
1
,
'11'
)
r
from
dual
;
>
R
>
-
>
1
>
rows
:
1
create
table
test
(
x
int
);
>
ok
...
...
@@ -236,9 +218,6 @@ update test set pid = 1 where id = 2;
drop
table
test
;
>
ok
call
cast
(
'null'
as
uuid
);
>
exception
create
table
test
(
name
varchar
(
255
));
>
ok
...
...
@@ -420,12 +399,6 @@ explain select -cast(0 as real), -cast(0 as double);
>
SELECT
0
.
0
,
0
.
0
FROM
SYSTEM_RANGE
(
1
,
1
)
/* PUBLIC.RANGE_INDEX */
>
rows
:
1
select
-
cast
(
0
as
double
)
nz
;
>
NZ
>
---
>
0
.
0
>
rows
:
1
select
()
empty
;
>
EMPTY
>
-----
...
...
@@ -1400,28 +1373,6 @@ DROP ROLE Y;
DROP
ROLE
X
;
>
ok
create
table
test
as
select
*
from
table
(
id
int
=
(
1
,
2
,
3
));
>
ok
SELECT
*
FROM
(
SELECT
*
FROM
TEST
)
ORDER
BY
id
;
>
ID
>
--
>
1
>
2
>
3
>
rows
(
ordered
):
3
SELECT
*
FROM
(
SELECT
*
FROM
TEST
)
x
ORDER
BY
id
;
>
ID
>
--
>
1
>
2
>
3
>
rows
(
ordered
):
3
drop
table
test
;
>
ok
select
top
sum
(
1
)
0
from
dual
;
>
exception
...
...
@@ -2064,12 +2015,6 @@ select * from V, C where V.V = C.C;
drop table A, B, C, V cascade;
> ok
explain select * from table(id int = (1, 2), name varchar=('
Hello
', '
World
'));
> PLAN
> -----------------------------------------------------------------------------------------------------
> SELECT TABLE.ID, TABLE.NAME FROM TABLE(ID INT=(1, 2), NAME VARCHAR=('
Hello
', '
World
')) /* function */
> rows: 1
CREATE TABLE TEST(ID INT PRIMARY KEY, FLAG BOOLEAN, NAME VARCHAR);
> ok
...
...
@@ -2275,13 +2220,6 @@ select (1, 2);
> (1, 2)
> rows: 1
select * from table(id int=(1, 2), name varchar=('
Hello
', '
World
')) x order by id;
> ID NAME
> -- -----
> 1 Hello
> 2 World
> rows (ordered): 2
create table array_test(x array);
> ok
...
...
@@ -2790,18 +2728,6 @@ drop view address_view;
drop table address;
> ok
select cast('
12345678123456781234567812345678
' as uuid);
> '
12345678
-
1234
-
5678
-
1234
-
567812345678
'
> --------------------------------------
> 12345678-1234-5678-1234-567812345678
> rows: 1
select cast('
000102030405060708090
a0b0c0d0e0f
' as uuid);
> '
00010203
-
0405
-
0607
-
0809
-
0
a0b0c0d0e0f
'
> --------------------------------------
> 00010203-0405-0607-0809-0a0b0c0d0e0f
> rows: 1
CREATE ALIAS PARSE_INT2 FOR "java.lang.Integer.parseInt(java.lang.String, int)";
> ok
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论