aboutsummaryrefslogtreecommitdiff
path: root/src/backend/jit/llvm/llvmjit_error.cpp
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2022-06-06 11:20:21 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2022-06-06 11:20:21 -0400
commit6d157e7cb8d3f4aa28a9fef95c498ce8ac3c31a9 (patch)
tree8a49a3c098c96a198677e5d1fa1755271721c56f /src/backend/jit/llvm/llvmjit_error.cpp
parent157f8739ad18278ca946758b2f274a8109a0aa08 (diff)
downloadpostgresql-6d157e7cb8d3f4aa28a9fef95c498ce8ac3c31a9.tar.gz
postgresql-6d157e7cb8d3f4aa28a9fef95c498ce8ac3c31a9.zip
Don't fail on libpq-generated error reports in ecpg_raise_backend().
An error PGresult generated by libpq itself, such as a report of connection loss, won't have broken-down error fields. ecpg_raise_backend() blithely assumed that PG_DIAG_MESSAGE_PRIMARY would always be present, and would end up passing a NULL string pointer to snprintf when it isn't. That would typically crash before 3779ac62d, and it would fail to provide a useful error report in 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 supported branches. Discussion: https://postgr.es/m/17421-790ff887e3188874@postgresql.org
Diffstat (limited to 'src/backend/jit/llvm/llvmjit_error.cpp')
0 files changed, 0 insertions, 0 deletions