pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Expand tests of test_ddl_deparse/ for ALTER TABLE
Date: Sun, 31 Jul 2022 02:51:09 +0000
Message-ID: <E1oHz2q-00219S-PN@gemulon.postgresql.org> (raw)

Expand tests of test_ddl_deparse/ for ALTER TABLE

This module is expanded to track the description of the objects changed
in the subcommands of ALTER TABLE by reworking the function
get_altertable_subcmdtypes() (now named get_altertable_subcmdinfo) used
in the event trigger of the test.  It now returns a set of rows made of
(subcommand type, object description) instead of a text array with only
the information about the subcommand type.

The tests have been lacking a lot of the subcommands added to
AlterTableType over the years.  All the missing subcommands are added,
and the code is now structured so as the addition of a new subcommand
is detected by removing the default clause used in the switch for the
subcommand types.

The coverage of the module is increased from roughly 30% to 50%.  More
could be done but this is already a nice improvement.

Author: Michael Paquier, Hou Zhijie
Reviewed-by: Álvaro Herrera, Amit Kapila, Hayato Kuroda
Discussion: https://postgr.es/m/OS0PR01MB571626984BD099DADF53F38394899@OS0PR01MB5716.jpnprd01.prod.outlook.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/07ff701dbd53aeb86dd5a09a8b943b3782d4b67f

Modified Files
--------------
.../test_ddl_deparse/expected/alter_table.out      | 126 ++++++++++++++++++++-
.../test_ddl_deparse/expected/create_table.out     |   8 +-
.../test_ddl_deparse/expected/create_view.out      |   2 +-
.../test_ddl_deparse/expected/test_ddl_deparse.out |   4 +-
.../modules/test_ddl_deparse/sql/alter_table.sql   |  56 +++++++++
.../test_ddl_deparse/sql/test_ddl_deparse.sql      |   4 +-
.../test_ddl_deparse/test_ddl_deparse--1.0.sql     |   6 +-
.../modules/test_ddl_deparse/test_ddl_deparse.c    |  73 +++++++++---
8 files changed, 250 insertions(+), 29 deletions(-)



Message-ID: <E1oHz2q-00219S-PN@gemulon.postgresql.org>
Permalink:  ../E1oHz2q-00219S-PN@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1oHz2q-00219S-PN@gemulon.postgresql.org

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: michael@paquier.xyz
  Subject: Re: pgsql: Expand tests of test_ddl_deparse/ for ALTER TABLE
  In-Reply-To: <E1oHz2q-00219S-PN@gemulon.postgresql.org>
  References: <E1oHz2q-00219S-PN@gemulon.postgresql.org>

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

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