Commit 2618fcdf authored by Bruce Momjian's avatar Bruce Momjian

Fix scanner name length trimming.

parent 53916cab
......@@ -6,7 +6,7 @@
*
*
* 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,
}
else
{
/* if we elog() out, the file stays open */
fp = AllocateFile(filename, "r");
if (fp == NULL)
elog(ERROR, "COPY command, running in backend with "
......@@ -173,6 +174,7 @@ DoCopy(char *relname, bool binary, bool oids, bool from, bool pipe,
mode_t oumask; /* Pre-existing umask value */
oumask = umask((mode_t) 0);
/* if we elog() out, the file stays open */
fp = AllocateFile(filename, "w");
umask(oumask);
if (fp == NULL)
......
......@@ -8,7 +8,7 @@
*
*
* 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 .
if (isascii((unsigned char)yytext[i]) &&
isupper(yytext[i]))
yytext[i] = tolower(yytext[i]);
if (i > NAMEDATALEN)
yytext[NAMEDATALEN] = '\0';
if (i >= NAMEDATALEN)
yytext[NAMEDATALEN-1] = '\0';
keyword = ScanKeywordLookup((char*)yytext);
if (keyword != NULL) {
......@@ -402,8 +402,8 @@ other .
if (isascii((unsigned char)yytext[i]) &&
isupper(yytext[i]))
yytext[i] = tolower(yytext[i]);
if (i > NAMEDATALEN)
yytext[NAMEDATALEN] = '\0';
if (i >= NAMEDATALEN)
yytext[NAMEDATALEN-1] = '\0';
keyword = ScanKeywordLookup((char*)yytext);
if (keyword != NULL) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment