]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
fix(c): drop duplicate PQconsumeInput call
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Wed, 2 Nov 2022 10:21:21 +0000 (11:21 +0100)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Fri, 4 Nov 2022 16:29:04 +0000 (17:29 +0100)
Also add a couple of C types in the function for better C code.

psycopg_c/psycopg_c/_psycopg/generators.pyx

index 5a92152826b413a12212b2a00b583cd7037029d0..e45314a13407032ee7a66b2d9413bbb7621943f3 100644 (file)
@@ -212,6 +212,8 @@ def pipeline_communicate(
     cdef object notify_handler = pgconn.notify_handler
     cdef libpq.PGnotify *notify
     cdef int cires
+    cdef int status
+    cdef int ready
     cdef libpq.PGresult *pgres
     cdef list res = []
     cdef list results = []
@@ -221,7 +223,6 @@ def pipeline_communicate(
         ready = yield WAIT_RW
 
         if ready & READY_R:
-            pgconn.consume_input()
             with nogil:
                 cires = libpq.PQconsumeInput(pgconn_ptr)
             if 1 != cires: