Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5412424

Browse files
committed
In that case, attached is a patch which locates the beginning of the
offending token more efficiently (per your suggestion of usingscanbuf). The new patch does the same as before:template1=# select * frum pg_class;ERROR: parser: parse error at or near "frum" at character 10It also implement's Tom's suggestion:template1=# select * from pg_class where\gERROR: parse: parse error at end of inputGavin Sherry
1 parent82119a6 commit5412424

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

‎src/backend/parser/scan.l‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*
1010
*
1111
* IDENTIFICATION
12-
* $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.98 2002/08/0406:36:18 thomas Exp $
12+
* $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.99 2002/08/17 13:06:50 momjian Exp $
1313
*
1414
*-------------------------------------------------------------------------
1515
*/
@@ -582,8 +582,12 @@ other.
582582
void
583583
yyerror(constchar *message)
584584
{
585-
elog(ERROR,"parser: %s at or near\"%s\"", message,
586-
token_start ? token_start : yytext);
585+
if(yyleng ==1 && *yytext == YY_END_OF_BUFFER_CHAR)
586+
elog(ERROR,"parser: %s at end of input",message);
587+
else
588+
elog(ERROR,"parser: %s at or near\"%s\" at character %i",
589+
message,token_start ? token_start : yytext,
590+
(unsignedint)(yytext - scanbuf +1));
587591
}
588592

589593

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp