Commit 54124240 authored by Bruce Momjian's avatar Bruce Momjian

In that case, attached is a patch which locates the beginning of the

offending token more efficiently (per your suggestion of using
scanbuf). The new patch does the same as before:

template1=# select * frum pg_class;
ERROR:  parser: parse error at or near "frum" at character 10

It also implement's Tom's suggestion:

template1=# select * from pg_class where\g
ERROR:  parse: parse error at end of input

Gavin Sherry
parent 82119a69
......@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.98 2002/08/04 06:36:18 thomas Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.99 2002/08/17 13:06:50 momjian Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -582,8 +582,12 @@ other .
void
yyerror(const char *message)
{
elog(ERROR, "parser: %s at or near \"%s\"", message,
token_start ? token_start : yytext);
if(yyleng == 1 && *yytext == YY_END_OF_BUFFER_CHAR)
elog(ERROR, "parser: %s at end of input",message);
else
elog(ERROR, "parser: %s at or near \"%s\" at character %i",
message,token_start ? token_start : yytext,
(unsigned int)(yytext - scanbuf + 1));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment