mirror of
https://github.com/psycopg/psycopg2.git
synced 2025-07-01 02:03:05 +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>
|
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
|
* psycopg/cursor_type.c: applied patch from intgr (#116) to
|
||||||
fix bad keyword naming and segfault in .executemany().
|
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
|
#ifdef HAVE_PQPROTOCOL3
|
||||||
char *pgstate =
|
char *pgstate =
|
||||||
PQresultErrorField(curs->pgres, PG_DIAG_SQLSTATE);
|
PQresultErrorField(curs->pgres, PG_DIAG_SQLSTATE);
|
||||||
if (!strncmp(pgstate, "23", 2))
|
if (pgstate != NULL && !strncmp(pgstate, "23", 2))
|
||||||
exc = IntegrityError;
|
exc = IntegrityError;
|
||||||
else
|
else
|
||||||
exc = ProgrammingError;
|
exc = ProgrammingError;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user