forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit01697e9
committed
Don't depend on -fwrapv semantics in pgbench's random() function.
Instead use the common/int.h functions to check for integer overflowin a more C-standard-compliant fashion. This is motivated by recentfailures on buildfarm member moonjelly, where it appears thatdevelopment-tip gcc is optimizing without regard to the -fwrapvswitch. Presumably that's a gcc bug that will be fixed soon, butwe might as well install cleaner coding here rather than wait.(This does not address the question of whether we'll ever be ableto get rid of using -fwrapv. Testing shows that this spot is theonly place where doing so creates visible regression test failures,but unfortunately that proves very little.)Back-patch to v12. The common/int.h functions exist in v11, butthat branch doesn't use them in any client-side code. I judgethat this case isn't interesting enough in the real world to takeeven a small risk of issues from being the first such use.Tom Lane and Fabien CoelhoDiscussion:https://postgr.es/m/73927.1624815543@sss.pgh.pa.us1 parentba135fa commit01697e9
1 file changed
+5
-3
lines changedLines changed: 5 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2450 | 2450 |
| |
2451 | 2451 |
| |
2452 | 2452 |
| |
2453 |
| - | |
| 2453 | + | |
| 2454 | + | |
2454 | 2455 |
| |
2455 | 2456 |
| |
2456 | 2457 |
| |
| |||
2459 | 2460 |
| |
2460 | 2461 |
| |
2461 | 2462 |
| |
2462 |
| - | |
| 2463 | + | |
2463 | 2464 |
| |
2464 | 2465 |
| |
2465 | 2466 |
| |
2466 | 2467 |
| |
2467 |
| - | |
| 2468 | + | |
| 2469 | + | |
2468 | 2470 |
| |
2469 | 2471 |
| |
2470 | 2472 |
| |
|
0 commit comments
Comments
(0)