Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit85712da

Browse files
committed
Mike Ansley's fixes for long queries. This change just
corrects flex myinput() routine so that it doesn't assume there is onlyone bufferload of data. We still have the issue of getting rid ofYY_USES_REJECT so that the scanner can cope with tokens larger than itsinitial buffer size.
1 parentf1de4f9 commit85712da

File tree

1 file changed

+11
-17
lines changed

1 file changed

+11
-17
lines changed

‎src/backend/parser/scan.l

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.52 1999/07/17 20:17:26 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.53 1999/09/07 00:13:27 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -491,11 +491,8 @@ int
491491
input()
492492
{
493493
if (parseCh ==NULL)
494-
{
495494
parseCh = parseString;
496-
return(*parseCh++);
497-
}
498-
elseif (*parseCh =='\0')
495+
if (*parseCh =='\0')
499496
return(0);
500497
else
501498
return(*parseCh++);
@@ -520,20 +517,17 @@ myinput(char* buf, int max)
520517
int len, copylen;
521518

522519
if (parseCh ==NULL)
523-
{
524-
len =strlen(parseString);
525-
if (len >= max)
526-
copylen = max -1;
527-
else
528-
copylen = len;
529-
if (copylen >0)
530-
memcpy(buf, parseString, copylen);
531-
buf[copylen] ='\0';
532520
parseCh = parseString;
533-
return copylen;
534-
}
521+
len =strlen(parseCh);/* remaining data available */
522+
if (len >= max)
523+
copylen = max -1;
535524
else
536-
return0;/* end of string */
525+
copylen = len;
526+
if (copylen >0)
527+
memcpy(buf, parseCh, copylen);
528+
buf[copylen] ='\0';
529+
parseCh += copylen;
530+
return copylen;
537531
}
538532
#endif/* FLEX_SCANNER */
539533

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp