Re: [HACKERS] PostGreSQL v6.2.1 for Linux Alpha - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: [HACKERS] PostGreSQL v6.2.1 for Linux Alpha
Date
Msg-id 199802121446.JAA24893@candle.pha.pa.us
Whole thread Raw
In response to Re: [HACKERS] PostGreSQL v6.2.1 for Linux Alpha  (Bruce Momjian <maillist@candle.pha.pa.us>)
Responses Re: [HACKERS] PostGreSQL v6.2.1 for Linux Alpha  (Bruce Momjian <maillist@candle.pha.pa.us>)
Re: [HACKERS] PostGreSQL v6.2.1 for Linux Alpha  ("Kenji T. Hollis" <khollis@Gawain.Houston-InterWeb.COM>)
List pgsql-hackers
> Take a look at utils/hash/hashfn.c:tag_hash.  Is there a problem in that
> code for your platform.  Is the hash getting set, or is it falling
> through the case statements?  This code is clearly broken for
> sizeof(int) > 4, but I think your ints are 4, and longs are 8.  I bet
> somewhere we are using a long where we should be using an int, and that
> is why only your platform is seeing it.  Is this true about long vs.
> int.  I can review our use of longs to see if there are problems.

OK, I have a new idea.  See in utils/hash/hashfn.c:tag_hash, there is
the line:

            for (; keysize > (sizeof(int) - 1); keysize -= sizeof(int),key++)
                h = h * PRIME1 ^ (*key);

Now, since h is a long, shouldn't the for loop be comparing
sizeof(long)?  However, key is an int*.

Comments?


--
Bruce Momjian
maillist@candle.pha.pa.us

pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] PostGreSQL v6.2.1 for Linux Alpha
Next
From: "Boersenspielteam"
Date:
Subject: Re: [HACKERS] Problem with the numbers I reported yesterday