mirror of
https://github.com/postgres/postgres.git
synced 2025-04-29 13:56:47 +03:00
Reject operator names >= NAMEDATALEN characters. These will not work
anyway, and in assert-enabled builds you are likely to get an assertion failure. Backpatch as far as 7.3; 7.2 seems not to have the problem.
This commit is contained in:
parent
f739566069
commit
bec2f429af
@ -9,7 +9,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.102.2.1 2002/11/11 03:33:44 tgl Exp $
|
* $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.102.2.2 2005/08/16 00:48:58 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -484,6 +484,15 @@ other .
|
|||||||
return yytext[0];
|
return yytext[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Complain if operator is too long. Unlike the case
|
||||||
|
* for identifiers, we make this an error not a notice-
|
||||||
|
* and-truncate, because the odds are we are looking at
|
||||||
|
* a syntactic mistake anyway.
|
||||||
|
*/
|
||||||
|
if (nchars >= NAMEDATALEN)
|
||||||
|
yyerror("operator too long");
|
||||||
|
|
||||||
/* Convert "!=" operator to "<>" for compatibility */
|
/* Convert "!=" operator to "<>" for compatibility */
|
||||||
if (strcmp(yytext, "!=") == 0)
|
if (strcmp(yytext, "!=") == 0)
|
||||||
yylval.str = pstrdup("<>");
|
yylval.str = pstrdup("<>");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user