Fix broken {xufailed} production that made HEAD fail on
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 14 Apr 2009 22:18:47 +0000 (22:18 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 14 Apr 2009 22:18:47 +0000 (22:18 +0000)
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

index 6caccc35d197f47e7754dbfb38dd1d6400f7a2d9..a070e857ef8b78342d2ba07a7f52b6e70ca0552c 100644 (file)
@@ -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                     .
 <xd,xui><<EOF>>                { 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}             {