From 46c5564313ac60057cb74788fb752f80c40493fc Mon Sep 17 00:00:00 2001 From: Massimiliano Pinto Date: Thu, 26 Sep 2013 18:01:48 +0200 Subject: [PATCH] Removed states MYSQL_WAITING_RESULT and MYSQL_ROUTING --- server/modules/protocol/mysql_backend.c | 3 +-- server/modules/protocol/mysql_client.c | 8 ++------ 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/server/modules/protocol/mysql_backend.c b/server/modules/protocol/mysql_backend.c index e919a73df..fe78458bc 100644 --- a/server/modules/protocol/mysql_backend.c +++ b/server/modules/protocol/mysql_backend.c @@ -345,8 +345,7 @@ static int gw_read_backend_event(DCB *dcb) { if (client_protocol != NULL) { CHK_PROTOCOL(client_protocol); - if (client_protocol->state == MYSQL_WAITING_RESULT || - client_protocol->state == MYSQL_IDLE) + if (client_protocol->state == MYSQL_IDLE) { router->clientReply(router_instance, rsession, diff --git a/server/modules/protocol/mysql_client.c b/server/modules/protocol/mysql_client.c index 75d3c2dfc..02974aee2 100644 --- a/server/modules/protocol/mysql_client.c +++ b/server/modules/protocol/mysql_client.c @@ -609,7 +609,6 @@ int gw_read_client_event(DCB* dcb) { break; case MYSQL_IDLE: - case MYSQL_WAITING_RESULT: /* * Read all the data that is available into a chain of buffers */ @@ -695,11 +694,9 @@ int gw_read_client_event(DCB* dcb) { else { /** Route other commands to backend */ - protocol->state = MYSQL_ROUTING; rc = router->routeQuery(router_instance, rsession, queue); /** succeed */ if (rc == 1) { - protocol->state = MYSQL_WAITING_RESULT; rc = 0; /**< here '0' means success */ } else { mysql_send_custom_error(dcb, @@ -712,7 +709,7 @@ int gw_read_client_event(DCB* dcb) { } } goto return_rc; - } /* MYSQL_IDLE, MYSQL_WAITING_RESULT */ + } /* MYSQL_IDLE */ break; default: @@ -772,8 +769,7 @@ int gw_write_client_event(DCB *dcb) protocol = (MySQLProtocol *)dcb->protocol; CHK_PROTOCOL(protocol); - if (protocol->state == MYSQL_IDLE || - protocol->state == MYSQL_WAITING_RESULT) + if (protocol->state == MYSQL_IDLE) { dcb_drain_writeq(dcb); goto return_1;