From 18c34c2369ee8620467a0a1c583378eb7f07310c Mon Sep 17 00:00:00 2001 From: Daniele Varrazzo Date: Mon, 21 Jan 2019 02:51:47 +0000 Subject: [PATCH] Mark state setting in _psyco_curs_execute() --- psycopg/cursor_type.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/psycopg/cursor_type.c b/psycopg/cursor_type.c index f20fb326..5bc63fe2 100644 --- a/psycopg/cursor_type.c +++ b/psycopg/cursor_type.c @@ -425,12 +425,12 @@ _psyco_curs_execute(cursorObject *self, goto exit; } - if (!(self->query = Bytes_FromFormat( + if (!(self->query = TO_STATE(Bytes_FromFormat( "DECLARE %s %sCURSOR %s HOLD FOR %s", self->qname, scroll, self->withhold ? "WITH" : "WITHOUT", - Bytes_AS_STRING(fquery)))) { + Bytes_AS_STRING(fquery))))) { goto exit; } if (!self->query) { goto exit; } @@ -438,7 +438,7 @@ _psyco_curs_execute(cursorObject *self, else { /* Transfer ownership */ Py_INCREF(fquery); - self->query = fquery; + self->query = TO_STATE(fquery); } /* At this point, the SQL statement must be str, not unicode */