Re: Add privileges test for pg_stat_statements to improve coverage
kuroda.keisuke@nttcom.co.jp
From: kuroda.keisuke@nttcom.co.jp
To: Fujii Masao <masao.fujii@oss.nttdata.com>, pgsql-hackers@postgresql.org
Date: 2024-07-23T00:26:02Z
Lists: pgsql-hackers
Attachments
- V3_add_privileges_test_for_pg_stat_statements.patch (text/x-diff) patch
Hi Fujii-san, Thank you for your reply and comment! attach v3 fixed patch. > Shouldn't we also include calls and rows in the ORDER BY clause? > Without this, if there are multiple records with the same query > but different calls or rows, the query result might be unstable. > I believe this is causing the test failure reported by > he PostgreSQL Patch Tester. > I was thinking of adding "queryid <> 0" in the SELECT clause > instead of the WHERE clause. This way, we can verify if > the query results are as expected regardless of the queryid value, > including both queryid <> 0 and queryid = 0. It's exactly as you said. * Add calls and rows in the ORDER BY caluse. * Modify "queryid <> 0" in the SELECT clause. Modify test SQL belows, and the regress_stats_user1 check SQL only needs to be done once. +SELECT queryid <> 0 AS queryid_bool, query, calls, rows + FROM pg_stat_statements + ORDER BY query COLLATE "C", calls, rows; Best Regards, Keisuke Kuroda NTT Comware
Commits
-
pg_stat_statements: Add regression test for privilege handling.
- 97f2bc5aa531 18.0 landed