mirror of
https://github.com/psycopg/psycopg2.git
synced 2025-08-04 04:10:09 +03:00
Correctly handle an empty error message from PQescapeIdentifier
This commit is contained in:
parent
2a380eed0c
commit
34d3ac428c
|
@ -1021,7 +1021,8 @@ _escape_identifier(PGconn *pgconn, const char *str, size_t length)
|
|||
rv = PQescapeIdentifier(pgconn, str, length);
|
||||
if (!rv) {
|
||||
char *msg;
|
||||
if (!(msg = PQerrorMessage(pgconn))) {
|
||||
msg = PQerrorMessage(pgconn);
|
||||
if (!msg || !msg[0]) {
|
||||
msg = "no message provided";
|
||||
}
|
||||
PyErr_Format(InterfaceError, "failed to escape identifier: %s", msg);
|
||||
|
|
Loading…
Reference in New Issue
Block a user