Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Will PQgetResult cause stat_stmt statistics errors? #33

Open
TsinghuaLucky912 opened this issue Sep 1, 2023 · 1 comment
Open

Will PQgetResult cause stat_stmt statistics errors? #33

TsinghuaLucky912 opened this issue Sep 1, 2023 · 1 comment
Labels

Comments

@TsinghuaLucky912
Copy link

							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?

@laurenz
Copy link
Owner

laurenz commented Sep 1, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants