PG-260: Fix regression tests.
The regression tests required some adjustmentes as they were based on a wrong behavior in pg_stat_monitor that was fixed in the last commits. The problem was that pg_stat_monitor_reset() was not properly clearing the query buffers, as such, some garbage queries were residing in the buffers after calling pg_stat_monitor_reset(). One example of a problem, a query such as "SELECT 1 AS num" and the same query with comments such as: SELECT $1 AS num /* { "application", psql_app, "real_ip", 192.168.1.3) */ Are evaluated to the same query ID, if a test issue the first query, call pg_stat_monitor_reset() to clear query buffer, then issue the second query with comments, the result in pg_stat_monitor view would still contain the first query without comments, this was leading to tests expecting the wrong output, which is now fixed.pull/120/head
parent
0e06a4c701
commit
9e76f6f961
|
@ -68,7 +68,7 @@ end $$;
|
||||||
SELECT query,calls FROM pg_stat_monitor ORDER BY query COLLATE "C";
|
SELECT query,calls FROM pg_stat_monitor ORDER BY query COLLATE "C";
|
||||||
query | calls
|
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 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
|
SELECT pg_stat_monitor_reset(); | 1
|
||||||
SELECT query,calls FROM pg_stat_monitor ORDER BY query COLLATE "C"; | 1
|
SELECT query,calls FROM pg_stat_monitor ORDER BY query COLLATE "C"; | 1
|
||||||
do $$ +| 1
|
do $$ +| 1
|
||||||
|
|
|
@ -16,7 +16,7 @@ ERROR: division by zero
|
||||||
SELECT query, state_code, state FROM pg_stat_monitor ORDER BY query COLLATE "C";
|
SELECT query, state_code, state FROM pg_stat_monitor ORDER BY query COLLATE "C";
|
||||||
query | state_code | state
|
query | state_code | state
|
||||||
----------------------------------------------------------------------------------+------------+---------------------
|
----------------------------------------------------------------------------------+------------+---------------------
|
||||||
SELECT $1 AS num | 3 | FINISHED
|
SELECT $1 | 3 | FINISHED
|
||||||
SELECT 1/0; | 4 | FINISHED WITH ERROR
|
SELECT 1/0; | 4 | FINISHED WITH ERROR
|
||||||
SELECT pg_stat_monitor_reset(); | 3 | FINISHED
|
SELECT pg_stat_monitor_reset(); | 3 | FINISHED
|
||||||
SELECT query, state_code, state FROM pg_stat_monitor ORDER BY query COLLATE "C"; | 2 | ACTIVE
|
SELECT query, state_code, state FROM pg_stat_monitor ORDER BY query COLLATE "C"; | 2 | ACTIVE
|
||||||
|
|
|
@ -13,8 +13,8 @@ SELECT 1 AS num /* { "application", psql_app, "real_ip", 192.168.1.3) */;
|
||||||
|
|
||||||
SELECT query, comments FROM pg_stat_monitor ORDER BY query COLLATE "C";
|
SELECT query, comments FROM pg_stat_monitor ORDER BY query COLLATE "C";
|
||||||
query | comments
|
query | comments
|
||||||
-------------------------------------------------------------------------+------------------------------------------------------
|
---------------------------------------------------------------------------+------------------------------------------------------
|
||||||
SELECT $1 AS num | { "application", psql_app, "real_ip", 192.168.1.3)
|
SELECT $1 AS num /* { "application", psql_app, "real_ip", 192.168.1.3) */ | { "application", psql_app, "real_ip", 192.168.1.3)
|
||||||
SELECT pg_stat_monitor_reset(); |
|
SELECT pg_stat_monitor_reset(); |
|
||||||
SELECT query, comments FROM pg_stat_monitor ORDER BY query COLLATE "C"; |
|
SELECT query, comments FROM pg_stat_monitor ORDER BY query COLLATE "C"; |
|
||||||
(3 rows)
|
(3 rows)
|
||||||
|
|
Loading…
Reference in New Issue