mirror of
https://github.com/postgres/postgres.git
synced 2025-05-06 19:59:18 +03:00
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
This commit is contained in:
parent
82119a696e
commit
54124240ae
@ -9,7 +9,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* 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
|
void
|
||||||
yyerror(const char *message)
|
yyerror(const char *message)
|
||||||
{
|
{
|
||||||
elog(ERROR, "parser: %s at or near \"%s\"", message,
|
if(yyleng == 1 && *yytext == YY_END_OF_BUFFER_CHAR)
|
||||||
token_start ? token_start : yytext);
|
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));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user