]> granicus.if.org Git - postgresql/commit
Fix a couple of cases where the plpgsql grammar looked for T_WORD and
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 1 May 2009 23:57:34 +0000 (23:57 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 1 May 2009 23:57:34 +0000 (23:57 +0000)
commitccc6759dbb4140de5df7ba23c0623772c54c9d54
treefa0826b466f7b79289f6499625b26b832d7b8e49
parentfe1b07a6f9f476b08301e9a7fddacaa427f949df
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.
src/pl/plpgsql/src/gram.y