Re: [HACKERS] fatal copy in/out error (6.5.3)

From: Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp>
To: robinson(at)netrinsics(dot)com
Cc: t-ishii(at)sra(dot)co(dot)jp, pgsql-hackers(at)hub(dot)org, tgl(at)sss(dot)pgh(dot)pa(dot)us
Subject: Re: [HACKERS] fatal copy in/out error (6.5.3)
Date: 2000-01-25 05:00:04
Message-ID: 20000125140004W.t-ishii@sra.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> It could be that one of our users had their input method set to produce
> EUC_TW or Big5.
>
> >In short, the problem you have is caused by:
> >1) wrong data submitted into the table
>
> Kind of hard to control that when data is submitted by random users on
> the Internet.

Yes, it's not a PostgreSQL's business but is a really big problem in
the real world. Maybe some HTML gurus might have good suggestions on
these issues (something like using a language tag?)

> >I would recommend you delete the data since it's not correct anyway.
> >In the mean time I'm going to fix 2) so that it assumes data be
> >consisted of 2 bytes even if wrong data sequence is submitted
> >(needless to say, except ascii).
> >Do you want the backpatch for 6.5.3?
>
> Very much so. Thank you.

Here it is. With this patch, copy out should be happy even with the
wrong data. I'm not sure if it could be displayed correctly, though.
--
Tatsuo Ishii
------------------------------- cut here ------------------------------------
*** postgresql-6.5.3/src/backend/utils/mb/wchar.c.orig Tue Jan 25 13:37:21 2000
--- postgresql-6.5.3/src/backend/utils/mb/wchar.c Tue Jan 25 13:37:33 2000
***************
*** 166,176 ****
{
int len;

! if (*s == SS2)
! len = 3;
! else if (*s == SS3)
! len = 3;
! else if (*s & 0x80)
len = 2;
else
len = 1;
--- 166,172 ----
{
int len;

! if (*s & 0x80)
len = 2;
else
len = 1;

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2000-01-25 05:00:56 Re: [HACKERS] Happy column dropping
Previous Message Don Baccus 2000-01-25 04:50:03 RE: [HACKERS] Happy column dropping