From 056c32a6b92a24b8b091693f83bbf879b140fd66 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Tue, 14 Apr 2009 22:18:47 +0000 Subject: [PATCH] Fix broken {xufailed} production that made HEAD fail on select u&42 from table-with-a-u-column; Also fix missing SET_YYLLOC() in the {dolqfailed} production that I suppose this was based on. The latter is a pre-existing bug, but the only effect is to misplace the error cursor by one token, so probably not worth backpatching. --- src/backend/parser/scan.l | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/backend/parser/scan.l b/src/backend/parser/scan.l index 6caccc35d1..a070e857ef 100644 --- a/src/backend/parser/scan.l +++ b/src/backend/parser/scan.l @@ -553,6 +553,7 @@ other . startlit(); } {dolqfailed} { + SET_YYLLOC(); /* throw back all but the initial "$" */ yyless(1); /* and treat it as {other} */ @@ -646,10 +647,15 @@ other . <> { yyerror("unterminated quoted identifier"); } {xufailed} { + char *ident; + + SET_YYLLOC(); /* throw back all but the initial u/U */ yyless(1); - /* and treat it as {other} */ - return yytext[0]; + /* and treat it as {identifier} */ + ident = downcase_truncate_identifier(yytext, yyleng, true); + yylval.str = ident; + return IDENT; } {typecast} { -- 2.39.5