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

Commit2618fcd

Browse files
committed
Fix scanner name length trimming.
1 parent53916ca commit2618fcd

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

‎src/backend/commands/copy.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
*
88
* IDENTIFICATION
9-
* $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.55 1998/08/2904:09:23 momjian Exp $
9+
* $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.56 1998/08/2905:27:15 momjian Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -146,6 +146,7 @@ DoCopy(char *relname, bool binary, bool oids, bool from, bool pipe,
146146
}
147147
else
148148
{
149+
/* if we elog() out, the file stays open */
149150
fp=AllocateFile(filename,"r");
150151
if (fp==NULL)
151152
elog(ERROR,"COPY command, running in backend with "
@@ -173,6 +174,7 @@ DoCopy(char *relname, bool binary, bool oids, bool from, bool pipe,
173174
mode_toumask;/* Pre-existing umask value */
174175

175176
oumask=umask((mode_t)0);
177+
/* if we elog() out, the file stays open */
176178
fp=AllocateFile(filename,"w");
177179
umask(oumask);
178180
if (fp==NULL)

‎src/backend/parser/scan.l

Lines changed: 5 additions & 5 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.41 1998/08/2902:36:18 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.42 1998/08/2905:27:17 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -323,8 +323,8 @@ other.
323323
if (isascii((unsignedchar)yytext[i]) &&
324324
isupper(yytext[i]))
325325
yytext[i] =tolower(yytext[i]);
326-
if (i > NAMEDATALEN)
327-
yytext[NAMEDATALEN] ='\0';
326+
if (i >= NAMEDATALEN)
327+
yytext[NAMEDATALEN-1] ='\0';
328328

329329
keyword =ScanKeywordLookup((char*)yytext);
330330
if (keyword !=NULL) {
@@ -402,8 +402,8 @@ other.
402402
if (isascii((unsignedchar)yytext[i]) &&
403403
isupper(yytext[i]))
404404
yytext[i] =tolower(yytext[i]);
405-
if (i > NAMEDATALEN)
406-
yytext[NAMEDATALEN] ='\0';
405+
if (i >= NAMEDATALEN)
406+
yytext[NAMEDATALEN-1] ='\0';
407407

408408
keyword =ScanKeywordLookup((char*)yytext);
409409
if (keyword !=NULL) {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp