Add overflow test in function numeric_exp.

Started by Yang Xiaoalmost 8 years ago2 messageshackers
Beta feature

Hackorum builds and tests every patch posted to the lists, not only commitfest submissions. This is Hackorum's own CI rather than the PostgreSQL project's, and it is still under testing - please report anything that looks wrong.

appliesbuild failedCI history

Every patchset is also pushed to a branch of our PostgreSQL fork, so you can check out the same tree CI built. Without a PostgreSQL checkout:

git clone --branch t39472_1 https://github.com/hackorum-dev/postgres.git

In a checkout you already have, add the fork once:

git remote add hackorum https://github.com/hackorum-dev/postgres.git

then, for this patchset and every later one:

git fetch hackorum t39472_1 && git checkout t39472_1

Patchset v1 (message #1) is on t39472_1

Jump to latest
#1Yang Xiao
YangX92@hotmail.com

Hi,

The attachment is the proposal patch for function numeric_exp in
src/backend/utils/adt/numeric.c.

Young

Attachments:

t39472_1
0001-Add-overflow-test-in-function-numeric_exp.patchtext/plain; name=0001-Add-overflow-test-in-function-numeric_exp.patchDownload+7-6
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Yang Xiao (#1)
Re: Add overflow test in function numeric_exp.

Yang Xiao <YangX92@hotmail.com> writes:

The attachment is the proposal patch for function numeric_exp in
src/backend/utils/adt/numeric.c.

Why do we need this? numeric_exp() already detects result overflow.

regression=# select numeric_exp(10000);
ERROR: value overflows numeric format

regards, tom lane