Re: pgsql: Fix unportable code in pgbench.

From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: pgsql: Fix unportable code in pgbench.
Date: 2019-04-17 21:46:09
Message-ID: alpine.DEB.2.21.1904172339370.26370@lancre
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers


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.

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2019-04-17 21:57:14 Re: pgsql: Fix unportable code in pgbench.
Previous Message Tom Lane 2019-04-17 21:30:36 pgsql: Fix unportable code in pgbench.

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2019-04-17 21:51:21 Re: pg_dump is broken for partition tablespaces
Previous Message Alvaro Herrera 2019-04-17 21:39:01 Re: pg_dump is broken for partition tablespaces