-
Notifications
You must be signed in to change notification settings - Fork 491
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
[Bug] fix log buffer inital issue #453
[Bug] fix log buffer inital issue #453
Conversation
Hi @ocean-dot-li ~ Thanks for your contribution in this PR. ❤️ Please make sure that your PR conforms the standard, and has passed all the checks. We will review your PR as soon as possible. |
Hey @ocean-dot-li : Congratulations~ 🎉 Your commit has passed all the checks. Please wait for further manual review. |
src/backend/tcop/postgres.c
Outdated
@@ -2354,13 +2354,15 @@ exec_execute_message(const char *portal_name, long max_rows) | |||
pq_putemptymessage('s'); | |||
} | |||
|
|||
/* POLAR: inital buf used by logging info. */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be better to initialize the buf.data
here, and keep the initStringInfo
at where it originally be? Because not all path needs to use buf.data
, allocate memory here for all path seems wasteful.
buf.data = NULL;
In exec_execute_message(), we should initalize the log buffer at outermost layer. If not, crash may happen when trying to accessing its data member. This patch fixes the issue.
04ca783
to
3e4344b
Compare
Hey @ocean-dot-li : Congratulations~ 🎉 Your commit has passed all the checks. Please wait for further manual review. |
/rebase-and-merge |
@mrdrivingduck PR has been merged. 🍗 Thanks again for the contributors involved in this thread: ❤️ |
In exec_execute_message(), we should initalize the log buffer at outermost layer. If not, crash may happen when trying to pfree its data member.
This patch fixes the issue.