Skip to content
Snippets Groups Projects
Commit 2618fcdf authored by Bruce Momjian's avatar Bruce Momjian
Browse files

Fix scanner name length trimming.

parent 53916cab
No related branches found
No related tags found
No related merge requests found
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.55 1998/08/29 04:09:23 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.56 1998/08/29 05:27:15 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -146,6 +146,7 @@ DoCopy(char *relname, bool binary, bool oids, bool from, bool pipe, ...@@ -146,6 +146,7 @@ DoCopy(char *relname, bool binary, bool oids, bool from, bool pipe,
} }
else else
{ {
/* if we elog() out, the file stays open */
fp = AllocateFile(filename, "r"); fp = AllocateFile(filename, "r");
if (fp == NULL) if (fp == NULL)
elog(ERROR, "COPY command, running in backend with " elog(ERROR, "COPY command, running in backend with "
...@@ -173,6 +174,7 @@ DoCopy(char *relname, bool binary, bool oids, bool from, bool pipe, ...@@ -173,6 +174,7 @@ DoCopy(char *relname, bool binary, bool oids, bool from, bool pipe,
mode_t oumask; /* Pre-existing umask value */ mode_t oumask; /* Pre-existing umask value */
oumask = umask((mode_t) 0); oumask = umask((mode_t) 0);
/* if we elog() out, the file stays open */
fp = AllocateFile(filename, "w"); fp = AllocateFile(filename, "w");
umask(oumask); umask(oumask);
if (fp == NULL) if (fp == NULL)
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.41 1998/08/29 02:36:18 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.42 1998/08/29 05:27:17 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -323,8 +323,8 @@ other . ...@@ -323,8 +323,8 @@ other .
if (isascii((unsigned char)yytext[i]) && if (isascii((unsigned char)yytext[i]) &&
isupper(yytext[i])) isupper(yytext[i]))
yytext[i] = tolower(yytext[i]); yytext[i] = tolower(yytext[i]);
if (i > NAMEDATALEN) if (i >= NAMEDATALEN)
yytext[NAMEDATALEN] = '\0'; yytext[NAMEDATALEN-1] = '\0';
keyword = ScanKeywordLookup((char*)yytext); keyword = ScanKeywordLookup((char*)yytext);
if (keyword != NULL) { if (keyword != NULL) {
...@@ -402,8 +402,8 @@ other . ...@@ -402,8 +402,8 @@ other .
if (isascii((unsigned char)yytext[i]) && if (isascii((unsigned char)yytext[i]) &&
isupper(yytext[i])) isupper(yytext[i]))
yytext[i] = tolower(yytext[i]); yytext[i] = tolower(yytext[i]);
if (i > NAMEDATALEN) if (i >= NAMEDATALEN)
yytext[NAMEDATALEN] = '\0'; yytext[NAMEDATALEN-1] = '\0';
keyword = ScanKeywordLookup((char*)yytext); keyword = ScanKeywordLookup((char*)yytext);
if (keyword != NULL) { if (keyword != NULL) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment