Skip site navigation (1) Skip section navigation (2)

pgsql: Fix a couple of cases where the plpgsql grammar looked for T_WORD

From: tgl(at)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix a couple of cases where the plpgsql grammar looked for T_WORD
Date: 2009-05-01 23:57:34
Message-ID: 20090501235734.E023975407B@cvs.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-committers
Log Message:
-----------
Fix a couple of cases where the plpgsql grammar looked for T_WORD and
failed to consider the possibility that it would get T_SCALAR, T_RECORD,
or T_ROW instead because the word happens to match a plpgsql variable name.
In particular, give "duplicate declaration" rather than generic "syntax error"
if the same identifier is declared twice in the same block, as per my recent
complaint.  Also behave more sanely when decl_aliasitem or proc_condition or
opt_lblname is coincidentally not T_WORD.  Refactor the related productions a
bit to reduce duplication.

This is a longstanding bug, but it doesn't seem critical enough to
back-patch.

Modified Files:
--------------
    pgsql/src/pl/plpgsql/src:
        gram.y (r1.123 -> r1.124)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/pl/plpgsql/src/gram.y?r1=1.123&r2=1.124)

pgsql-committers by date

Next:From: User EggyknapDate: 2009-05-02 03:04:21
Subject: pllolcode - pllolcode: Fix memory errors, and make parser return parse
Previous:From: User BmomjianDate: 2009-05-01 19:40:36
Subject: pg-migrator - src: Minor cleanups.

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group