Re: [HACKERS] More on 6.4 on DEC Alpha + Digital Unix 4.0d + DEC C compiler

From: "Pedro J(dot) Lobo" <pjlobo(at)euitt(dot)upm(dot)es>
To: phd2(at)earthling(dot)net
Cc: PostgreSQL hackers mailing list <pgsql-hackers(at)postgreSQL(dot)org>, "Thomas G(dot) Lockhart" <lockhart(at)alumni(dot)caltech(dot)edu>
Subject: Re: [HACKERS] More on 6.4 on DEC Alpha + Digital Unix 4.0d + DEC C compiler
Date: 1998-11-19 10:37:51
Message-ID: Pine.OSF.4.05.9811191112530.24390-100000@haddock.euitt.upm.es
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, 19 Nov 1998, Oleg Broytmann wrote:

>Hi!
>
>On Thu, 19 Nov 1998, Thomas G. Lockhart wrote:
>> > 2) The tests for char, varchar, select_implicit, select_having and
>> > rules fail when locale is enabled, and pass when locale is disabled.
>> > This is due to character comparisons being case insensitive when
>> > locale is enabled. I don't think this is the correct behaviour. I'd
>> > appreciate any hint on where to look to investigate this further.
>>
>> src/backend/utils/adt/varlena.c
>
> "character comparisons being case insensitive"? It is a problem in your
>locale, not in the comparison code (I hope). There is no such thing as
>"case-insensitive strcoll", and I just used strcoll in varlena.c.
> The same problem popped up many times among linux users. Just install
>correct locale - and all will run well. There are test programs in
>src/test/locale, look carefully. If you can - supply test data for your
>locale.

Well, after a bit of investigation, now I know where the problem is. When
you do a case sensitive comparison, 'A' is considered "smaller" than 'a'.
Except, of course, if you use Digital's strcoll() (agh!). The comparison
when locale is enabled isn't case insensitive. Simply, the "sensitivity"
is inverted: 'A' is considered *greater* than 'a' (but not equal, as I
first thought). When you use the 'C' locale (that is, no locale), then the
output of strcmp() and strcoll() is the same.

So, this is indeed a Digital Unix problem. I've made the same tests under
FreeBSD, and they work as expected on it.

The next question is what to do now. I will send a message to Digital so
they can fix this bug in future releases, but what do I do in the
meantime? The problem is not dangerous except if you rely on upper-case
letters being ordered before lower-case. I could make a custom "expected"
output so that the regression tests do not fail, or we could simply write
a "README.DigitalUnix" telling the story. Writing a custom strcoll() seems
a bit overkill. What do you think?

>(It looks like my messages to pgsql-*(at)postgresql(dot)org are usually dropped to
>floor. If anyone see it - please confirm, send to: phd2(at)earthling(dot)net(dot) I
>have no problems receiving mail from these lists, neither sending to many
>other lists I am on).

Your message made it to the list (I received it two times, one from you
and other from the list).

-------------------------------------------------------------------
Pedro José Lobo Perea Tel: +34 91 336 78 19
Centro de Cálculo Fax: +34 91 331 92 29
EUIT Telecomunicación - UPM e-mail: pjlobo(at)euitt(dot)upm(dot)es

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Oleg Broytmann 1998-11-19 11:10:39 Re: [HACKERS] More on 6.4 on DEC Alpha + Digital Unix 4.0d + DEC C compiler
Previous Message Oleg Broytmann 1998-11-19 09:26:01 Re: [HACKERS] More on 6.4 on DEC Alpha + Digital Unix 4.0d + DEC C compiler