pgreplay icon indicating copy to clipboard operation
pgreplay copied to clipboard

Will PQgetResult cause stat_stmt statistics errors?

Open TsinghuaLucky912 opened this issue 1 year ago • 1 comments

							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?

TsinghuaLucky912 avatar Sep 01 '23 02:09 TsinghuaLucky912

I think that the code is OK as it is. PQgetResult reads a complete query result. Otherwise, what would be stored in result.

laurenz avatar Sep 01 '23 13:09 laurenz