*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/interfaces/libpq/fe-exec.c,v 1.155 2003/11/30 20:55:09 joe Exp $
+ * $PostgreSQL: pgsql/src/interfaces/libpq/fe-exec.c,v 1.156 2003/12/28 17:29:41 tgl Exp $
*
*-------------------------------------------------------------------------
*/
return false;
}
}
+ /* check for loss of connection, too */
+ if (conn->status == CONNECTION_BAD)
+ return false;
}
/* OK to send a command */
*
* We have to stop if we see copy in/out, however. We will resume parsing
* after application performs the data transfer.
+ *
+ * Also stop if the connection is lost (else we'll loop infinitely).
*/
lastResult = NULL;
while ((result = PQgetResult(conn)) != NULL)
}
lastResult = result;
if (result->resultStatus == PGRES_COPY_IN ||
- result->resultStatus == PGRES_COPY_OUT)
+ result->resultStatus == PGRES_COPY_OUT ||
+ conn->status == CONNECTION_BAD)
break;
}