Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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










pgsql-bugs by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group