Re: [HACKERS] Lex and things... - Mailing list pgsql-hackers

From Leon
Subject Re: [HACKERS] Lex and things...
Date
Msg-id 37C2A782.BA6FC0A2@udmnet.ru
Whole thread Raw
In response to RE: [HACKERS] Lex and things...  ("Ansley, Michael" <Michael.Ansley@intec.co.za>)
List pgsql-hackers
Ansley, Michael wrote:
> 
> As far as I understand it, the MAX_PARSE_BUFFER limit only applies if char
> parsestring[] is used, not if char *parsestring is used.  This is the whole
> reason for using flex.  And scan.l is set up to compile using char
> *parsestring, not char parsestring[].
> 

What is defined explicitly:

#ifdef  YY_READ_BUF_SIZE
#undef  YY_READ_BUF_SIZE
#endif
#define YY_READ_BUF_SIZE    MAX_PARSE_BUFFER

(these strings are repeated twice :)

...
char literal[MAX_PARSE_BUFFER];

...
<xq>{xqliteral} {                if ((llen+yyleng) > (MAX_PARSE_BUFFER - 1))                    elog(ERROR,"quoted
stringparse buffer of %d chars
 
exceeded",MAX_PARSE_BUFFER);                memcpy(literal+llen, yytext, yyleng+1);                llen += yyleng;
     }
 

Seems that limits are everywhere ;)

-- 
Leon.




pgsql-hackers by date:

Previous
From: Leon
Date:
Subject: Re: [HACKERS] Lex and things...
Next
From: Tom Lane
Date:
Subject: Sorting costs (was Caution: tonight's commits force initdb)