From 43c8d77167b3af0fb8217e823a36663bbb01f7eb Mon Sep 17 00:00:00 2001 From: lukeman Date: Mon, 4 Nov 2024 21:17:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=97=A8=E7=A6=81sw=5Fprior?= =?UTF-8?q?=E7=94=A8=E4=BE=8B=E4=B8=8D=E7=A8=B3=E5=AE=9A=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/test/regress/expected/sw_prior.out | 61 ++++++++++++++------------ src/test/regress/sql/sw_prior.sql | 3 ++ 2 files changed, 36 insertions(+), 28 deletions(-) diff --git a/src/test/regress/expected/sw_prior.out b/src/test/regress/expected/sw_prior.out index f77aad359..41386ac48 100644 --- a/src/test/regress/expected/sw_prior.out +++ b/src/test/regress/expected/sw_prior.out @@ -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; diff --git a/src/test/regress/sql/sw_prior.sql b/src/test/regress/sql/sw_prior.sql index e97638d72..e956a66df 100644 --- a/src/test/regress/sql/sw_prior.sql +++ b/src/test/regress/sql/sw_prior.sql @@ -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; \ No newline at end of file