pgreplay
pgreplay copied to clipboard
Will PQgetResult cause stat_stmt statistics errors?
if (PQisBusy(conn->db_conn)) {
/* more to read */
all_idle = 0;
} else {
/* read and discard all results */
while (NULL != (result = PQgetResult(conn->db_conn))) {
/* count statements and errors for statistics */
++stat_stmt; // <---- here
result_status = PQresultStatus(result);
Hello, I have a question: If PQgetResult cannot be read at one time, or PQgetResult needs to be read multiple times, will there be a problem with stat_stmt here?
I think that the code is OK as it is. PQgetResult
reads a complete query result. Otherwise, what would be stored in result
.