Re: Force testing of query jumbling code in TAP tests
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Andres Freund <andres@anarazel.de>
Cc: Postgres hackers <pgsql-hackers@lists.postgresql.org>
Date: 2023-02-28T05:06:05Z
Lists: pgsql-hackers
On Thu, Feb 16, 2023 at 02:08:42PM +0900, Michael Paquier wrote:
> Other ideas are welcome. At least this would be a start.
The main idea of the patch is here:
> +# Check some data from pg_stat_statements.
> +$node_primary->safe_psql('postgres', 'CREATE EXTENSION pg_stat_statements');
> +# This gathers data based on the first characters for some common query types,
> +# providing coverage for SELECT, DMLs, and some DDLs.
> +my $result = $node_primary->safe_psql(
> + 'postgres',
> + qq{WITH select_stats AS
> + (SELECT upper(substr(query, 1, 6)) AS select_query
> + FROM pg_stat_statements
> + WHERE upper(substr(query, 1, 6)) IN ('SELECT', 'UPDATE',
> + 'INSERT', 'DELETE',
> + 'CREATE'))
> + SELECT select_query, count(select_query) > 1 AS some_rows
> + FROM select_stats
> + GROUP BY select_query ORDER BY select_query;});
> +is( $result, qq(CREATE|t
> +DELETE|t
> +INSERT|t
> +SELECT|t
> +UPDATE|t), 'check contents of pg_stat_statements on regression database');
Are there any objections to do what's proposed in the patch and
improve the testing coverage of query jumbling by default?
--
Michael
Commits
-
Force testing of query jumbling in 027_stream_regress.pl
- d28a44985420 16.0 landed