Dan Ports <d...@csail.mit.edu> wrote: 
> On Tue, Feb 08, 2011 at 11:25:34AM +0200, Heikki Linnakangas
wrote:
>> On 08.02.2011 10:43, Kevin Grittner wrote:
>>> I see that at least three BuildFarm critters don't have
>>> UINT64_MAX defined.
>> 
>> I guess we'll have to just #define it ourselves. Or could we just
>> pick another magic value, do we actually rely on
>> InvalidSerCommitSeqno being higher than all other values
>> anywhere?
> 
> As far as I know we don't specifically rely on that anywhere, and
> indeed I did have it #defined to 1 at one point (with the other
> constants adjusted to match) and I don't recall any problems. But
> given that we most often use InvalidSerCommitSeqNo to mean "not
> committed yet", it made more sense to set it to UINT64_MAX so that
> if a comparison did sneak in it would do the right thing.
> 
> I did dust off a copy of the ANSI standard at the time, and it was
> pretty explicit that UINT64_MAX is supposed to be defined in
> <stdint.h>. But that may just be a C99 requirement (I didn't have
> an older copy of the standard), and it's obviously no guarantee
> that it actually is defined.
 
Attached is something which will work.  Whether people prefer this
or a definition of UINT64_MAX in some header file (if it's missing)
doesn't matter much to me.
 
At any rate, if someone commits this one-liner, three critters
should go back to green.
 
-Kevin

*** a/src/include/storage/predicate_internals.h
--- b/src/include/storage/predicate_internals.h
***************
*** 33,39 **** typedef uint64 SerCommitSeqNo;
   *      at that point.  It's earlier than all normal sequence numbers,
   *      and is only used by recovered prepared transactions
   */
! #define InvalidSerCommitSeqNo         UINT64_MAX
  #define RecoverySerCommitSeqNo                ((SerCommitSeqNo) 1)
  #define FirstNormalSerCommitSeqNo     ((SerCommitSeqNo) 2)
  
--- 33,39 ----
   *      at that point.  It's earlier than all normal sequence numbers,
   *      and is only used by recovered prepared transactions
   */
! #define InvalidSerCommitSeqNo         ((SerCommitSeqNo) 
UINT64CONST(0xFFFFFFFFFFFFFFFF))
  #define RecoverySerCommitSeqNo                ((SerCommitSeqNo) 1)
  #define FirstNormalSerCommitSeqNo     ((SerCommitSeqNo) 2)
  
-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to