forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commita7145f6
committed
Fix integer-overflow edge case detection in interval_mul and pgbench.
This patch adopts the overflow check logic introduced by commitcbdb8b4into two more places. interval_mul() failed to notice if it computed anew microseconds value that was one more than INT64_MAX, and pgbench'sdouble-to-int64 logic had the same sorts of edge-case problems thatcbdb8b4 fixed in the core code.To make this easier to get right in future, put the guts of the checksinto new macros in c.h, and add commentary about how to use the macroscorrectly.Back-patch to all supported branches, as we did with the previous fix.Yuya WatariDiscussion:https://postgr.es/m/CAJ2pMkbkkFw2hb9Qb1Zj8d06EhWAQXFLy73St4qWv6aX=vqnjw@mail.gmail.com1 parenteffa402 commita7145f6
File tree
7 files changed
+45
-57
lines changed- src
- backend/utils/adt
- bin/pgbench
- include
- test/regress
- expected
- sql
7 files changed
+45
-57
lines changedLines changed: 8 additions & 36 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1212 | 1212 |
| |
1213 | 1213 |
| |
1214 | 1214 |
| |
1215 |
| - | |
1216 |
| - | |
1217 |
| - | |
1218 |
| - | |
1219 |
| - | |
1220 |
| - | |
1221 |
| - | |
1222 |
| - | |
1223 |
| - | |
| 1215 | + | |
| 1216 | + | |
1224 | 1217 |
| |
1225 | 1218 |
| |
1226 | 1219 |
| |
| |||
1244 | 1237 |
| |
1245 | 1238 |
| |
1246 | 1239 |
| |
1247 |
| - | |
1248 |
| - | |
1249 |
| - | |
1250 |
| - | |
1251 |
| - | |
1252 |
| - | |
1253 |
| - | |
1254 |
| - | |
1255 |
| - | |
| 1240 | + | |
| 1241 | + | |
1256 | 1242 |
| |
1257 | 1243 |
| |
1258 | 1244 |
| |
| |||
1300 | 1286 |
| |
1301 | 1287 |
| |
1302 | 1288 |
| |
1303 |
| - | |
1304 |
| - | |
1305 |
| - | |
1306 |
| - | |
1307 |
| - | |
1308 |
| - | |
1309 |
| - | |
1310 |
| - | |
1311 |
| - | |
| 1289 | + | |
| 1290 | + | |
1312 | 1291 |
| |
1313 | 1292 |
| |
1314 | 1293 |
| |
| |||
1332 | 1311 |
| |
1333 | 1312 |
| |
1334 | 1313 |
| |
1335 |
| - | |
1336 |
| - | |
1337 |
| - | |
1338 |
| - | |
1339 |
| - | |
1340 |
| - | |
1341 |
| - | |
1342 |
| - | |
1343 |
| - | |
| 1314 | + | |
| 1315 | + | |
1344 | 1316 |
| |
1345 | 1317 |
| |
1346 | 1318 |
| |
|
Lines changed: 4 additions & 18 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1216 | 1216 |
| |
1217 | 1217 |
| |
1218 | 1218 |
| |
1219 |
| - | |
1220 |
| - | |
1221 |
| - | |
1222 |
| - | |
1223 |
| - | |
1224 |
| - | |
1225 |
| - | |
1226 |
| - | |
1227 |
| - | |
| 1219 | + | |
| 1220 | + | |
1228 | 1221 |
| |
1229 | 1222 |
| |
1230 | 1223 |
| |
| |||
1258 | 1251 |
| |
1259 | 1252 |
| |
1260 | 1253 |
| |
1261 |
| - | |
1262 |
| - | |
1263 |
| - | |
1264 |
| - | |
1265 |
| - | |
1266 |
| - | |
1267 |
| - | |
1268 |
| - | |
1269 |
| - | |
| 1254 | + | |
| 1255 | + | |
1270 | 1256 |
| |
1271 | 1257 |
| |
1272 | 1258 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3233 | 3233 |
| |
3234 | 3234 |
| |
3235 | 3235 |
| |
3236 |
| - | |
| 3236 | + | |
3237 | 3237 |
| |
3238 | 3238 |
| |
3239 | 3239 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1675 | 1675 |
| |
1676 | 1676 |
| |
1677 | 1677 |
| |
1678 |
| - | |
| 1678 | + | |
1679 | 1679 |
| |
1680 |
| - | |
| 1680 | + | |
1681 | 1681 |
| |
1682 | 1682 |
| |
1683 | 1683 |
| |
|
Lines changed: 24 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1030 | 1030 |
| |
1031 | 1031 |
| |
1032 | 1032 |
| |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
1033 | 1057 |
| |
1034 | 1058 |
| |
1035 | 1059 |
| |
|
Lines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
232 | 232 |
| |
233 | 233 |
| |
234 | 234 |
| |
| 235 | + | |
| 236 | + | |
| 237 | + | |
235 | 238 |
| |
236 | 239 |
| |
237 | 240 |
| |
|
Lines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
73 | 73 |
| |
74 | 74 |
| |
75 | 75 |
| |
| 76 | + | |
| 77 | + | |
| 78 | + | |
76 | 79 |
| |
77 | 80 |
| |
78 | 81 |
| |
|
0 commit comments
Comments
(0)