!6613 修复门禁sw_prior用例不稳定问题

Merge pull request !6613 from lukeman/master
This commit is contained in:
opengauss_bot
2024-11-05 01:08:38 +00:00
committed by Gitee
2 changed files with 36 additions and 28 deletions

View File

@ -1,4 +1,5 @@
-- base test
set timezone to 'PRC';
DROP TABLE IF EXISTS table_name;
NOTICE: table "table_name" does not exist, skipping
CREATE TABLE table_name(node1, node2) AS
@ -349,11 +350,11 @@ START WITH id = 1
CONNECT BY PRIOR id = pid;
father_name | father_timetz | current_name | current_timetz
----------------+---------------+----------------+----------------
| | top_father | 00:00:01-07
top_father | 00:00:01-07 | second_father1 | 00:00:02-07
second_father1 | 00:00:02-07 | third_father1 | 00:00:04-07
top_father | 00:00:01-07 | second_father2 | 00:00:03-07
second_father2 | 00:00:03-07 | third_father2 | 00:00:05-07
| | top_father | 00:00:01+08
top_father | 00:00:01+08 | second_father1 | 00:00:02+08
second_father1 | 00:00:02+08 | third_father1 | 00:00:04+08
top_father | 00:00:01+08 | second_father2 | 00:00:03+08
second_father2 | 00:00:03+08 | third_father2 | 00:00:05+08
(5 rows)
SELECT
@ -383,11 +384,11 @@ START WITH id = 1
CONNECT BY PRIOR id = pid;
father_name | father_timestamptz | current_name | current_timestamptz
----------------+------------------------------+----------------+------------------------------
| | top_father | Mon Jan 01 00:00:01 2024 PST
top_father | Mon Jan 01 00:00:01 2024 PST | second_father1 | Tue Jan 02 00:00:02 2024 PST
second_father1 | Tue Jan 02 00:00:02 2024 PST | third_father1 | Thu Jan 04 00:00:04 2024 PST
top_father | Mon Jan 01 00:00:01 2024 PST | second_father2 | Wed Jan 03 00:00:03 2024 PST
second_father2 | Wed Jan 03 00:00:03 2024 PST | third_father2 | Fri Jan 05 00:00:05 2024 PST
| | top_father | Mon Jan 01 00:00:01 2024 CST
top_father | Mon Jan 01 14:00:01 2024 CST | second_father1 | Tue Jan 02 00:00:02 2024 CST
second_father1 | Tue Jan 02 14:00:02 2024 CST | third_father1 | Thu Jan 04 00:00:04 2024 CST
top_father | Mon Jan 01 14:00:01 2024 CST | second_father2 | Wed Jan 03 00:00:03 2024 CST
second_father2 | Wed Jan 03 14:00:03 2024 CST | third_father2 | Fri Jan 05 00:00:05 2024 CST
(5 rows)
SELECT
@ -613,8 +614,8 @@ START WITH id = 1
CONNECT BY PRIOR id = pid;
father_name | father_timetz | current_name | current_timetz
----------------+---------------+---------------+----------------
second_father1 | 00:00:02-07 | third_father1 | 00:00:04-07
second_father2 | 00:00:03-07 | third_father2 | 00:00:05-07
second_father1 | 00:00:02+08 | third_father1 | 00:00:04+08
second_father2 | 00:00:03+08 | third_father2 | 00:00:05+08
(2 rows)
SELECT
@ -639,11 +640,13 @@ name AS current_name,
FROM test_type_table WHERE PRIOR "timestamptz" > '2024-01-01 00:00:01'
START WITH id = 1
CONNECT BY PRIOR id = pid;
father_name | father_timestamptz | current_name | current_timestamptz
----------------+------------------------------+---------------+------------------------------
second_father1 | Tue Jan 02 00:00:02 2024 PST | third_father1 | Thu Jan 04 00:00:04 2024 PST
second_father2 | Wed Jan 03 00:00:03 2024 PST | third_father2 | Fri Jan 05 00:00:05 2024 PST
(2 rows)
father_name | father_timestamptz | current_name | current_timestamptz
----------------+------------------------------+----------------+------------------------------
top_father | Mon Jan 01 14:00:01 2024 CST | second_father1 | Tue Jan 02 00:00:02 2024 CST
second_father1 | Tue Jan 02 14:00:02 2024 CST | third_father1 | Thu Jan 04 00:00:04 2024 CST
top_father | Mon Jan 01 14:00:01 2024 CST | second_father2 | Wed Jan 03 00:00:03 2024 CST
second_father2 | Wed Jan 03 14:00:03 2024 CST | third_father2 | Fri Jan 05 00:00:05 2024 CST
(4 rows)
SELECT
PRIOR name AS father_name,
@ -851,10 +854,10 @@ START WITH id = 1
CONNECT BY PRIOR id = pid GROUP BY PRIOR "timetz";
timetz | count
-------------+-------
00:00:01-07 | 2
00:00:01+08 | 2
00:00:03+08 | 1
| 1
00:00:02-07 | 1
00:00:03-07 | 1
00:00:02+08 | 1
(4 rows)
SELECT
@ -879,10 +882,10 @@ START WITH id = 1
CONNECT BY PRIOR id = pid GROUP BY PRIOR "timestamptz";
timestamptz | count
------------------------------+-------
Tue Jan 02 00:00:02 2024 PST | 1
Mon Jan 01 00:00:01 2024 PST | 2
Wed Jan 03 14:00:03 2024 CST | 1
| 1
Wed Jan 03 00:00:03 2024 PST | 1
Tue Jan 02 14:00:02 2024 CST | 1
Mon Jan 01 14:00:01 2024 CST | 2
(4 rows)
SELECT
@ -1070,8 +1073,8 @@ START WITH id = 1
CONNECT BY PRIOR id = pid GROUP BY PRIOR "timetz" HAVING PRIOR "timetz" > '00:00:01';
timetz | count
-------------+-------
00:00:02-07 | 1
00:00:03-07 | 1
00:00:03+08 | 1
00:00:02+08 | 1
(2 rows)
SELECT
@ -1094,9 +1097,10 @@ START WITH id = 1
CONNECT BY PRIOR id = pid GROUP BY PRIOR "timestamptz" HAVING PRIOR "timestamptz" > '2024-01-01 00:00:01';
timestamptz | count
------------------------------+-------
Wed Jan 03 00:00:03 2024 PST | 1
Tue Jan 02 00:00:02 2024 PST | 1
(2 rows)
Wed Jan 03 14:00:03 2024 CST | 1
Tue Jan 02 14:00:02 2024 CST | 1
Mon Jan 01 14:00:01 2024 CST | 2
(3 rows)
SELECT
PRIOR "char",
@ -1141,3 +1145,4 @@ CONNECT BY PRIOR id = pid GROUP BY PRIOR "text" HAVING PRIOR "text" LIKE '%secon
second_father2 | 1
(2 rows)
reset timezone;

View File

@ -1,4 +1,5 @@
-- base test
set timezone to 'PRC';
DROP TABLE IF EXISTS table_name;
CREATE TABLE table_name(node1, node2) AS
SELECT 'A1', 'B1' UNION ALL
@ -703,3 +704,5 @@ COUNT(ID)
FROM test_type_table
START WITH id = 1
CONNECT BY PRIOR id = pid GROUP BY PRIOR "text" HAVING PRIOR "text" LIKE '%second%';
reset timezone;