Skip to content

Commit a323bce

Browse files
committed
plpgsql EXIT construct forgot to downcase or quote-strip its identifier
argument, leading to label matching failures at run-time. Per report from Patrick Fiche. Also, fix it so that an unrecognized label argument draws a more useful error message than 'syntax error'.
1 parent 0b11204 commit a323bce

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

src/pl/plpgsql/src/gram.y

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* procedural language
55
*
66
* IDENTIFICATION
7-
* $PostgreSQL: pgsql/src/pl/plpgsql/src/gram.y,v 1.62 2004/09/14 23:46:46 neilc Exp $
7+
* $PostgreSQL: pgsql/src/pl/plpgsql/src/gram.y,v 1.63 2004/10/12 15:44:15 tgl Exp $
88
*
99
* This software is copyrighted by Jan Wieck - Hamburg.
1010
*
@@ -1639,7 +1639,18 @@ opt_label :
16391639
opt_exitlabel :
16401640
{ $$ = NULL; }
16411641
| T_LABEL
1642-
{ $$ = strdup(yytext); }
1642+
{
1643+
char *name;
1644+
1645+
plpgsql_convert_ident(yytext, &name, 1);
1646+
$$ = strdup(name);
1647+
pfree(name);
1648+
}
1649+
| T_WORD
1650+
{
1651+
/* just to give a better error than "syntax error" */
1652+
yyerror("no such label");
1653+
}
16431654
;
16441655

16451656
opt_exitcond : ';'

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy