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

From Fabien COELHO
Subject Re: pgbench show progress report extremely frequently if "--progress" >= 2148 caused by integer overflow
Date
Msg-id alpine.DEB.2.10.1401172258010.19515@sto
Whole thread Raw
In response to pgbench show progress report extremely frequently if "--progress" >= 2148 caused by integer overflow  (Kingter Wang <tew@vmware.com>)
List 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.

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] surprising to_timestamp behavior
Next
From: marko@joh.to
Date:
Subject: BUG #8870: PL/PgSQL, SELECT .. INTO and the number of result columns