Displaying 1 result from an estimated 1 matches for "eat_results".
2010 Apr 14
4
PostgreSQL driver supporting [round-robin] load balancing and redundancy [LONG]
...struct multi_pgsql_pgc *pgc)
+{
+ struct multi_pgsql_query *qry;
+
+ qry = pgc->qry;
+ pgc->qry = NULL;
+
+ destroy_query(qry);
+}
+
+static inline int got_result(PGconn *pgc)
+{
+ PGresult *pgr;
+
+ pgr = PQgetResult(pgc);
+ if (!pgr) return 0;
+
+ PQclear(pgr);
+ return 1;
+}
+
+static void eat_results(struct multi_pgsql_pgc *pgc)
+{
+ PGconn *the_pgc;
+ PGresult *pgr;
+ int rc;
+
+ dprintf(("%s: %p", __func__, pgc));
+
+ the_pgc = pgc->pgc;
+ do {
+ rc = PQconsumeInput(the_pgc);
+ if (rc == 0) {
+ pgc_query_processing_failure(pgc, __func__,
+ "PQconsumeInput"...