提交 3ca72107 authored 作者: Thomas Mueller's avatar Thomas Mueller

Issue 468: trunc(timestamp) could return the wrong value.

上级 b144a815
......@@ -1033,7 +1033,7 @@ public class Function extends Expression implements FunctionCall {
java.sql.Timestamp d = v0.getTimestamp();
Calendar c = Calendar.getInstance();
c.setTime(d);
c.set(Calendar.HOUR, 0);
c.set(Calendar.HOUR_OF_DAY, 0);
c.set(Calendar.MINUTE, 0);
c.set(Calendar.SECOND, 0);
c.set(Calendar.MILLISECOND, 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;
......@@ -134,10 +136,6 @@ create memory temp table test(name varchar primary key);
select index_class from information_schema.indexes where table_name = 'TEST';
> org.h2.index.TreeIndex;
drop table test;
create cached temp table test(name varchar primary key);
select index_class from information_schema.indexes where table_name = 'TEST';
> org.h2.index.PageBtreeIndex;
drop table test;
create table test(id int);
alter table test alter column id set default 'x';
select column_default from information_schema.columns c where c.table_name = 'TEST' and c.column_name = 'ID';
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论