diff options
author | Daniele Varrazzo <daniele.varrazzo@gmail.com> | 2010-11-22 00:49:07 +0000 |
---|---|---|
committer | Daniele Varrazzo <daniele.varrazzo@gmail.com> | 2010-11-22 00:49:07 +0000 |
commit | fdf1ba1aacfae51b8fe604cc59093c351d70aa26 (patch) | |
tree | c0a2fa006817057579dd0c1b2b04b121370a19e6 | |
parent | 7fe7b669aa9b554baac64818353f1bf0801c4f05 (diff) | |
download | psycopg2-fdf1ba1aacfae51b8fe604cc59093c351d70aa26.tar.gz |
Dropped notices hack to get COPY errors from V2 protocol.
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | psycopg/connection_int.c | 21 |
2 files changed, 11 insertions, 15 deletions
@@ -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> * psycopg/connection.h: Added enum with possilbe isolation level states. diff --git a/psycopg/connection_int.c b/psycopg/connection_int.c index 34bcef6..f98e4fd 100644 --- a/psycopg/connection_int.c +++ b/psycopg/connection_int.c @@ -46,25 +46,16 @@ conn_notice_callback(void *args, const char *message) Dprintf("conn_notice_callback: %s", message); - /* unfortunately the old protocol return COPY FROM errors only as notices, - 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 + /* 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 called from libpq and when we're inside libpq the connection is usually locked. */ - - if (self->protocol < 3 && strncmp(message, "ERROR", 5) == 0) - pq_set_critical(self, message); - else { - notice = (struct connectionObject_notice *) - malloc(sizeof(struct connectionObject_notice)); - notice->message = strdup(message); - notice->next = self->notice_pending; - self->notice_pending = notice; - } + notice = (struct connectionObject_notice *) + malloc(sizeof(struct connectionObject_notice)); + notice->message = strdup(message); + notice->next = self->notice_pending; + self->notice_pending = notice; } void |