mirror of
https://github.com/psycopg/psycopg2.git
synced 2024-11-22 17:06:33 +03:00
Dropped notices hack to get COPY errors from V2 protocol.
This commit is contained in:
parent
7fe7b669aa
commit
fdf1ba1aac
|
@ -1,3 +1,8 @@
|
||||||
|
2010-11-22 Daniele Varrazzo <daniele.varrazzo@gmail.com>
|
||||||
|
|
||||||
|
* psycopg/connection_int.c: dropped notices hack to get COPY errors from
|
||||||
|
V2 protocol.
|
||||||
|
|
||||||
2010-11-18 Daniele Varrazzo <daniele.varrazzo@gmail.com>
|
2010-11-18 Daniele Varrazzo <daniele.varrazzo@gmail.com>
|
||||||
|
|
||||||
* psycopg/connection.h: Added enum with possilbe isolation level states.
|
* psycopg/connection.h: Added enum with possilbe isolation level states.
|
||||||
|
|
|
@ -46,25 +46,16 @@ conn_notice_callback(void *args, const char *message)
|
||||||
|
|
||||||
Dprintf("conn_notice_callback: %s", message);
|
Dprintf("conn_notice_callback: %s", message);
|
||||||
|
|
||||||
/* unfortunately the old protocol return COPY FROM errors only as notices,
|
/* NOTE: if we get here and the connection is unlocked then there is a
|
||||||
so we need to filter them looking for such errors (but we do it
|
|
||||||
only if the protocol if <3, else we don't need that)
|
|
||||||
|
|
||||||
NOTE: if we get here and the connection is unlocked then there is a
|
|
||||||
problem but this should happen because the notice callback is only
|
problem but this should happen because the notice callback is only
|
||||||
called from libpq and when we're inside libpq the connection is usually
|
called from libpq and when we're inside libpq the connection is usually
|
||||||
locked.
|
locked.
|
||||||
*/
|
*/
|
||||||
|
notice = (struct connectionObject_notice *)
|
||||||
if (self->protocol < 3 && strncmp(message, "ERROR", 5) == 0)
|
malloc(sizeof(struct connectionObject_notice));
|
||||||
pq_set_critical(self, message);
|
notice->message = strdup(message);
|
||||||
else {
|
notice->next = self->notice_pending;
|
||||||
notice = (struct connectionObject_notice *)
|
self->notice_pending = notice;
|
||||||
malloc(sizeof(struct connectionObject_notice));
|
|
||||||
notice->message = strdup(message);
|
|
||||||
notice->next = self->notice_pending;
|
|
||||||
self->notice_pending = notice;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
Loading…
Reference in New Issue
Block a user