forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit6d157e7
committed
Don't fail on libpq-generated error reports in ecpg_raise_backend().
An error PGresult generated by libpq itself, such as a report ofconnection loss, won't have broken-down error fields.ecpg_raise_backend() blithely assumed that PG_DIAG_MESSAGE_PRIMARYwould always be present, and would end up passing a NULL stringpointer to snprintf when it isn't. That would typically crashbefore3779ac6, and it would fail to provide a useful error reportin any case. Best practice is to substitute PQerrorMessage(conn)in such cases, so do that.Per bug #17421 from Masayuki Hirose. Back-patch to all supportedbranches.Discussion:https://postgr.es/m/17421-790ff887e3188874@postgresql.org1 parent157f873 commit6d157e7
1 file changed
+9
-10
lines changedLines changed: 9 additions & 10 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
229 | 229 |
| |
230 | 230 |
| |
231 | 231 |
| |
232 |
| - | |
233 |
| - | |
234 |
| - | |
235 |
| - | |
236 |
| - | |
237 |
| - | |
238 |
| - | |
239 |
| - | |
240 |
| - | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
241 | 239 |
| |
| 240 | + | |
| 241 | + | |
242 | 242 |
| |
243 |
| - | |
244 | 243 |
| |
245 | 244 |
| |
246 | 245 |
| |
|
0 commit comments
Comments
(0)