Re: pgbench show progress report extremely frequently if "--progress" >= 2148 caused by integer overflow

From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: Kingter Wang <tew(at)vmware(dot)com>
Cc: PostgreSQL Bugs List <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: pgbench show progress report extremely frequently if "--progress" >= 2148 caused by integer overflow
Date: 2014-01-17 22:04:55
Message-ID: alpine.DEB.2.10.1401172258010.19515@sto
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


Hello,

> The integer progress multiple by 1000,000 to convert from second to
> micro-second. If progress >= 2148, then the value of progress * 1000,000
> (2,148,000,000) will larger than max value of 32 bits integer
> (2,147,483,647).

Indeed. Shame on me! I had not thought of overflows because of the false
security of in64 target type. Thanks for the missing cast!

--
Fabien.

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message deadhead 2014-01-18 23:08:59 BUG #8869: ip4r93-1.05-3.rhel6 syntax error in ip4r.sql - LANGUAGE 'C' instead of LANGUAGE 'c'
Previous Message Tom Lane 2014-01-17 19:36:25 Re: [HACKERS] surprising to_timestamp behavior