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

Commit30d17f3

Browse files
committed
Lexer defended us against overlength plain identifiers, but not against
overlength quoted identifiers. Death and destruction ensue...
1 parent490c151 commit30d17f3

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

‎src/backend/parser/scan.l

Lines changed: 8 additions & 1 deletion
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.68 2000/03/18 18:03:09 tgl Exp $
12+
* $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.68.2.1 2000/06/01 22:23:10 tgl Exp $
1313
*
1414
*-------------------------------------------------------------------------
1515
*/
@@ -42,6 +42,7 @@ static char *parseCh;
4242
/* set up my input handler --- need one flavor for flex, one for lex*/
4343
#if defined(FLEX_SCANNER)
4444

45+
#defineYY_NEVER_INTERACTIVE1
4546
#defineYY_NO_UNPUT
4647
staticintmyinput(char* buf,int max);
4748
#undef YY_INPUT
@@ -325,6 +326,12 @@ other.
325326
}
326327
<xd>{xdstop}{
327328
BEGIN(INITIAL);
329+
if (strlen(literalbuf) >= NAMEDATALEN)
330+
{
331+
elog(NOTICE,"identifier\"%s\" will be truncated to\"%.*s\"",
332+
literalbuf, NAMEDATALEN-1, literalbuf);
333+
literalbuf[NAMEDATALEN-1] ='\0';
334+
}
328335
yylval.str =pstrdup(literalbuf);
329336
return IDENT;
330337
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp