forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit7fbc75b
committed
Add soft error handling to some expression nodes
This adjusts the expression evaluation code for CoerceViaIO andCoerceToDomain to handle errors softly if needed.For CoerceViaIo, this means using InputFunctionCallSafe(), whichprovides the option to handle errors softly, instead of calling thetype input function directly.For CoerceToDomain, this simply entails replacing the ereport() inExecEvalConstraintCheck() by errsave().In both cases, the ErrorSaveContext to be used when evaluating theexpression is stored by ExecInitExprRec() in the expression's structin the expression's ExprEvalStep. The ErrorSaveContext is passed bysetting ExprState.escontext to point to it when callingExecInitExprRec() on the expression whose errors are to be handledsoftly.Note that no call site of ExecInitExprRec() has been changed in thiscommit, so there's no functional change. This is intended forimplementing new SQL/JSON expression nodes in future commits thatwill use to it suppress errors that may occur during type coercions.Reviewed-by: Álvaro HerreraDiscussion:https://postgr.es/m/CA+HiwqE4XTdfb1nW=Ojoy_tQSRhYt-q_kb6i5d4xcKyrLC1Nbg@mail.gmail.com1 parent2940f1c commit7fbc75b
File tree
9 files changed
+96
-69
lines changed- src
- backend
- executor
- jit/llvm
- include
- executor
- jit
- nodes
9 files changed
+96
-69
lines changedLines changed: 11 additions & 17 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
139 | 139 |
| |
140 | 140 |
| |
141 | 141 |
| |
| 142 | + | |
142 | 143 |
| |
143 | 144 |
| |
144 | 145 |
| |
| |||
176 | 177 |
| |
177 | 178 |
| |
178 | 179 |
| |
| 180 | + | |
179 | 181 |
| |
180 | 182 |
| |
181 | 183 |
| |
| |||
228 | 230 |
| |
229 | 231 |
| |
230 | 232 |
| |
| 233 | + | |
231 | 234 |
| |
232 | 235 |
| |
233 | 236 |
| |
| |||
373 | 376 |
| |
374 | 377 |
| |
375 | 378 |
| |
| 379 | + | |
376 | 380 |
| |
377 | 381 |
| |
378 | 382 |
| |
| |||
544 | 548 |
| |
545 | 549 |
| |
546 | 550 |
| |
| 551 | + | |
547 | 552 |
| |
548 | 553 |
| |
549 | 554 |
| |
| |||
1549 | 1554 |
| |
1550 | 1555 |
| |
1551 | 1556 |
| |
1552 |
| - | |
1553 |
| - | |
1554 | 1557 |
| |
1555 | 1558 |
| |
1556 | 1559 |
| |
| |||
1579 | 1582 |
| |
1580 | 1583 |
| |
1581 | 1584 |
| |
1582 |
| - | |
1583 |
| - | |
1584 | 1585 |
| |
1585 |
| - | |
| 1586 | + | |
1586 | 1587 |
| |
1587 | 1588 |
| |
1588 |
| - | |
1589 |
| - | |
1590 |
| - | |
1591 | 1589 |
| |
1592 |
| - | |
1593 |
| - | |
1594 |
| - | |
1595 |
| - | |
1596 |
| - | |
1597 |
| - | |
1598 |
| - | |
1599 |
| - | |
1600 |
| - | |
| 1590 | + | |
| 1591 | + | |
1601 | 1592 |
| |
1602 | 1593 |
| |
1603 | 1594 |
| |
| |||
1628 | 1619 |
| |
1629 | 1620 |
| |
1630 | 1621 |
| |
| 1622 | + | |
1631 | 1623 |
| |
1632 | 1624 |
| |
1633 | 1625 |
| |
| |||
3306 | 3298 |
| |
3307 | 3299 |
| |
3308 | 3300 |
| |
| 3301 | + | |
| 3302 | + | |
3309 | 3303 |
| |
3310 | 3304 |
| |
3311 | 3305 |
| |
|
Lines changed: 17 additions & 19 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1177 | 1177 |
| |
1178 | 1178 |
| |
1179 | 1179 |
| |
1180 |
| - | |
1181 |
| - | |
| 1180 | + | |
1182 | 1181 |
| |
1183 |
| - | |
1184 |
| - | |
1185 |
| - | |
1186 |
| - | |
1187 |
| - | |
1188 |
| - | |
1189 |
| - | |
1190 |
| - | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
1191 | 1192 |
| |
1192 |
| - | |
1193 |
| - | |
1194 |
| - | |
| 1193 | + | |
| 1194 | + | |
| 1195 | + | |
| 1196 | + | |
| 1197 | + | |
1195 | 1198 |
| |
1196 |
| - | |
1197 |
| - | |
1198 | 1199 |
| |
1199 |
| - | |
1200 | 1200 |
| |
1201 |
| - | |
1202 |
| - | |
1203 | 1201 |
| |
1204 | 1202 |
| |
1205 | 1203 |
| |
| |||
3745 | 3743 |
| |
3746 | 3744 |
| |
3747 | 3745 |
| |
3748 |
| - | |
| 3746 | + | |
3749 | 3747 |
| |
3750 | 3748 |
| |
3751 | 3749 |
| |
|
Lines changed: 4 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
70 | 70 |
| |
71 | 71 |
| |
72 | 72 |
| |
| 73 | + | |
73 | 74 |
| |
74 | 75 |
| |
75 | 76 |
| |
76 | 77 |
| |
77 | 78 |
| |
78 | 79 |
| |
| 80 | + | |
79 | 81 |
| |
80 | 82 |
| |
81 | 83 |
| |
| |||
1118 | 1120 |
| |
1119 | 1121 |
| |
1120 | 1122 |
| |
| 1123 | + | |
1121 | 1124 |
| |
1122 | 1125 |
| |
1123 | 1126 |
| |
| |||
1127 | 1130 |
| |
1128 | 1131 |
| |
1129 | 1132 |
| |
| 1133 | + | |
1130 | 1134 |
| |
1131 | 1135 |
| |
1132 | 1136 |
| |
|
Lines changed: 39 additions & 32 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1251 | 1251 |
| |
1252 | 1252 |
| |
1253 | 1253 |
| |
1254 |
| - | |
1255 |
| - | |
1256 |
| - | |
1257 |
| - | |
1258 |
| - | |
1259 |
| - | |
1260 |
| - | |
1261 |
| - | |
| 1254 | + | |
| 1255 | + | |
| 1256 | + | |
1262 | 1257 |
| |
1263 | 1258 |
| |
1264 | 1259 |
| |
| |||
1271 | 1266 |
| |
1272 | 1267 |
| |
1273 | 1268 |
| |
1274 |
| - | |
1275 | 1269 |
| |
1276 | 1270 |
| |
1277 | 1271 |
| |
| |||
1283 | 1277 |
| |
1284 | 1278 |
| |
1285 | 1279 |
| |
1286 |
| - | |
1287 | 1280 |
| |
1288 |
| - | |
1289 |
| - | |
1290 |
| - | |
1291 |
| - | |
1292 |
| - | |
1293 |
| - | |
1294 | 1281 |
| |
1295 | 1282 |
| |
1296 | 1283 |
| |
| |||
1356 | 1343 |
| |
1357 | 1344 |
| |
1358 | 1345 |
| |
| 1346 | + | |
| 1347 | + | |
| 1348 | + | |
| 1349 | + | |
| 1350 | + | |
| 1351 | + | |
| 1352 | + | |
1359 | 1353 |
| |
1360 |
| - | |
1361 |
| - | |
1362 |
| - | |
1363 |
| - | |
1364 |
| - | |
1365 |
| - | |
1366 |
| - | |
1367 |
| - | |
1368 |
| - | |
1369 |
| - | |
1370 |
| - | |
1371 |
| - | |
1372 |
| - | |
1373 |
| - | |
1374 |
| - | |
| 1354 | + | |
| 1355 | + | |
| 1356 | + | |
| 1357 | + | |
| 1358 | + | |
| 1359 | + | |
| 1360 | + | |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
| 1364 | + | |
| 1365 | + | |
1375 | 1366 |
| |
1376 |
| - | |
| 1367 | + | |
| 1368 | + | |
| 1369 | + | |
| 1370 | + | |
| 1371 | + | |
| 1372 | + | |
| 1373 | + | |
| 1374 | + | |
| 1375 | + | |
| 1376 | + | |
| 1377 | + | |
| 1378 | + | |
| 1379 | + | |
| 1380 | + | |
| 1381 | + | |
| 1382 | + | |
| 1383 | + | |
1377 | 1384 |
| |
1378 | 1385 |
| |
1379 | 1386 |
| |
|
Lines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
59 | 59 |
| |
60 | 60 |
| |
61 | 61 |
| |
| 62 | + | |
62 | 63 |
| |
63 | 64 |
| |
64 | 65 |
| |
65 | 66 |
| |
66 | 67 |
| |
67 | 68 |
| |
68 | 69 |
| |
| 70 | + | |
69 | 71 |
| |
70 | 72 |
| |
71 | 73 |
| |
| |||
136 | 138 |
| |
137 | 139 |
| |
138 | 140 |
| |
| 141 | + | |
139 | 142 |
| |
140 | 143 |
| |
141 | 144 |
| |
|
Lines changed: 4 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
16 | 16 |
| |
17 | 17 |
| |
18 | 18 |
| |
| 19 | + | |
19 | 20 |
| |
20 | 21 |
| |
21 | 22 |
| |
| |||
416 | 417 |
| |
417 | 418 |
| |
418 | 419 |
| |
419 |
| - | |
| 420 | + | |
| 421 | + | |
420 | 422 |
| |
421 | 423 |
| |
422 | 424 |
| |
| |||
547 | 549 |
| |
548 | 550 |
| |
549 | 551 |
| |
| 552 | + | |
550 | 553 |
| |
551 | 554 |
| |
552 | 555 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
75 | 75 |
| |
76 | 76 |
| |
77 | 77 |
| |
| 78 | + | |
78 | 79 |
| |
79 | 80 |
| |
80 | 81 |
| |
81 | 82 |
| |
82 | 83 |
| |
83 | 84 |
| |
84 | 85 |
| |
| 86 | + | |
85 | 87 |
| |
86 | 88 |
| |
87 | 89 |
| |
|
Lines changed: 9 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
85 | 85 |
| |
86 | 86 |
| |
87 | 87 |
| |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
88 | 97 |
| |
89 | 98 |
| |
90 | 99 |
| |
|
Lines changed: 7 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
34 | 34 |
| |
35 | 35 |
| |
36 | 36 |
| |
| 37 | + | |
37 | 38 |
| |
38 | 39 |
| |
39 | 40 |
| |
| |||
129 | 130 |
| |
130 | 131 |
| |
131 | 132 |
| |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
132 | 139 |
| |
133 | 140 |
| |
134 | 141 |
| |
|
0 commit comments
Comments
(0)