diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2004-10-12 15:44:15 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2004-10-12 15:44:15 +0000 |
commit | a323bce2e7037905dd8e70d6f2239cad5d583002 (patch) | |
tree | 3d66d02937dd45c7aeb48f6373746190701d69e2 /src | |
parent | 0b112045b7a410822d909c5ee361b88005b7963f (diff) | |
download | postgresql-a323bce2e7037905dd8e70d6f2239cad5d583002.tar.gz postgresql-a323bce2e7037905dd8e70d6f2239cad5d583002.zip |
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'.
Diffstat (limited to 'src')
-rw-r--r-- | src/pl/plpgsql/src/gram.y | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/pl/plpgsql/src/gram.y b/src/pl/plpgsql/src/gram.y index dc599aae15f..b681dcc0ce0 100644 --- a/src/pl/plpgsql/src/gram.y +++ b/src/pl/plpgsql/src/gram.y @@ -4,7 +4,7 @@ * procedural language * * IDENTIFICATION - * $PostgreSQL: pgsql/src/pl/plpgsql/src/gram.y,v 1.62 2004/09/14 23:46:46 neilc Exp $ + * $PostgreSQL: pgsql/src/pl/plpgsql/src/gram.y,v 1.63 2004/10/12 15:44:15 tgl Exp $ * * This software is copyrighted by Jan Wieck - Hamburg. * @@ -1639,7 +1639,18 @@ opt_label : opt_exitlabel : { $$ = NULL; } | T_LABEL - { $$ = strdup(yytext); } + { + char *name; + + plpgsql_convert_ident(yytext, &name, 1); + $$ = strdup(name); + pfree(name); + } + | T_WORD + { + /* just to give a better error than "syntax error" */ + yyerror("no such label"); + } ; opt_exitcond : ';' |