Skip to content

Commit

Permalink
Fix prepare stmt id related problems
Browse files Browse the repository at this point in the history
  • Loading branch information
wangbin579 committed Jul 9, 2019
1 parent 23d95a5 commit 90df8e8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion plugins/proxy/proxy-plugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -805,7 +805,14 @@ change_stmt_id(network_mysqld_con *con, uint32_t stmt_id)
return -1;
}
con->server = g_ptr_array_index(con->servers, index);
st->backend_ndx = st->backend_ndx_array[index] - 1;
int i;
int value = index + 1;
for (i = 0; i < MAX_SERVER_NUM_FOR_PREPARE; i++) {
if (st->backend_ndx_array[i] == value) {
st->backend_ndx = i;
break;
}
}
g_debug("change conn:%p, server:%p stmt_id:%d, fd:%d, new back ndx:%d",
con, con->server, (int)stmt_id, con->server->fd, st->backend_ndx);

Expand Down

0 comments on commit 90df8e8

Please sign in to comment.