From 4dd6f1b9c08a0d2e9f445348794f5e10fe41717c Mon Sep 17 00:00:00 2001 From: VilhoRaatikka Date: Mon, 15 Dec 2014 11:35:07 +0200 Subject: [PATCH] Added comment to assertion regarding to bref->bref_pending_cmd which is a one-slot buffer for database query. If sessoin command cursor is active when query is routed, instead of routing the query to backend it is stored to bref_pending_cmd to wait until previous (session) command is completed. The assertion traps if there is a command already in the bref_pending_cmd. Situation is wrong because client shouldn't send new query before the previous (the pending one) is executed in backend and the reply is sent to the client. --- server/modules/routing/readwritesplit/readwritesplit.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/server/modules/routing/readwritesplit/readwritesplit.c b/server/modules/routing/readwritesplit/readwritesplit.c index 3d53867d8..838c406d2 100644 --- a/server/modules/routing/readwritesplit/readwritesplit.c +++ b/server/modules/routing/readwritesplit/readwritesplit.c @@ -2335,8 +2335,14 @@ static bool route_single_stmt( bref->bref_backend->backend_server->port))); /** * Store current stmt if execution of previous session command - * haven't completed yet. Note that according to MySQL protocol + * haven't completed yet. + * + * !!! Note that according to MySQL protocol * there can only be one such non-sescmd stmt at the time. + * + * If the assertion below traps, pending queries are treated + * somehow wrong, or client is sending more queries before + * previous is received. */ if (sescmd_cursor_is_active(scur)) { @@ -2516,7 +2522,6 @@ char *weightby; } } - } /**