forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitb81a71a
committed
Assign error codes where missing for user-facing failures
All the errors triggered in the code paths patched here would cause thebackend to issue an internal_error errcode, which is a state that shouldbe used only for "can't happen" situations. However, these code pathsare reachable by the regression tests, and could be seen by users invalid cases. Some regression tests expect internal errcodes as theymanipulate the backend state to cause corruption (like checksums), oruse elog() because it is more convenient (like injection points), thesehave no need to change.This reduces the number of internal failures triggered in a check-worldby more than half, while providing correct errcodes for these validcases.Reviewed-by: Robert HaasDiscussion:https://postgr.es/m/Zic_GNgos5sMxKoa@paquier.xyz1 parent6897f0e commitb81a71a
File tree
12 files changed
+59
-26
lines changed- contrib/pg_walinspect
- src/backend
- access/transam
- backup
- commands
- libpq
- optimizer/util
- replication
- utils/adt
12 files changed
+59
-26
lines changedLines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
101 | 101 |
| |
102 | 102 |
| |
103 | 103 |
| |
104 |
| - | |
| 104 | + | |
| 105 | + | |
105 | 106 |
| |
106 | 107 |
| |
107 | 108 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1898 | 1898 |
| |
1899 | 1899 |
| |
1900 | 1900 |
| |
1901 |
| - | |
| 1901 | + | |
| 1902 | + | |
1902 | 1903 |
| |
1903 | 1904 |
| |
1904 | 1905 |
| |
|
Lines changed: 4 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2045 | 2045 |
| |
2046 | 2046 |
| |
2047 | 2047 |
| |
2048 |
| - | |
| 2048 | + | |
| 2049 | + | |
2049 | 2050 |
| |
2050 | 2051 |
| |
2051 | 2052 |
| |
2052 | 2053 |
| |
2053 |
| - | |
| 2054 | + | |
| 2055 | + | |
2054 | 2056 |
| |
2055 | 2057 |
| |
2056 | 2058 |
| |
|
Lines changed: 3 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
803 | 803 |
| |
804 | 804 |
| |
805 | 805 |
| |
806 |
| - | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
807 | 809 |
| |
808 | 810 |
| |
809 | 811 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
11363 | 11363 |
| |
11364 | 11364 |
| |
11365 | 11365 |
| |
11366 |
| - | |
| 11366 | + | |
| 11367 | + | |
11367 | 11368 |
| |
11368 | 11369 |
| |
11369 | 11370 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1519 | 1519 |
| |
1520 | 1520 |
| |
1521 | 1521 |
| |
| 1522 | + | |
1522 | 1523 |
| |
1523 | 1524 |
| |
1524 | 1525 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1730 | 1730 |
| |
1731 | 1731 |
| |
1732 | 1732 |
| |
| 1733 | + | |
1733 | 1734 |
| |
1734 | 1735 |
| |
1735 | 1736 |
| |
| |||
2121 | 2122 |
| |
2122 | 2123 |
| |
2123 | 2124 |
| |
| 2125 | + | |
2124 | 2126 |
| |
2125 | 2127 |
| |
2126 | 2128 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
250 | 250 |
| |
251 | 251 |
| |
252 | 252 |
| |
253 |
| - | |
| 253 | + | |
| 254 | + | |
254 | 255 |
| |
255 | 256 |
| |
256 | 257 |
| |
|
Lines changed: 8 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
160 | 160 |
| |
161 | 161 |
| |
162 | 162 |
| |
163 |
| - | |
164 |
| - | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
165 | 167 |
| |
166 |
| - | |
167 |
| - | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
168 | 172 |
| |
169 | 173 |
| |
170 | 174 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
523 | 523 |
| |
524 | 524 |
| |
525 | 525 |
| |
526 |
| - | |
| 526 | + | |
| 527 | + | |
527 | 528 |
| |
528 | 529 |
| |
529 | 530 |
| |
|
Lines changed: 14 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1481 | 1481 |
| |
1482 | 1482 |
| |
1483 | 1483 |
| |
1484 |
| - | |
| 1484 | + | |
| 1485 | + | |
1485 | 1486 |
| |
1486 | 1487 |
| |
1487 | 1488 |
| |
| |||
2609 | 2610 |
| |
2610 | 2611 |
| |
2611 | 2612 |
| |
2612 |
| - | |
| 2613 | + | |
| 2614 | + | |
2613 | 2615 |
| |
2614 | 2616 |
| |
2615 | 2617 |
| |
| |||
2630 | 2632 |
| |
2631 | 2633 |
| |
2632 | 2634 |
| |
2633 |
| - | |
| 2635 | + | |
| 2636 | + | |
2634 | 2637 |
| |
2635 | 2638 |
| |
2636 | 2639 |
| |
| |||
2646 | 2649 |
| |
2647 | 2650 |
| |
2648 | 2651 |
| |
2649 |
| - | |
| 2652 | + | |
| 2653 | + | |
2650 | 2654 |
| |
2651 | 2655 |
| |
2652 | 2656 |
| |
| |||
2957 | 2961 |
| |
2958 | 2962 |
| |
2959 | 2963 |
| |
2960 |
| - | |
| 2964 | + | |
| 2965 | + | |
2961 | 2966 |
| |
2962 | 2967 |
| |
2963 | 2968 |
| |
| |||
2998 | 3003 |
| |
2999 | 3004 |
| |
3000 | 3005 |
| |
3001 |
| - | |
| 3006 | + | |
| 3007 | + | |
3002 | 3008 |
| |
3003 | 3009 |
| |
3004 | 3010 |
| |
| |||
3027 | 3033 |
| |
3028 | 3034 |
| |
3029 | 3035 |
| |
3030 |
| - | |
| 3036 | + | |
| 3037 | + | |
3031 | 3038 |
| |
3032 | 3039 |
| |
3033 | 3040 |
| |
|
Lines changed: 17 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
312 | 312 |
| |
313 | 313 |
| |
314 | 314 |
| |
315 |
| - | |
316 |
| - | |
317 |
| - | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
318 | 320 |
| |
319 | 321 |
| |
320 | 322 |
| |
| |||
349 | 351 |
| |
350 | 352 |
| |
351 | 353 |
| |
352 |
| - | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
353 | 357 |
| |
354 | 358 |
| |
355 | 359 |
| |
356 | 360 |
| |
357 | 361 |
| |
358 |
| - | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
359 | 365 |
| |
360 | 366 |
| |
361 |
| - | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
362 | 370 |
| |
363 | 371 |
| |
364 | 372 |
| |
| |||
368 | 376 |
| |
369 | 377 |
| |
370 | 378 |
| |
371 |
| - | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
372 | 382 |
| |
373 | 383 |
| |
374 | 384 |
| |
|
0 commit comments
Comments
(0)