Commit b81a71a
committed
Assign error codes where missing for user-facing failures
All the errors triggered in the code paths patched here would cause the
backend to issue an internal_error errcode, which is a state that should
be used only for "can't happen" situations. However, these code paths
are reachable by the regression tests, and could be seen by users in
valid cases. Some regression tests expect internal errcodes as they
manipulate the backend state to cause corruption (like checksums), or
use elog() because it is more convenient (like injection points), these
have no need to change.
This reduces the number of internal failures triggered in a check-world
by more than half, while providing correct errcodes for these valid
cases.
Reviewed-by: Robert Haas
Discussion: https://postgr.es/m/Zic_GNgos5sMxKoa@paquier.xyz1 parent 6897f0e commit b81a71a
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 changed| 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 | | |
| |||
| 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 | | |
| |||
| 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 | | |
| |||
| 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 | | |
| |||
| 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 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1519 | 1519 | | |
1520 | 1520 | | |
1521 | 1521 | | |
| 1522 | + | |
1522 | 1523 | | |
1523 | 1524 | | |
1524 | 1525 | | |
| |||
| 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 | | |
| |||
| 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 | | |
| |||
| 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 | | |
| |||
| 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 | | |
| |||
0 commit comments