Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
fe498c59
提交
fe498c59
authored
1月 16, 2018
作者:
Evgenij Ryazanov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Move some NUMERIC and NUMBER tests from testScript.sql to decimal_decimal.sql
上级
085da89f
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
48 行增加
和
29 行删除
+48
-29
TestScript.java
h2/src/test/org/h2/test/scripts/TestScript.java
+3
-1
decimal_decimal.sql
...rc/test/org/h2/test/scripts/datatypes/decimal_decimal.sql
+45
-0
testScript.sql
h2/src/test/org/h2/test/scripts/testScript.sql
+0
-28
没有找到文件。
h2/src/test/org/h2/test/scripts/TestScript.java
浏览文件 @
fe498c59
...
...
@@ -83,8 +83,10 @@ public class TestScript extends TestBase {
testScript
(
"query-optimisations.sql"
);
testScript
(
"commands-dml-script.sql"
);
testScript
(
"commands-dml-create-view.sql"
);
String
decimal2
;
decimal2
=
"decimal_decimal"
;
for
(
String
s
:
new
String
[]
{
"array"
,
"bigint"
,
"binary"
,
"blob"
,
"boolean"
,
"char"
,
"clob"
,
"date"
,
"decimal"
,
"double"
,
"enum"
,
"boolean"
,
"char"
,
"clob"
,
"date"
,
"decimal"
,
decimal2
,
"double"
,
"enum"
,
"geometry"
,
"identity"
,
"int"
,
"other"
,
"real"
,
"smallint"
,
"time"
,
"timestamp-with-timezone"
,
"timestamp"
,
"tinyint"
,
"uuid"
,
"varchar"
,
"varchar-ignorecase"
})
{
...
...
h2/src/test/org/h2/test/scripts/datatypes/decimal_decimal.sql
0 → 100644
浏览文件 @
fe498c59
-- Copyright 2004-2018 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
create
memory
table
orders
(
orderid
varchar
(
10
),
name
varchar
(
20
),
customer_id
varchar
(
10
),
completed
numeric
(
1
)
not
null
,
verified
numeric
(
1
)
);
>
ok
select
*
from
information_schema
.
columns
where
table_name
=
'ORDERS'
;
>
TABLE_CATALOG
TABLE_SCHEMA
TABLE_NAME
COLUMN_NAME
ORDINAL_POSITION
COLUMN_DEFAULT
IS_NULLABLE
DATA_TYPE
CHARACTER_MAXIMUM_LENGTH
CHARACTER_OCTET_LENGTH
NUMERIC_PRECISION
NUMERIC_PRECISION_RADIX
NUMERIC_SCALE
CHARACTER_SET_NAME
COLLATION_NAME
TYPE_NAME
NULLABLE
IS_COMPUTED
SELECTIVITY
CHECK_CONSTRAINT
SEQUENCE_NAME
REMARKS
SOURCE_DATA_TYPE
COLUMN_TYPE
>
------------- ------------ ---------- ----------- ---------------- -------------- ----------- --------- ------------------------ ---------------------- ----------------- ----------------------- ------------- ------------------ -------------- --------- -------- ----------- ----------- ---------------- ------------- ------- ---------------- -------------------
>
SCRIPT
PUBLIC
ORDERS
COMPLETED
4
null
NO
3
1
1
1
10
0
Unicode
OFF
DECIMAL
0
FALSE
50
null
null
NUMERIC
(
1
)
NOT
NULL
>
SCRIPT
PUBLIC
ORDERS
CUSTOMER_ID
3
null
YES
12
10
10
10
10
0
Unicode
OFF
VARCHAR
1
FALSE
50
null
null
VARCHAR
(
10
)
>
SCRIPT
PUBLIC
ORDERS
NAME
2
null
YES
12
20
20
20
10
0
Unicode
OFF
VARCHAR
1
FALSE
50
null
null
VARCHAR
(
20
)
>
SCRIPT
PUBLIC
ORDERS
ORDERID
1
null
YES
12
10
10
10
10
0
Unicode
OFF
VARCHAR
1
FALSE
50
null
null
VARCHAR
(
10
)
>
SCRIPT
PUBLIC
ORDERS
VERIFIED
5
null
YES
3
1
1
1
10
0
Unicode
OFF
DECIMAL
1
FALSE
50
null
null
NUMERIC
(
1
)
>
rows
:
5
drop
table
orders
;
>
ok
CREATE
TABLE
TEST
(
ID
INT
,
X1
BIT
,
XT
TINYINT
,
X_SM
SMALLINT
,
XB
BIGINT
,
XD
DECIMAL
(
10
,
2
),
XD2
DOUBLE
PRECISION
,
XR
REAL
);
>
ok
INSERT
INTO
TEST
VALUES
(
?
,
?
,
?
,
?
,
?
,
?
,
?
,
?
);
{
0
,
FALSE
,
0
,
0
,
0
,
0
.
0
,
0
.
0
,
0
.
0
1
,
TRUE
,
1
,
1
,
1
,
1
.
0
,
1
.
0
,
1
.
0
4
,
TRUE
,
4
,
4
,
4
,
4
.
0
,
4
.
0
,
4
.
0
-
1
,
FALSE
,
-
1
,
-
1
,
-
1
,
-
1
.
0
,
-
1
.
0
,
-
1
.
0
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
}
;
>
update
count
:
5
SELECT
ID
,
CAST
(
XT
AS
NUMBER
(
10
,
1
)),
CAST
(
X_SM
AS
NUMBER
(
10
,
1
)),
CAST
(
XB
AS
NUMBER
(
10
,
1
)),
CAST
(
XD
AS
NUMBER
(
10
,
1
)),
CAST
(
XD2
AS
NUMBER
(
10
,
1
)),
CAST
(
XR
AS
NUMBER
(
10
,
1
))
FROM
TEST
;
>
ID
CAST
(
XT
AS
DECIMAL
(
10
,
1
))
CAST
(
X_SM
AS
DECIMAL
(
10
,
1
))
CAST
(
XB
AS
DECIMAL
(
10
,
1
))
CAST
(
XD
AS
DECIMAL
(
10
,
1
))
CAST
(
XD2
AS
DECIMAL
(
10
,
1
))
CAST
(
XR
AS
DECIMAL
(
10
,
1
))
>
---- -------------------------- ---------------------------- -------------------------- -------------------------- --------------------------- --------------------------
>
-
1
-
1
.
0
-
1
.
0
-
1
.
0
-
1
.
0
-
1
.
0
-
1
.
0
>
0
0
.
0
0
.
0
0
.
0
0
.
0
0
.
0
0
.
0
>
1
1
.
0
1
.
0
1
.
0
1
.
0
1
.
0
1
.
0
>
4
4
.
0
4
.
0
4
.
0
4
.
0
4
.
0
4
.
0
>
null
null
null
null
null
null
null
>
rows
:
5
h2/src/test/org/h2/test/scripts/testScript.sql
浏览文件 @
fe498c59
...
...
@@ -2672,22 +2672,6 @@ select * from Foo where A like 'abc%' escape '\' AND B=1;
drop table Foo;
> ok
create memory table orders ( orderid varchar(10), name varchar(20), customer_id varchar(10), completed numeric(1) not null, verified numeric(1) );
> ok
select * from information_schema.columns where table_name = '
ORDERS
';
> TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_PRECISION_RADIX NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME TYPE_NAME NULLABLE IS_COMPUTED SELECTIVITY CHECK_CONSTRAINT SEQUENCE_NAME REMARKS SOURCE_DATA_TYPE COLUMN_TYPE
> ------------- ------------ ---------- ----------- ---------------- -------------- ----------- --------- ------------------------ ---------------------- ----------------- ----------------------- ------------- ------------------ -------------- --------- -------- ----------- ----------- ---------------- ------------- ------- ---------------- -------------------
> SCRIPT PUBLIC ORDERS COMPLETED 4 null NO 3 1 1 1 10 0 Unicode OFF DECIMAL 0 FALSE 50 null null NUMERIC(1) NOT NULL
> SCRIPT PUBLIC ORDERS CUSTOMER_ID 3 null YES 12 10 10 10 10 0 Unicode OFF VARCHAR 1 FALSE 50 null null VARCHAR(10)
> SCRIPT PUBLIC ORDERS NAME 2 null YES 12 20 20 20 10 0 Unicode OFF VARCHAR 1 FALSE 50 null null VARCHAR(20)
> SCRIPT PUBLIC ORDERS ORDERID 1 null YES 12 10 10 10 10 0 Unicode OFF VARCHAR 1 FALSE 50 null null VARCHAR(10)
> SCRIPT PUBLIC ORDERS VERIFIED 5 null YES 3 1 1 1 10 0 Unicode OFF DECIMAL 1 FALSE 50 null null NUMERIC(1)
> rows: 5
drop table orders;
> ok
create table test(id int, d timestamp);
> ok
...
...
@@ -7954,18 +7938,6 @@ SELECT ID, 10*X1, 10*XT, 10*X_SM, 10*XB, 10*XD, 10*XD2, 10*XR FROM TEST;
>
null
null
null
null
null
null
null
null
>
rows
:
5
SELECT
ID
,
CAST
(
XT
AS
NUMBER
(
10
,
1
)),
CAST
(
X_SM
AS
NUMBER
(
10
,
1
)),
CAST
(
XB
AS
NUMBER
(
10
,
1
)),
CAST
(
XD
AS
NUMBER
(
10
,
1
)),
CAST
(
XD2
AS
NUMBER
(
10
,
1
)),
CAST
(
XR
AS
NUMBER
(
10
,
1
))
FROM
TEST
;
>
ID
CAST
(
XT
AS
DECIMAL
(
10
,
1
))
CAST
(
X_SM
AS
DECIMAL
(
10
,
1
))
CAST
(
XB
AS
DECIMAL
(
10
,
1
))
CAST
(
XD
AS
DECIMAL
(
10
,
1
))
CAST
(
XD2
AS
DECIMAL
(
10
,
1
))
CAST
(
XR
AS
DECIMAL
(
10
,
1
))
>
---- -------------------------- ---------------------------- -------------------------- -------------------------- --------------------------- --------------------------
>
-
1
-
1
.
0
-
1
.
0
-
1
.
0
-
1
.
0
-
1
.
0
-
1
.
0
>
0
0
.
0
0
.
0
0
.
0
0
.
0
0
.
0
0
.
0
>
1
1
.
0
1
.
0
1
.
0
1
.
0
1
.
0
1
.
0
>
4
4
.
0
4
.
0
4
.
0
4
.
0
4
.
0
4
.
0
>
null
null
null
null
null
null
null
>
rows
:
5
SELECT
ID
,
SIGN
(
XT
),
SIGN
(
X_SM
),
SIGN
(
XB
),
SIGN
(
XD
),
SIGN
(
XD2
),
SIGN
(
XR
)
FROM
TEST
;
>
ID
SIGN
(
XT
)
SIGN
(
X_SM
)
SIGN
(
XB
)
SIGN
(
XD
)
SIGN
(
XD2
)
SIGN
(
XR
)
>
---- -------- ---------- -------- -------- --------- --------
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论