Re: [HACKERS] Status report: long-query-string changes

From: Leon <leon(at)udmnet(dot)ru>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] Status report: long-query-string changes
Date: 1999-09-12 12:12:02
Message-ID: 37DB9892.2711763E@udmnet.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:

>
> If you're looking at the "literal" buffer, that would need to be made
> expansible, but there's not much point until flex's internal stuff is
> fixed.
>
>

Look at this piece of code. It seems that when myinput() had been called
once, for the second time it will return 0 even if string isn't
over yet. Parameter 'max' is 8192 bytes on my system. So the query is
simply truncated to that size.

#ifdef FLEX_SCANNER
/* input routine for flex to read input from a string instead of a file */
static int
myinput(char* buf, int max)
{
int len, copylen;

if (parseCh == NULL)
{
len = strlen(parseString);
if (len >= max)
copylen = max - 1;
else
copylen = len;
if (copylen > 0)
memcpy(buf, parseString, copylen);
buf[copylen] = '\0';
parseCh = parseString;
return copylen;
}
else
return 0; /* end of string */
}
#endif /* FLEX_SCANNER */

--
Leon.
-------
He knows he'll never have to answer for any of his theories actually
being put to test. If they were, they would be contaminated by reality.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 1999-09-12 15:34:32 Re: [HACKERS] Status report: long-query-string changes
Previous Message renato barrios 1999-09-12 10:56:09 Re: [HACKERS] Re: Query about postgres medical database