Re: length coerce for bpchar is broken since 7.0

From: Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp>
To: pgman(at)candle(dot)pha(dot)pa(dot)us
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: length coerce for bpchar is broken since 7.0
Date: 2001-01-20 04:09:32
Message-ID: 20010120130932K.t-ishii@sra.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I believe this has been fixed.

>Subject: [COMMITTERS] pgsql/src/backend/utils/adt (varchar.c)
>From: ishii(at)postgresql(dot)org
>To: pgsql-committers(at)postgresql(dot)org
>Date: Sun, 26 Nov 2000 06:35:23 -0500 (EST)

> Can someone comment on the status of this?
>
> > It seems the length coerce for bpchar is broken since 7.0.
> > In 6.5 when a string is inserted, bpchar() is called to properly clip
> > the string. However in 7.0 (and probably current) bpchar() is not
> > called anymore.
> >
> > coerce_type_typmod() calls exprTypmod(). exprTypmod() returns VARSIZE
> > of the bpchar data only if the data type is bpchar (if the data type
> > is varchar, exprTypmod just returns -1 and the parser add a function
> > node to call varchar(). so there is no problem for varchar). If
> > VARSIZE returned from exprTypmod() and atttypmod passed to
> > coerce_type_typmod() is equal, the function node to call bpchar()
> > would not be added.
> >
> > I'm not sure if this was an intended efect of the change. Anyway we
> > have to do the length coerce for bpchar somewhere and I'm thinking now
> > is doing in bpcharin(). This would also solve the problem in copy in a
> > mail I have posted.
> >
> > Comments?
> > --
> > Tatsuo Ishii
> >
>
>
> --
> Bruce Momjian | http://candle.pha.pa.us
> pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
> + If your life is a hard drive, | 830 Blythe Avenue
> + Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tatsuo Ishii 2001-01-20 04:12:27 C++ interface build on FreeBSD 4.2 broken?
Previous Message Bruce Momjian 2001-01-20 03:45:27 Rule/SELECT