Re: [Bug Fix] ECPG: could not use set xxx to default statement

From: Andrew Dunstan <andrew(dot)dunstan(at)2ndquadrant(dot)com>
To: Michael Meskes <meskes(at)postgresql(dot)org>, "Higuchi, Daisuke" <higuchi(dot)daisuke(at)jp(dot)fujitsu(dot)com>, 'Tom Lane' <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: [Bug Fix] ECPG: could not use set xxx to default statement
Date: 2019-02-19 12:51:27
Message-ID: df1ecb93-123a-6b18-6ca6-52dbc3fdd98c@2ndQuadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 2/19/19 6:21 AM, Michael Meskes wrote:
> Higuchi-san,
>
>> I attached the patch which cope with missing semicolons.
>> Previous parse.pl find semicolon and dump data to buffer. When
>> attached patch's parse.pl find new tokens before finding a semicolon,
>> it also dumps data to buffer.
> It just occurred to me that check_rules.pl probably uses the same logic
> to identify each rule and thus needs to be changed, too.
>
> Also, IIRC bison allows blanks between the symbol name and the colon,
> or in other words "generic_set:" is equal to "generic_set :". If this
> happens after a "missing" semicolon I think your patch does not notice
> the end of the rule.
>

Yeah, it also seems too possibly liberal about where it matches a rule
name. AUIU this should be the first token on a line; is that right?
OTOH, it won't handle any case where an action block is not the last
thing in the rule, since it only sets $fill_semicolon on seeing a
closing brace (on its own).

I just looked at the bison manual at gnu.org and also at `info bison` on
my local machine, and couldn't see any reference to semicolons being
optional at the end of a rule. Under the heading "Syntax of Grammar
Rules" it says this:

A Bison grammar rule has the following general form:

     RESULT: COMPONENTS...;

Making it optional without putting that in the manual is just awful.

cheers

andrew

--
Andrew Dunstan https://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2019-02-19 14:29:24 Re: [Bug Fix] ECPG: could not use set xxx to default statement
Previous Message Andres Freund 2019-02-19 12:47:23 Re: Conflict handling for COPY FROM