提交 32ab8ad3 authored 作者: Evgenij Ryazanov's avatar Evgenij Ryazanov

Move tests for TRUNCATE to own files

上级 59a83c81
......@@ -146,7 +146,7 @@ public class TestScript extends TestBase {
"current-time", "dateadd", "datediff", "dayname",
"day-of-month", "day-of-week", "day-of-year", "extract",
"formatdatetime", "hour", "minute", "month", "monthname",
"parsedatetime", "quarter", "second", "week", "year" }) {
"parsedatetime", "quarter", "second", "truncate", "week", "year" }) {
testScript("functions/timeanddate/" + s + ".sql");
}
deleteDb("script");
......
......@@ -20,3 +20,9 @@ select trunc(null, null) en, trunc(1.99, 0) e1, trunc(-10.9, 0) em10 from test;
> ---- --- -----
> null 1.0 -10.0
> rows: 1
select trunc(1.3) R;
> R
> ---
> 1.0
> rows: 1
-- 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
--
select trunc('2015-05-29 15:00:00') R;
> R
> ---------------------
> 2015-05-29 00:00:00.0
> rows: 1
select trunc('2015-05-29') R;
> R
> ---------------------
> 2015-05-29 00:00:00.0
> rows: 1
select trunc(timestamp '2000-01-01 10:20:30.0') R;
> R
> ---------------------
> 2000-01-01 00:00:00.0
> rows: 1
select trunc(timestamp '2001-01-01 14:00:00.0') R;
> R
> ---------------------
> 2001-01-01 00:00:00.0
> rows: 1
select trunc('2015-05-29 15:00:00');
> 2015-05-29 00:00:00.0;
select trunc('2015-05-29');
> 2015-05-29 00:00:00.0;
select trunc(timestamp '2000-01-01 10:20:30.0');
> 2000-01-01 00:00:00.0;
select 1000L / 10;
> 100;
select * from (select x as y from dual order by y);
> 1;
select a.x from dual a, dual b order by x;
> 1;
select trunc(1.3);
> 1.0;
select trunc(timestamp '2001-01-01 14:00:00.0');
> 2001-01-01 00:00:00.0;
select 1 from(select 2 from(select 1) a right join dual b) c;
> 1;
select 1.00 / 3 * 0.00;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论