From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Replace opr_sanity test's binary_coercible() function with C cod
Date: Tue, 11 May 2021 18:28:41 +0000
Message-ID: <E1lgX7Z-0006vg-GO@gemulon.postgresql.org> (raw)
Replace opr_sanity test's binary_coercible() function with C code.
opr_sanity's binary_coercible() function has always been meant
to match the parser's notion of binary coercibility, but it also
has always been a rather poor approximation of the parser's
real rules (as embodied in IsBinaryCoercible()). That hasn't
bit us so far, but it's predictable that it will eventually.
It also now emerges that implementing this check in plpgsql
performs absolutely horribly in clobber-cache-always testing.
(Perhaps we could do something about that, but I suspect it just
means that plpgsql is exploiting catalog caching to the hilt.)
Hence, let's replace binary_coercible() with a C shim that directly
invokes IsBinaryCoercible(), eliminating both the semantic hazard
and the performance issue.
Most of regress.c's C functions are declared in create_function_1,
but we can't simply move that to before opr_sanity/type_sanity
since those tests would complain about the resulting shell types.
I chose to split it into create_function_0 and create_function_1.
Since create_function_0 now runs as part of a parallel group while
create_function_1 doesn't, reduce the latter to create just those
functions that opr_sanity and type_sanity would whine about.
To make room for create_function_0 in the second parallel group
of tests, move tstypes to the third parallel group.
In passing, clean up some ordering deviations between
parallel_schedule and serial_schedule.
Discussion: https://postgr.es/m/292305.1620503097@sss.pgh.pa.us
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/6303a5730914dfe6ef2709b28b225553315c573c
Modified Files
--------------
src/test/regress/expected/.gitignore | 1 +
src/test/regress/expected/conversion.out | 2 +-
src/test/regress/expected/opr_sanity.out | 55 --------------
src/test/regress/expected/type_sanity.out | 2 +-
src/test/regress/input/create_function_0.source | 95 ++++++++++++++++++++++++
src/test/regress/input/create_function_1.source | 88 +---------------------
src/test/regress/output/create_function_0.source | 88 ++++++++++++++++++++++
src/test/regress/output/create_function_1.source | 82 +-------------------
src/test/regress/parallel_schedule | 7 +-
src/test/regress/regress.c | 12 +++
src/test/regress/serial_schedule | 15 ++--
src/test/regress/sql/.gitignore | 1 +
src/test/regress/sql/conversion.sql | 2 +-
src/test/regress/sql/opr_sanity.sql | 59 ---------------
src/test/regress/sql/type_sanity.sql | 2 +-
15 files changed, 216 insertions(+), 295 deletions(-)
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: tgl@sss.pgh.pa.us
Subject: Re: pgsql: Replace opr_sanity test's binary_coercible() function with C cod
In-Reply-To: <E1lgX7Z-0006vg-GO@gemulon.postgresql.org>
References: <E1lgX7Z-0006vg-GO@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