Try to fix prepare related problems

This commit is contained in:
wangbin579 2020-03-13 10:41:31 +08:00
parent 75f1464e37
commit 99d42554b9
2 changed files with 7 additions and 1 deletions

View File

@ -2022,6 +2022,8 @@ NETWORK_MYSQLD_PLUGIN_PROTO(proxy_read_query_result)
network_mysqld_com_stmt_prep_result_t *r = con->parse.data;
if (r->status == MYSQLD_PACKET_OK) {
con->prepare_stmt_count++;
} else {
g_warning("%s: prepare stmt not ok for con:%p", G_STRLOC, con);
}
break;
}

View File

@ -2811,7 +2811,11 @@ process_rw_write(network_mysqld_con *con, network_mysqld_con_state_t ostate, int
network_mysqld_queue_reset(con->client);
network_mysqld_queue_reset(con->server);
con->prepare_stmt_count--;
if (con->prepare_stmt_count > 0) {
con->prepare_stmt_count--;
} else {
g_warning("%s: prepare_stmt_count is zero for con:%p", G_STRLOC, con);
}
g_debug("%s: conn:%p, sub, now prepare_stmt_count:%d", G_STRLOC, con, con->prepare_stmt_count);
if (con->prepare_stmt_count == 0) {