From c870f946e629991e78103ae71c0ffcbff2daddf1 Mon Sep 17 00:00:00 2001 From: wangbin579 Date: Tue, 9 Jul 2019 13:04:10 +0300 Subject: [PATCH] Fix more prepare stmt id related problems --- plugins/proxy/proxy-plugin.c | 4 +++- src/network-mysqld.c | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/proxy/proxy-plugin.c b/plugins/proxy/proxy-plugin.c index 3cb651f..b5231e5 100644 --- a/plugins/proxy/proxy-plugin.c +++ b/plugins/proxy/proxy-plugin.c @@ -1391,6 +1391,7 @@ network_read_query(network_mysqld_con *con, proxy_plugin_con_t *st) con->slave_conn_shortaged = 0; con->use_slave_forced = 0; con->candidate_fast_streamed = 0; + con->candidate_tcp_streamed = 1; network_injection_queue_reset(st->injected.queries); @@ -1425,8 +1426,9 @@ network_read_query(network_mysqld_con *con, proxy_plugin_con_t *st) case COM_BINLOG_DUMP: network_mysqld_con_send_error(con->client, C("(proxy) unable to process binlog dump")); return PROXY_SEND_RESULT; - case COM_QUERY: case COM_STMT_PREPARE: + con->candidate_tcp_streamed = 0; + case COM_QUERY: if (!process_query_or_stmt_prepare(con, st, &packet, &query_attr, command, &disp_flag)) { return disp_flag; } diff --git a/src/network-mysqld.c b/src/network-mysqld.c index 5eb0676..4513a7c 100644 --- a/src/network-mysqld.c +++ b/src/network-mysqld.c @@ -4231,7 +4231,7 @@ normal_read_query_result(network_mysqld_con *con, network_mysqld_con_state_t ost } } - if (!g_queue_is_empty(con->client->send_queue->chunks)) { + if (con->candidate_tcp_streamed && !g_queue_is_empty(con->client->send_queue->chunks)) { g_debug("%s: send_part_content_to_client:%p", G_STRLOC, con); send_part_content_to_client(con); }