aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/nodeModifyTable.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2018-03-17 15:38:15 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2018-03-17 15:38:15 -0400
commit2dbee9f19f6c6ac6c013f668611492486e623807 (patch)
tree20e93372a7955ce370c195328ae1de686bf8822b /src/backend/executor/nodeModifyTable.c
parent8f5ac440430ab1d4b0309a76df278caa87018beb (diff)
downloadpostgresql-2dbee9f19f6c6ac6c013f668611492486e623807.tar.gz
postgresql-2dbee9f19f6c6ac6c013f668611492486e623807.zip
Fix overflow handling in plpgsql's integer FOR loops.
The test to exit the loop if the integer control value would overflow an int32 turns out not to work on some ICC versions, as it's dependent on the assumption that the compiler will execute the code as written rather than "optimize" it. ICC lacks any equivalent of gcc's -fwrapv switch, so it was optimizing on the assumption of no integer overflow, and that breaks this. Rewrite into a form that in fact does not do any overflowing computations. Per Tomas Vondra and buildfarm member fulmar. It's been like this for a long time, although it was not till we added a regression test case covering the behavior (in commit dd2243f2a) that the problem became apparent. Back-patch to all supported versions. Discussion: https://postgr.es/m/50562fdc-0876-9843-c883-15b8566c7511@2ndquadrant.com
Diffstat (limited to 'src/backend/executor/nodeModifyTable.c')
0 files changed, 0 insertions, 0 deletions