pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Fabien COELHO <coelho@cri.ensmp.fr>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: PostgreSQL Developers <pgsql-hackers@lists.postgresql.org>
Subject: Re: pgsql: Fix unportable code in pgbench.
Date: Wed, 17 Apr 2019 23:46:09 +0200 (CEST)
Message-ID: <alpine.DEB.2.21.1904172339370.26370@lancre> (raw)
In-Reply-To: <E1hGs8a-0000DY-Ff@gemulon.postgresql.org>
References: <E1hGs8a-0000DY-Ff@gemulon.postgresql.org>


Hello Tom,

> Fix unportable code in pgbench.

Sorry for this unforseen issue... portability is a pain:-(

> The buildfarm points out that UINT64_FORMAT might not work with sscanf;
> it's calibrated for our printf implementation, which might not agree
> with the platform-supplied sscanf.  Fall back to just accepting an
> unsigned long, which is already more than the documentation promises.

Yep, but ISTM that it is down to 32 bits, whereas the PRNG seed expects 48 
bits a few lines below:

     base_random_sequence.xseed[0] = iseed & 0xFFFF;
     base_random_sequence.xseed[1] = (iseed >> 16) & 0xFFFF;
     base_random_sequence.xseed[2] = (iseed >> 32) & 0xFFFF;

So the third short is now always 0. Hmmm. I'll propose another option over 
the week-end.

-- 
Fabien.





view thread (4+ messages)  latest in thread

Message-ID: <alpine.DEB.2.21.1904172339370.26370@lancre>
Permalink:  ../alpine.DEB.2.21.1904172339370.26370@lancre/
Also on:    postgresql.org/message-id/alpine.DEB.2.21.1904172339370.26370@lancre

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: coelho@cri.ensmp.fr, tgl@sss.pgh.pa.us, pgsql-hackers@lists.postgresql.org
  Subject: Re: pgsql: Fix unportable code in pgbench.
  In-Reply-To: <alpine.DEB.2.21.1904172339370.26370@lancre>
  References: <E1hGs8a-0000DY-Ff@gemulon.postgresql.org> <alpine.DEB.2.21.1904172339370.26370@lancre>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox