From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix ecpg bugs caused by missing semicolons in the backend gramma
Date: Sun, 24 Feb 2019 17:52:21 +0000
Message-ID: <E1gxxwr-0001rV-S7@gemulon.postgresql.org> (raw)
Fix ecpg bugs caused by missing semicolons in the backend grammar.
The Bison documentation clearly states that a semicolon is required
after every grammar rule, and our scripts that generate ecpg's
grammar from the backend's implicitly assumed this is true. But it
turns out that only ancient versions of Bison actually enforce that.
There have been a couple of rules without trailing semicolons in
gram.y for some time, and as a consequence, ecpg's grammar was faulty
and produced wrong output for the affected statements.
To fix, add the missing semis, and add some cross-checks to ecpg's
scripts so that they'll bleat if we mess this up again.
The cases that were broken were:
* "SET variable = DEFAULT" (but not "SET variable TO DEFAULT"),
as well as allied syntaxes such as ALTER SYSTEM SET ... DEFAULT.
These produced syntactically invalid output that the server
would reject.
* Multiple type names in DROP TYPE/DOMAIN commands. Only the
first type name would be listed in the emitted command.
Per report from Daisuke Higuchi. Back-patch to all supported versions.
Discussion: https://postgr.es/m/1803D792815FC24D871C00D17AE95905DB51CE@g01jpexmbkw24
Branch
------
REL9_6_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/904fce2a7695521d2cf25a3a08676f3c96d4096c
Modified Files
--------------
src/backend/parser/gram.y | 2 ++
src/interfaces/ecpg/preproc/check_rules.pl | 12 ++++++++++--
src/interfaces/ecpg/preproc/parse.pl | 8 ++++++++
3 files changed, 20 insertions(+), 2 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: Fix ecpg bugs caused by missing semicolons in the backend gramma
In-Reply-To: <E1gxxwr-0001rV-S7@gemulon.postgresql.org>
References: <E1gxxwr-0001rV-S7@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