public inbox for [email protected]  
help / color / mirror / Atom feed
From: Michael Paquier <[email protected]>
To: Tom Lane <[email protected]>
Cc: Robert Haas <[email protected]>
Cc: Maxim Orlov <[email protected]>
Cc: Thomas Munro <[email protected]>
Cc: Dilip Kumar <[email protected]>
Cc: Amit Kapila <[email protected]>
Cc: Andres Freund <[email protected]>
Cc: Heikki Linnakangas <[email protected]>
Cc: pgsql-hackers <[email protected]>
Subject: Re: making relfilenodes 56 bits
Date: Fri, 30 Sep 2022 09:12:56 +0900
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <CA+TgmoZH65C4FuxTkWGg8iSx=wSL+13PeQY-Ggcd3e7ssQEiyw@mail.gmail.com>
	<CAFiTN-snTvCca0Rd-1L3xtptD2YoO=QC_5RMUwCeqdB8foxsDg@mail.gmail.com>
	<CAA4eK1+f=4O+yne0UHAm=UCjtP2V8cKjHTzFCd3ufgP9=cCDhg@mail.gmail.com>
	<CAFiTN-uojTY8Nzb_+ZSmY4YvAbe+JD2JiEmV1p14Drdiay1x4A@mail.gmail.com>
	<CAFiTN-s-BJ2URukJDYLbJh47td6xzcmE6S8R4r=FcnWcYSDnZQ@mail.gmail.com>
	<CA+Tgmoas+r!bA-_DQ8cWrJGhWt_WxdeSrpkOTk=2WuW7_i+bL1Q@mail.gmail.com>
	<CAFiTN-tVUocDK8Gi=rUs+4xUX35zApV725TtYdPX8qoYH7wsXA@mail.gmail.com>
	<CAFiTN-un8Q5dOryPnqNvenN6hrDaoBP6C_KJH64v6NMAbHfeHA@mail.gmail.com>
	<CA+TgmobFti5JuRZKq7hF8JJJgmyr1vpC-cOsu3dVc1dka9wApA@mail.gmail.com>
	<[email protected]>

On Thu, Sep 29, 2022 at 02:39:44PM -0400, Tom Lane wrote:
> The assertions in TupleDescInitEntry would have caught that,
> if only utils/misc/pg_controldata.c had more than zero test coverage.
> Seems like somebody ought to do something about that.

While passing by, I have noticed this thread.  We don't really care
about the contents returned by these functions, and one simple trick
to check their execution is SELECT FROM.  Like in the attached, for
example.
--
Michael


Attachments:

  [text/x-diff] controldata-regression.patch (1.2K, ../[email protected]/2-controldata-regression.patch)
  download | inline diff:
diff --git a/src/test/regress/expected/misc_functions.out b/src/test/regress/expected/misc_functions.out
index 9f106c2a10..93cba8e76d 100644
--- a/src/test/regress/expected/misc_functions.out
+++ b/src/test/regress/expected/misc_functions.out
@@ -594,3 +594,22 @@ SELECT * FROM tenk1 a JOIN my_gen_series(1,10) g ON a.unique1 = g;
          Index Cond: (unique1 = g.g)
 (4 rows)
 
+--
+-- Test functions for control data
+--
+SELECT FROM pg_control_checkpoint();
+--
+(1 row)
+
+SELECT FROM pg_control_init();
+--
+(1 row)
+
+SELECT FROM pg_control_recovery();
+--
+(1 row)
+
+SELECT FROM pg_control_system();
+--
+(1 row)
+
diff --git a/src/test/regress/sql/misc_functions.sql b/src/test/regress/sql/misc_functions.sql
index 639e9b352c..207d5a5292 100644
--- a/src/test/regress/sql/misc_functions.sql
+++ b/src/test/regress/sql/misc_functions.sql
@@ -223,3 +223,11 @@ SELECT * FROM tenk1 a JOIN my_gen_series(1,1000) g ON a.unique1 = g;
 
 EXPLAIN (COSTS OFF)
 SELECT * FROM tenk1 a JOIN my_gen_series(1,10) g ON a.unique1 = g;
+
+--
+-- Test functions for control data
+--
+SELECT FROM pg_control_checkpoint();
+SELECT FROM pg_control_init();
+SELECT FROM pg_control_recovery();
+SELECT FROM pg_control_system();


  [application/pgp-signature] signature.asc (833B, ../[email protected]/3-signature.asc)
  download

view thread (143+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: making relfilenodes 56 bits
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox