Bug #949: Incorrecr parse charset.conf and recode tables.

From: pgsql-bugs(at)postgresql(dot)org
To: pgsql-bugs(at)postgresql(dot)org
Subject: Bug #949: Incorrecr parse charset.conf and recode tables.
Date: 2003-04-18 06:55:32
Message-ID: 20030418065532.B6BD2476323@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Ilya V. Panfilov (ivp(at)ie(dot)tusur(dot)ru) reports a bug with a severity of 3
The lower the number the more severe it is.

Short Description
Incorrecr parse charset.conf and recode tables.

Long Description
ver PostgreSQL 7.3.2; OS FreeBSD 4.7
configured with --enable-recode option

Due parsing charset.conf and recode-table files postmaster write to log messages like the following:

LOG: GetCharSetByHost: unknown tag win in file charset.conf
LOG: GetCharSetByHost: unknown tag in file charset.conf
LOG: SetCharSet: unknown tag in file koi-win.tab

This bug was fixed by modify src/backend/utils/init/miscinit.c
Difference between new and old file included in "Example Code" field.

Sample Code
*** miscinit.c Fri Apr 18 12:48:18 2003
--- miscinit.old.c Fri Apr 18 12:34:58 2003
***************
*** 241,253 ****
RecodeBackTable[ToChar - 128] = FromChar;

/* read to EOL */
! do
{
next_token(file, buf, sizeof(buf));
! if (buf[0])
! elog(LOG, "SetCharSet: unknown tag %s in file %s",
buf, filename);
! } while (!feof(file) && buf[0]);
}
}
}
--- 241,252 ----
RecodeBackTable[ToChar - 128] = FromChar;

/* read to EOL */
! while (!feof(file) && buf[0])
{
next_token(file, buf, sizeof(buf));
! elog(LOG, "SetCharSet: unknown tag %s in file %s",
buf, filename);
! }
}
}
}
***************
*** 416,422 ****
next_token(file, buf, sizeof(buf));
if (buf[0] != '\0')
strcpy(HostCharset, buf);
! } else next_token(file, buf, sizeof(buf));
}
break;
case KEY_BASE:
--- 415,421 ----
next_token(file, buf, sizeof(buf));
if (buf[0] != '\0')
strcpy(HostCharset, buf);
! }
}
break;
case KEY_BASE:
***************
*** 453,465 ****
}

/* read to EOL */
! do
{
next_token(file, buf, sizeof(buf));
! if (buf[0])
! elog(LOG, "GetCharSetByHost: unknown tag %s in file %s",
buf, CHARSET_FILE);
! } while (!feof(file) && buf[0]);
}
}
FreeFile(file);
--- 452,463 ----
}

/* read to EOL */
! while (!feof(file) && buf[0])
{
next_token(file, buf, sizeof(buf));
! elog(LOG, "GetCharSetByHost: unknown tag %s in file %s",
buf, CHARSET_FILE);
! }
}
}
FreeFile(file);

No file was uploaded with this report

Browse pgsql-bugs by date

  From Date Subject
Next Message Weiping He 2003-04-18 09:18:15 does parser still parse those comment out lines?
Previous Message Tom Lane 2003-04-17 14:47:45 Re: Bug #948: Postgresql server abruptly shutdown now database doesnt start