diff --git a/core/admin.m b/core/admin.m index a41c65b92083a43a5b727f269b310c4ed1eb023b..ce7821f48f8fbe7cad420c27b5c5a0705de5c463 100644 --- a/core/admin.m +++ b/core/admin.m @@ -58,7 +58,7 @@ static const char *help = " - reload configuration" CRLF; -static const char unknown_command[] = "unknown command. try typing help." CRLF; +static const char *unknown_command = "unknown command. try typing help." CRLF; #line 65 "core/admin.c" @@ -1457,7 +1457,7 @@ case 107: if (p != pe) { start(out); - tbuf_append(out, unknown_command, sizeof(unknown_command)); + tbuf_append(out, unknown_command, strlen(unknown_command)); end(out); } diff --git a/core/admin.rl b/core/admin.rl index 277b8efcb94aff8802533c2cafffa55fa0683e5a..a9a1c5f1e398d591011005625247fb609147d2af 100644 --- a/core/admin.rl +++ b/core/admin.rl @@ -56,7 +56,7 @@ static const char *help = " - reload configuration" CRLF; -static const char unknown_command[] = "unknown command. try typing help." CRLF; +static const char *unknown_command = "unknown command. try typing help." CRLF; %%{ machine admin; @@ -203,7 +203,7 @@ admin_dispatch(void) if (p != pe) { start(out); - tbuf_append(out, unknown_command, sizeof(unknown_command)); + tbuf_append(out, unknown_command, strlen(unknown_command)); end(out); } diff --git a/test/box/sql.result b/test/box/sql.result index 3816ec74997849d45d0d400869dfa5a058fb3bad..233a1eafedb5f10720fba8649d5f3847ae603468 100644 --- a/test/box/sql.result +++ b/test/box/sql.result @@ -106,3 +106,11 @@ An error occurred: ERR_CODE_ILLEGAL_PARAMS, 'Illegal parameters' select * from t0 where k0='Spears' Found 1 tuple: ['Spears', 'Britney'] +# +# A test case for: http://bugs.launchpad.net/bugs/716683 +# Admin console should not stall on unknown command. + +show status +--- +unknown command. try typing help. +... diff --git a/test/box/sql.test b/test/box/sql.test index 6eac208fe8af124f232ec0f10a395904fe56a7a8..5189ca9d2845ff666fc268eeee0cf25068bc6abd 100644 --- a/test/box/sql.test +++ b/test/box/sql.test @@ -76,4 +76,10 @@ server.stop() server.deploy(self.suite_ini["config"]) server.start() +print """# +# A test case for: http://bugs.launchpad.net/bugs/716683 +# Admin console should not stall on unknown command. +""" +exec admin 'show status' + # vim: syntax=python