initdb bug in Postgres on Ultrasparc platform

From: Silvio Macedo <smacedo(at)ic(dot)ac(dot)uk>
To: bugs(at)postgresql(dot)org
Subject: initdb bug in Postgres on Ultrasparc platform
Date: 1999-11-25 11:39:34
Message-ID: Pine.LNX.4.10.9911242251470.5606-100000@test133.ee.ic.ac.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


Hello!

Regarding the email I sent yesterday about a bug when running initdb in a
Linux/Ultraparc machine, I want to add that I have found the problem.

There is a simple fix for the bug that I detected.

In the src/backend/utils/adt/name.c ,
the function nameeq(), will fail on linux/ultrasparc because sometimes
strncmp will return -256, which when casted to bool, gives 0

What you do is
return (bool) strncmp(...) == 0
and you should do
return (bool) (strncmp(...)==0)

because otherwise, if strncmp returns -256, the bool cast will make it 0,
which is not what you want.

I will send a proper bug report with the patch in a few minutes.

,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
``````````````````````````````````````````````````````````````````````````
Silvio Emanuel Nunes Barbosa de Macedo

smacedo(at)ic(dot)ac(dot)uk smacedo(at)inescn(dot)pt
Imperial College, University of London INESC Porto
Intelligent and Interactive Systems Telecom. and Multimedia
Exhibition Road, Pc da Republica, 93
London SW7 2AZ, England 4050-497 PORTO PORTUGAL
Tel:+44 171 5946323 Tel:+351 22 2094220

Browse pgsql-bugs by date

  From Date Subject
Next Message Silvio Macedo 1999-11-25 14:24:40 NOW, I SEND A PATCH ; initdb & general string compares - all Pg 6.5.2,6.5.3,snapshot,RPMS, SRPMS
Previous Message Bruce Momjian 1999-11-23 19:43:43 Re: [PATCHES] ecpg generates wrong code for EXEC SQL FREE <cursor>