From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Remove arbitrary line length limits in pg_regress (plain and ECP
Date: Sun, 06 Sep 2020 18:13:50 +0000
Message-ID: <E1kEzAk-0002ho-DX@gemulon.postgresql.org> (raw)
Remove arbitrary line length limits in pg_regress (plain and ECPG).
Refactor replace_string() to use a StringInfo for the modifiable
string argument. This allows the string to be of indefinite size
initially and/or grow substantially during replacement. The previous
logic in convert_sourcefiles_in() had a hard-wired limit of 1024
bytes on any line in input/*.sql or output/*.out files. While we've
not had reports of trouble yet, it'd surely have bit us someday.
This also fixes replace_string() so it won't get into an infinite
loop if the string-to-be-replaced is a substring of the replacement.
That's unlikely to happen in current usage, but the function surely
shouldn't depend on it.
Also fix ecpg_filter() to use a StringInfo and thereby remove its
hard limit of 300 bytes on the length of an ecpg source line.
Asim Rama Praveen and Georgios Kokolatos,
reviewed by Alvaro Herrera and myself
Discussion: https://postgr.es/m/y9Dlk2QhiZ39DhaB1QE9mgZ95HcOQKZCNtGwN7XCRKMdBRBnX_0woaRUtTjloEp4PKA6ERmcUcfq3lPG...
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/784b1ba1a2b9306697544bedb2ef9425185dd206
Modified Files
--------------
src/interfaces/ecpg/test/pg_regress_ecpg.c | 76 +++++++++++++++---------------
src/test/regress/pg_regress.c | 52 +++++++++++++-------
src/test/regress/pg_regress.h | 5 +-
3 files changed, 77 insertions(+), 56 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: Remove arbitrary line length limits in pg_regress (plain and ECP
In-Reply-To: <E1kEzAk-0002ho-DX@gemulon.postgresql.org>
References: <E1kEzAk-0002ho-DX@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