mirror of
https://github.com/postgres/postgres.git
synced 2025-07-08 11:42:09 +03:00
Mike Ansley's fixes for long queries. This change just
corrects flex myinput() routine so that it doesn't assume there is only one bufferload of data. We still have the issue of getting rid of YY_USES_REJECT so that the scanner can cope with tokens larger than its initial buffer size.
This commit is contained in:
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.52 1999/07/17 20:17:26 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.53 1999/09/07 00:13:27 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -491,11 +491,8 @@ int
|
|||||||
input()
|
input()
|
||||||
{
|
{
|
||||||
if (parseCh == NULL)
|
if (parseCh == NULL)
|
||||||
{
|
|
||||||
parseCh = parseString;
|
parseCh = parseString;
|
||||||
return(*parseCh++);
|
if (*parseCh == '\0')
|
||||||
}
|
|
||||||
else if (*parseCh == '\0')
|
|
||||||
return(0);
|
return(0);
|
||||||
else
|
else
|
||||||
return(*parseCh++);
|
return(*parseCh++);
|
||||||
@ -520,20 +517,17 @@ myinput(char* buf, int max)
|
|||||||
int len, copylen;
|
int len, copylen;
|
||||||
|
|
||||||
if (parseCh == NULL)
|
if (parseCh == NULL)
|
||||||
{
|
parseCh = parseString;
|
||||||
len = strlen(parseString);
|
len = strlen(parseCh); /* remaining data available */
|
||||||
if (len >= max)
|
if (len >= max)
|
||||||
copylen = max - 1;
|
copylen = max - 1;
|
||||||
else
|
else
|
||||||
copylen = len;
|
copylen = len;
|
||||||
if (copylen > 0)
|
if (copylen > 0)
|
||||||
memcpy(buf, parseString, copylen);
|
memcpy(buf, parseCh, copylen);
|
||||||
buf[copylen] = '\0';
|
buf[copylen] = '\0';
|
||||||
parseCh = parseString;
|
parseCh += copylen;
|
||||||
return copylen;
|
return copylen;
|
||||||
}
|
|
||||||
else
|
|
||||||
return 0; /* end of string */
|
|
||||||
}
|
}
|
||||||
#endif /* FLEX_SCANNER */
|
#endif /* FLEX_SCANNER */
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user