From 272cd73cad88668bbed85e443f7205ff0752bd1f Mon Sep 17 00:00:00 2001 From: VilhoRaatikka Date: Mon, 19 Jan 2015 18:38:46 +0200 Subject: [PATCH] Fix to bug #701, http://bugs.mariadb.com/show_bug.cgi?id=701 debugcmd.c:execute_cmd:added skip counter which adjusts the starting position of next argument correctly thus avoiding cropping the latter quoted argument. --- server/modules/routing/debugcmd.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/server/modules/routing/debugcmd.c b/server/modules/routing/debugcmd.c index 409d627dd..cf2232816 100644 --- a/server/modules/routing/debugcmd.c +++ b/server/modules/routing/debugcmd.c @@ -742,6 +742,7 @@ unsigned long arg1, arg2, arg3; int in_quotes = 0, escape_next = 0; char *ptr, *lptr; bool in_space = false; +int nskip = 0; args[0] = cli->cmdbuf; ptr = args[0]; @@ -770,6 +771,8 @@ bool in_space = false; { *lptr = 0; + lptr += nskip; + nskip = 0; if(!in_space){ break; @@ -791,11 +794,13 @@ bool in_space = false; { in_quotes = 1; ptr++; + nskip++; } else if (*ptr == '\"' && in_quotes == 1) { in_quotes = 0; ptr++; + nskip++; } else {