提交 e2e852d4 编写于 作者: P Pengzhou Tang 提交者: Tang Pengzhou

Fix intermittent testcase as_alias

This case assumed that 'now' in bellow queries will produce
different results.
-- insert into xxx values (timestamp(2) without time zone 'now');
-- select timestamp(2) without time zone 'now';
However, the results are undetermined and may be equal on powerful
agents, the test is all about as alias so it's ok to add 2 seconds
to the second 'now' to guarantee they are never equal.
上级 17322684
......@@ -556,13 +556,13 @@ SELECT count(*) One FROM TIMESTAMP_TBL_AS_TEST WHERE d1 = timestamp without time
-- end_equiv
-- start_equiv
SELECT count(*) AS One FROM TIMESTAMP_TBL_AS_TEST WHERE d1 = timestamp(2) without time zone 'now';
SELECT count(*) AS One FROM TIMESTAMP_TBL_AS_TEST WHERE d1 = timestamp(2) without time zone 'now' + '2 seconds';
one
-----
0
(1 row)
SELECT count(*) One FROM TIMESTAMP_TBL_AS_TEST WHERE d1 = timestamp(2) without time zone 'now';
SELECT count(*) One FROM TIMESTAMP_TBL_AS_TEST WHERE d1 = timestamp(2) without time zone 'now' + '2 seconds';
one
-----
0
......
......@@ -203,8 +203,8 @@ SELECT count(*) One FROM TIMESTAMP_TBL_AS_TEST WHERE d1 = timestamp without time
-- end_equiv
-- start_equiv
SELECT count(*) AS One FROM TIMESTAMP_TBL_AS_TEST WHERE d1 = timestamp(2) without time zone 'now';
SELECT count(*) One FROM TIMESTAMP_TBL_AS_TEST WHERE d1 = timestamp(2) without time zone 'now';
SELECT count(*) AS One FROM TIMESTAMP_TBL_AS_TEST WHERE d1 = timestamp(2) without time zone 'now' + '2 seconds';
SELECT count(*) One FROM TIMESTAMP_TBL_AS_TEST WHERE d1 = timestamp(2) without time zone 'now' + '2 seconds';
-- end_equiv
DELETE FROM TIMESTAMP_TBL_AS_TEST;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册