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

Fix bug during copy when in the config the value of pool_reserve_prepared_statement is equal to yes #562

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions sources/frontend.c
Original file line number Diff line number Diff line change
Expand Up @@ -996,7 +996,7 @@ static od_frontend_status_t od_frontend_remote_client(od_relay_t *relay,
"%s", kiwi_fe_type_to_string(type));

od_frontend_status_t retstatus = OD_OK;
machine_msg_t *msg;
machine_msg_t *msg = NULL;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

msg = NULL; in separate line, all declaraion at the beginning of the scope.
no declaration and assign on same line
try to compile with -pedantic

bool forwarded = 0;
switch (type) {
case KIWI_FE_COPY_DONE:
Expand Down Expand Up @@ -1513,7 +1513,7 @@ static od_frontend_status_t od_frontend_remote_client(od_relay_t *relay,
}

/* If the retstatus is not SKIP */
if (route->rule->pool->reserve_prepared_statement && forwarded != 1) {
if (route->rule->pool->reserve_prepared_statement && forwarded != 1 && msg != NULL) {
msg = kiwi_fe_copy_msg(msg, data, size);
od_write(&server->io, msg);
retstatus = OD_SKIP;
Expand Down
Loading