Skip to content

Commit 0672a3c

Browse files
committed
Lexer defended us against overlength plain identifiers, but not against
overlength quoted identifiers. Death and destruction ensue...
1 parent 36289fb commit 0672a3c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/backend/parser/scan.l

Lines changed: 7 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.70 2000/05/29 05:44:54 tgl Exp $
12+
* $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.71 2000/06/01 22:21:05 tgl Exp $
1313
*
1414
*-------------------------------------------------------------------------
1515
*/
@@ -326,6 +326,12 @@ other .
326326
}
327327
<xd>{xdstop} {
328328
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+
}
329335
yylval.str = pstrdup(literalbuf);
330336
return IDENT;
331337
}

0 commit comments

Comments
 (0)