From 56f4735ab0236de4aa1ed40bd7cdddb48c191c1d Mon Sep 17 00:00:00 2001 From: Naeem Akhter Date: Tue, 3 Jan 2023 18:50:53 +0500 Subject: [PATCH] PG-570: Fix counters test case. Updated the test case and expected outout, and also removed the unneeded output files. --- regression/expected/counters.out | 4 +- regression/expected/counters_1.out | 73 ----------------------------- regression/expected/counters_14.out | 73 ----------------------------- regression/sql/counters.sql | 4 +- 4 files changed, 4 insertions(+), 150 deletions(-) delete mode 100644 regression/expected/counters_1.out delete mode 100644 regression/expected/counters_14.out diff --git a/regression/expected/counters.out b/regression/expected/counters.out index 6b1aae7..378dabc 100644 --- a/regression/expected/counters.out +++ b/regression/expected/counters.out @@ -36,7 +36,7 @@ SELECT a,b,c,d FROM t1, t2, t3, t4 WHERE t1.a = t2.b AND t3.c = t4.d ORDER BY a; ---+---+---+--- (0 rows) -SELECT query,calls FROM pg_stat_monitor ORDER BY query COLLATE "C"; +SELECT query, sum(calls) as calls FROM pg_stat_monitor GROUP BY query ORDER BY query COLLATE "C"; query | calls ---------------------------------------------------------------------------------+------- SELECT a,b,c,d FROM t1, t2, t3, t4 WHERE t1.a = t2.b AND t3.c = t4.d ORDER BY a | 4 @@ -59,7 +59,7 @@ begin n := n + 1; end loop; end $$; -SELECT query,calls FROM pg_stat_monitor ORDER BY query COLLATE "C"; +SELECT query, sum(calls) as calls FROM pg_stat_monitor GROUP BY query ORDER BY query COLLATE "C"; query | calls ---------------------------------------------------------------------------------------------------+------- SELECT a,b,c,d FROM t1, t2, t3, t4 WHERE t1.a = t2.b AND t3.c = t4.d ORDER BY a | 1000 diff --git a/regression/expected/counters_1.out b/regression/expected/counters_1.out deleted file mode 100644 index 9f1a381..0000000 --- a/regression/expected/counters_1.out +++ /dev/null @@ -1,73 +0,0 @@ -CREATE EXTENSION pg_stat_monitor; -Set pg_stat_monitor.pgsm_track='all'; -SELECT pg_stat_monitor_reset(); - pg_stat_monitor_reset ------------------------ - -(1 row) - -CREATE TABLE t1 (a INTEGER); -CREATE TABLE t2 (b INTEGER); -CREATE TABLE t3 (c INTEGER); -CREATE TABLE t4 (d INTEGER); -SELECT pg_stat_monitor_reset(); - pg_stat_monitor_reset ------------------------ - -(1 row) - -SELECT a,b,c,d FROM t1, t2, t3, t4 WHERE t1.a = t2.b AND t3.c = t4.d ORDER BY a; - a | b | c | d ----+---+---+--- -(0 rows) - -SELECT a,b,c,d FROM t1, t2, t3, t4 WHERE t1.a = t2.b AND t3.c = t4.d ORDER BY a; - a | b | c | d ----+---+---+--- -(0 rows) - -SELECT a,b,c,d FROM t1, t2, t3, t4 WHERE t1.a = t2.b AND t3.c = t4.d ORDER BY a; - a | b | c | d ----+---+---+--- -(0 rows) - -SELECT a,b,c,d FROM t1, t2, t3, t4 WHERE t1.a = t2.b AND t3.c = t4.d ORDER BY a; - a | b | c | d ----+---+---+--- -(0 rows) - -SELECT query,calls FROM pg_stat_monitor ORDER BY query COLLATE "C"; - query | calls ----------------------------------------------------------------------------------+------- - SELECT a,b,c,d FROM t1, t2, t3, t4 WHERE t1.a = t2.b AND t3.c = t4.d ORDER BY a | 4 - SELECT pg_stat_monitor_reset() | 1 -(2 rows) - -SELECT pg_stat_monitor_reset(); - pg_stat_monitor_reset ------------------------ - -(1 row) - -do $$ -declare - n integer:= 1; -begin - loop - PERFORM a,b,c,d FROM t1, t2, t3, t4 WHERE t1.a = t2.b AND t3.c = t4.d ORDER BY a; - exit when n = 1000; - n := n + 1; - end loop; -end $$; -SELECT query,calls FROM pg_stat_monitor ORDER BY query COLLATE "C"; - query | calls ----------------------------------------------------------------------------------+------- - SELECT a,b,c,d FROM t1, t2, t3, t4 WHERE t1.a = t2.b AND t3.c = t4.d ORDER BY a | 1000 - SELECT pg_stat_monitor_reset() | 1 -(2 rows) - -DROP TABLE t1; -DROP TABLE t2; -DROP TABLE t3; -DROP TABLE t4; -DROP EXTENSION pg_stat_monitor; diff --git a/regression/expected/counters_14.out b/regression/expected/counters_14.out deleted file mode 100644 index 9f1a381..0000000 --- a/regression/expected/counters_14.out +++ /dev/null @@ -1,73 +0,0 @@ -CREATE EXTENSION pg_stat_monitor; -Set pg_stat_monitor.pgsm_track='all'; -SELECT pg_stat_monitor_reset(); - pg_stat_monitor_reset ------------------------ - -(1 row) - -CREATE TABLE t1 (a INTEGER); -CREATE TABLE t2 (b INTEGER); -CREATE TABLE t3 (c INTEGER); -CREATE TABLE t4 (d INTEGER); -SELECT pg_stat_monitor_reset(); - pg_stat_monitor_reset ------------------------ - -(1 row) - -SELECT a,b,c,d FROM t1, t2, t3, t4 WHERE t1.a = t2.b AND t3.c = t4.d ORDER BY a; - a | b | c | d ----+---+---+--- -(0 rows) - -SELECT a,b,c,d FROM t1, t2, t3, t4 WHERE t1.a = t2.b AND t3.c = t4.d ORDER BY a; - a | b | c | d ----+---+---+--- -(0 rows) - -SELECT a,b,c,d FROM t1, t2, t3, t4 WHERE t1.a = t2.b AND t3.c = t4.d ORDER BY a; - a | b | c | d ----+---+---+--- -(0 rows) - -SELECT a,b,c,d FROM t1, t2, t3, t4 WHERE t1.a = t2.b AND t3.c = t4.d ORDER BY a; - a | b | c | d ----+---+---+--- -(0 rows) - -SELECT query,calls FROM pg_stat_monitor ORDER BY query COLLATE "C"; - query | calls ----------------------------------------------------------------------------------+------- - SELECT a,b,c,d FROM t1, t2, t3, t4 WHERE t1.a = t2.b AND t3.c = t4.d ORDER BY a | 4 - SELECT pg_stat_monitor_reset() | 1 -(2 rows) - -SELECT pg_stat_monitor_reset(); - pg_stat_monitor_reset ------------------------ - -(1 row) - -do $$ -declare - n integer:= 1; -begin - loop - PERFORM a,b,c,d FROM t1, t2, t3, t4 WHERE t1.a = t2.b AND t3.c = t4.d ORDER BY a; - exit when n = 1000; - n := n + 1; - end loop; -end $$; -SELECT query,calls FROM pg_stat_monitor ORDER BY query COLLATE "C"; - query | calls ----------------------------------------------------------------------------------+------- - SELECT a,b,c,d FROM t1, t2, t3, t4 WHERE t1.a = t2.b AND t3.c = t4.d ORDER BY a | 1000 - SELECT pg_stat_monitor_reset() | 1 -(2 rows) - -DROP TABLE t1; -DROP TABLE t2; -DROP TABLE t3; -DROP TABLE t4; -DROP EXTENSION pg_stat_monitor; diff --git a/regression/sql/counters.sql b/regression/sql/counters.sql index 6aae231..55d31e9 100644 --- a/regression/sql/counters.sql +++ b/regression/sql/counters.sql @@ -12,7 +12,7 @@ SELECT a,b,c,d FROM t1, t2, t3, t4 WHERE t1.a = t2.b AND t3.c = t4.d ORDER BY a; SELECT a,b,c,d FROM t1, t2, t3, t4 WHERE t1.a = t2.b AND t3.c = t4.d ORDER BY a; SELECT a,b,c,d FROM t1, t2, t3, t4 WHERE t1.a = t2.b AND t3.c = t4.d ORDER BY a; SELECT a,b,c,d FROM t1, t2, t3, t4 WHERE t1.a = t2.b AND t3.c = t4.d ORDER BY a; -SELECT query,calls FROM pg_stat_monitor ORDER BY query COLLATE "C"; +SELECT query, sum(calls) as calls FROM pg_stat_monitor GROUP BY query ORDER BY query COLLATE "C"; SELECT pg_stat_monitor_reset(); @@ -26,7 +26,7 @@ begin n := n + 1; end loop; end $$; -SELECT query,calls FROM pg_stat_monitor ORDER BY query COLLATE "C"; +SELECT query, sum(calls) as calls FROM pg_stat_monitor GROUP BY query ORDER BY query COLLATE "C"; DROP TABLE t1; DROP TABLE t2;