pgsql: Add some tests to check the SQL functions of control file

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Add some tests to check the SQL functions of control file
Date: 2022-10-27 00:59:10
Message-ID: E1onrEj-000xeY-G5@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Add some tests to check the SQL functions of control file

As the recent commit 05d4cbf (reverted after as a448e49) has proved,
there is zero coverage for the four SQL functions that can scan the
control file data:
- pg_control_checkpoint()
- pg_control_init()
- pg_control_recovery()
- pg_control_system()

This commit adds a minimal coverage for these functions, checking that
their execution is able to complete. This would have been enough to
catch the problems introduced in the commit mentioned above. More
checks could be done for each individual fields, but it is unclear
whether this would be better than the other checks in place in the
backend code.

Per discussion with Bharath Rupireddy.

Discussion: https://postgr.es/m/Y1d2FZmQmyAhPSRG@paquier.xyz

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/1b9cd69c5bdd1a331891f282106125e6f2524991

Modified Files
--------------
src/test/regress/expected/misc_functions.out | 25 +++++++++++++++++++++++++
src/test/regress/sql/misc_functions.sql | 6 ++++++
2 files changed, 31 insertions(+)

Browse pgsql-committers by date

  From Date Subject
Next Message Michael Paquier 2022-10-27 05:41:00 pgsql: Move pg_pwritev_with_retry() to src/common/file_utils.c
Previous Message Andres Freund 2022-10-26 17:43:06 Re: pgsql: Fix unlink() for STATUS_DELETE_PENDING on Windows.