mirror of
https://github.com/psycopg/psycopg2.git
synced 2024-11-26 10:53:44 +03:00
Null query segfault fix (closes: #117).
This commit is contained in:
parent
23112a763d
commit
6f0e578686
|
@ -1,5 +1,8 @@
|
|||
2006-09-01 Federico Di Gregorio <fog@initd.org>
|
||||
|
||||
* psycopg/pqpath.c: applied patch from intgr (#117) to fix
|
||||
segfault on null queries.
|
||||
|
||||
* psycopg/cursor_type.c: applied patch from intgr (#116) to
|
||||
fix bad keyword naming and segfault in .executemany().
|
||||
|
||||
|
|
|
@ -85,7 +85,7 @@ pq_raise(connectionObject *conn, cursorObject *curs, PyObject *exc, char *msg)
|
|||
#ifdef HAVE_PQPROTOCOL3
|
||||
char *pgstate =
|
||||
PQresultErrorField(curs->pgres, PG_DIAG_SQLSTATE);
|
||||
if (!strncmp(pgstate, "23", 2))
|
||||
if (pgstate != NULL && !strncmp(pgstate, "23", 2))
|
||||
exc = IntegrityError;
|
||||
else
|
||||
exc = ProgrammingError;
|
||||
|
|
Loading…
Reference in New Issue
Block a user