Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/PgSQL_Error_Helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@ void PgSQL_Error_Helper::fill_extended_error_info(PgSQL_ErrorInfo& err_info, con

if (ext_fields & PGSQL_ERROR_FIELD_TEXT) {
val = PQresultErrorField(result, PG_DIAG_SEVERITY_NONLOCALIZED);
if (val == nullptr) val = PQresultErrorField(result, PG_DIAG_SEVERITY);
err_info.ext_info->text = identify_error_severity(val ? val : "");
}

Expand Down Expand Up @@ -447,7 +448,8 @@ void PgSQL_Error_Helper::fill_error_info(PgSQL_ErrorInfo& err_info, const PGresu
}
const char* sqlstate = PQresultErrorField(result, PG_DIAG_SQLSTATE);
const char* message = PQresultErrorField(result, PG_DIAG_MESSAGE_PRIMARY);
const char* severity = PQresultErrorField(result, PG_DIAG_SEVERITY);
const char* severity = PQresultErrorField(result, PG_DIAG_SEVERITY_NONLOCALIZED);
if (severity == nullptr) severity = PQresultErrorField(result, PG_DIAG_SEVERITY);
Comment thread
rayshoo marked this conversation as resolved.
fill_error_info(err_info, sqlstate ? sqlstate : "00000", message ? message : "", severity ? severity : "");
fill_extended_error_info(err_info, result, ext_fields);
}