forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitaaaf944
committed
Add soft error handling to some expression nodes
This adjusts the code for CoerceViaIO and CoerceToDomain expressionnodes to handle errors softly.For CoerceViaIo, this adds a new ExprEvalStep opcodeEEOP_IOCOERCE_SAFE, which is implemented in the new accompanyingfunction ExecEvalCoerceViaIOSafe(). The only difference fromEEOP_IOCOERCE's inline implementation is that the input functionreceives an ErrorSaveContext via the function'sFunctionCallInfo.context, which it can use to handle errors softly.For CoerceToDomain, this simply entails replacing the ereport() inExecEvalConstraintNotNull() and ExecEvalConstraintCheck() byerrsave() passing it the ErrorSaveContext passed in the expression'sExprEvalStep.In both cases, the ErrorSaveContext to be used is passed by settingExprState.escontext to point to it before calling ExecInitExprRec()on the expression tree whose errors are to be handled softly.Note that there's no functional change as of this commit as no callsite of ExecInitExprRec() has been changed. This is intended forimplementing new SQL/JSON expression nodes in future commits.Extracted from a much larger patch to add SQL/JSON query functions.Author: Nikita Glukhov <n.gluhov@postgrespro.ru>Author: Teodor Sigaev <teodor@sigaev.ru>Author: Oleg Bartunov <obartunov@gmail.com>Author: Alexander Korotkov <aekorotkov@gmail.com>Author: Andrew Dunstan <andrew@dunslane.net>Author: Amit Langote <amitlangote09@gmail.com>Reviewers have included (in no particular order) Andres Freund,Alexander Korotkov, Pavel Stehule, Andrew Alsup, Erik Rijkers,Zihong Yu, Himanshu Upadhyaya, Daniel Gustafsson, Justin Pryzby,Álvaro Herrera, Jian He, Peter EisentrautDiscussion:https://postgr.es/m/cd0bb935-0158-78a7-08b5-904886deac4b@postgrespro.ruDiscussion:https://postgr.es/m/20220616233130.rparivafipt6doj3@alap3.anarazel.deDiscussion:https://postgr.es/m/abd9b83b-aa66-f230-3d6d-734817f0995d%40postgresql.orgDiscussion:https://postgr.es/m/CA+HiwqHROpf9e644D8BRqYvaAPmgBZVup-xKMDPk-nd4EpgzHw@mail.gmail.comDiscussion:https://postgr.es/m/CA+HiwqE4XTdfb1nW=Ojoy_tQSRhYt-q_kb6i5d4xcKyrLC1Nbg@mail.gmail.com1 parentbb812ab commitaaaf944
File tree
6 files changed
+103
-3
lines changed- src
- backend
- executor
- jit/llvm
- include
- executor
- nodes
6 files changed
+103
-3
lines changedLines changed: 7 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1560 | 1560 |
| |
1561 | 1561 |
| |
1562 | 1562 |
| |
1563 |
| - | |
| 1563 | + | |
| 1564 | + | |
| 1565 | + | |
| 1566 | + | |
1564 | 1567 |
| |
1565 | 1568 |
| |
1566 | 1569 |
| |
| |||
1596 | 1599 |
| |
1597 | 1600 |
| |
1598 | 1601 |
| |
| 1602 | + | |
| 1603 | + | |
1599 | 1604 |
| |
1600 | 1605 |
| |
1601 | 1606 |
| |
| |||
3303 | 3308 |
| |
3304 | 3309 |
| |
3305 | 3310 |
| |
| 3311 | + | |
3306 | 3312 |
| |
3307 | 3313 |
| |
3308 | 3314 |
| |
|
Lines changed: 78 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
63 | 63 |
| |
64 | 64 |
| |
65 | 65 |
| |
| 66 | + | |
66 | 67 |
| |
67 | 68 |
| |
68 | 69 |
| |
| |||
452 | 453 |
| |
453 | 454 |
| |
454 | 455 |
| |
| 456 | + | |
455 | 457 |
| |
456 | 458 |
| |
457 | 459 |
| |
| |||
1150 | 1152 |
| |
1151 | 1153 |
| |
1152 | 1154 |
| |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
1153 | 1158 |
| |
1154 | 1159 |
| |
1155 | 1160 |
| |
| |||
1205 | 1210 |
| |
1206 | 1211 |
| |
1207 | 1212 |
| |
| 1213 | + | |
| 1214 | + | |
| 1215 | + | |
| 1216 | + | |
| 1217 | + | |
| 1218 | + | |
1208 | 1219 |
| |
1209 | 1220 |
| |
1210 | 1221 |
| |
| |||
2510 | 2521 |
| |
2511 | 2522 |
| |
2512 | 2523 |
| |
| 2524 | + | |
| 2525 | + | |
| 2526 | + | |
| 2527 | + | |
| 2528 | + | |
| 2529 | + | |
| 2530 | + | |
| 2531 | + | |
| 2532 | + | |
| 2533 | + | |
| 2534 | + | |
| 2535 | + | |
| 2536 | + | |
| 2537 | + | |
| 2538 | + | |
| 2539 | + | |
| 2540 | + | |
| 2541 | + | |
| 2542 | + | |
| 2543 | + | |
| 2544 | + | |
| 2545 | + | |
| 2546 | + | |
| 2547 | + | |
| 2548 | + | |
| 2549 | + | |
| 2550 | + | |
| 2551 | + | |
| 2552 | + | |
| 2553 | + | |
| 2554 | + | |
| 2555 | + | |
| 2556 | + | |
| 2557 | + | |
| 2558 | + | |
| 2559 | + | |
| 2560 | + | |
| 2561 | + | |
| 2562 | + | |
| 2563 | + | |
| 2564 | + | |
| 2565 | + | |
| 2566 | + | |
| 2567 | + | |
| 2568 | + | |
| 2569 | + | |
| 2570 | + | |
| 2571 | + | |
| 2572 | + | |
| 2573 | + | |
| 2574 | + | |
| 2575 | + | |
| 2576 | + | |
| 2577 | + | |
| 2578 | + | |
| 2579 | + | |
| 2580 | + | |
| 2581 | + | |
| 2582 | + | |
| 2583 | + | |
| 2584 | + | |
| 2585 | + | |
| 2586 | + | |
| 2587 | + | |
| 2588 | + | |
2513 | 2589 |
| |
2514 | 2590 |
| |
2515 | 2591 |
| |
| |||
3730 | 3806 |
| |
3731 | 3807 |
| |
3732 | 3808 |
| |
3733 |
| - | |
| 3809 | + | |
3734 | 3810 |
| |
3735 | 3811 |
| |
3736 | 3812 |
| |
| |||
3745 | 3821 |
| |
3746 | 3822 |
| |
3747 | 3823 |
| |
3748 |
| - | |
| 3824 | + | |
3749 | 3825 |
| |
3750 | 3826 |
| |
3751 | 3827 |
| |
|
Lines changed: 6 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1431 | 1431 |
| |
1432 | 1432 |
| |
1433 | 1433 |
| |
| 1434 | + | |
| 1435 | + | |
| 1436 | + | |
| 1437 | + | |
| 1438 | + | |
| 1439 | + | |
1434 | 1440 |
| |
1435 | 1441 |
| |
1436 | 1442 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
162 | 162 |
| |
163 | 163 |
| |
164 | 164 |
| |
| 165 | + | |
165 | 166 |
| |
166 | 167 |
| |
167 | 168 |
| |
|
Lines changed: 4 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
16 | 16 |
| |
17 | 17 |
| |
18 | 18 |
| |
| 19 | + | |
19 | 20 |
| |
20 | 21 |
| |
21 | 22 |
| |
| |||
168 | 169 |
| |
169 | 170 |
| |
170 | 171 |
| |
| 172 | + | |
171 | 173 |
| |
172 | 174 |
| |
173 | 175 |
| |
| |||
547 | 549 |
| |
548 | 550 |
| |
549 | 551 |
| |
| 552 | + | |
550 | 553 |
| |
551 | 554 |
| |
552 | 555 |
| |
| |||
776 | 779 |
| |
777 | 780 |
| |
778 | 781 |
| |
| 782 | + | |
779 | 783 |
| |
780 | 784 |
| |
781 | 785 |
| |
|
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)