diff --git a/connection.c b/connection.c
index 8d2d7e7..86d7da7 100644
--- a/connection.c
+++ b/connection.c
@@ -1886,7 +1886,7 @@ inolog("Discarded the first SAVEPOINT\n");
 					 * called from QR_next_tuple and must return
 					 * immediately.
 					 */
-					if (!CC_from_PGresult(res, stmt, self, cursor, &pgres))
+					if (!CC_from_PGresult(res, stmt, NULL, cursor, &pgres))
 					{
 						retres = NULL;
 						break;
diff --git a/qresult.c b/qresult.c
index 7f3445b..5848959 100644
--- a/qresult.c
+++ b/qresult.c
@@ -592,6 +592,8 @@ QR_from_PGresult(QResultClass *self, StatementClass *stmt, ConnectionClass *conn
 	Int2		dummy1, dummy2;
 	int			cidx;
 
+if (NULL != conn)
+{
 	/* First, get column information */
 	QR_set_conn(self, conn);
 
@@ -660,6 +662,7 @@ inolog("!![%d].PGType %u->%u\n", i, PIC_get_pgtype(ipdopts->parameters[i]), CI_g
 			}
 		}
 	}
+}
 
 
 	/* Then, get the data itself */
@@ -670,10 +673,13 @@ inolog("!!%p->cursTup=%d total_read=%d\n", self, self->cursTuple, self->num_tota
 	if (!QR_once_reached_eof(self) && self->cursTuple >= (Int4) self->num_total_read)
 		self->num_total_read = self->cursTuple + 1;
 
+if (NULL != conn)
+{
 	/* Force a read to occur in next_tuple */
 	QR_set_next_in_cache(self, 0);
 	QR_set_rowstart_in_cache(self, 0);
 	self->key_base = 0;
+}
 
 	/*
 	 * Also fill in command tag. (Typically, it's SELECT, but can also be
