Skip to content

Commit 7b4395e

Browse files
Merge branch 'mysql-5.5-cluster-7.2' into mysql-5.6-cluster-7.3
2 parents ef4bc92 + 608e7c4 commit 7b4395e

File tree

1 file changed

+19
-18
lines changed

1 file changed

+19
-18
lines changed

storage/ndb/src/mgmsrv/Services.cpp

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
2+
Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
33
44
This program is free software; you can redistribute it and/or modify
55
it under the terms of the GNU General Public License as published by
@@ -1914,25 +1914,26 @@ MgmApiSession::list_session(SocketServer::Session *_s, void *data)
19141914
if(s->m_ctx)
19151915
{
19161916
int l= (int)strlen(s->m_ctx->m_tokenBuffer);
1917-
char *buf= (char*) malloc(2*l+1);
1918-
char *b= buf;
1919-
for(int i=0; i<l;i++)
1920-
if(s->m_ctx->m_tokenBuffer[i]=='\n')
1921-
{
1922-
*b++='\\';
1923-
*b++='n';
1924-
}
1925-
else
1926-
{
1927-
*b++= s->m_ctx->m_tokenBuffer[i];
1928-
}
1929-
*b= '\0';
1917+
lister->m_output->println("session.%llu.parser.buffer.len: %u", id, l);
1918+
lister->m_output->print("session.%llu.parser.buffer: ", id);
1919+
for (int i = 0; i < l; i++)
1920+
{
19301921

1931-
lister->m_output->println("session.%llu.parser.buffer.len: %u",id,l);
1932-
lister->m_output->println("session.%llu.parser.buffer: %s",id,buf);
1933-
lister->m_output->println("session.%llu.parser.status: %d",id,s->m_ctx->m_status);
1922+
if (s->m_ctx->m_tokenBuffer[i] == '\n')
1923+
{
1924+
1925+
lister->m_output->print("%s", "\\");
1926+
lister->m_output->print("%c", 'n');
19341927

1935-
free(buf);
1928+
}
1929+
else
1930+
{
1931+
lister->m_output->print("%c", s->m_ctx->m_tokenBuffer[i]);
1932+
}
1933+
}
1934+
//listener reads line by line hence we are not using println till we print the complete message.
1935+
lister->m_output->println("%c","\0");
1936+
lister->m_output->println("session.%llu.parser.status: %d",id,s->m_ctx->m_status);
19361937
}
19371938

19381939
if(s!=lister)

0 commit comments

Comments
 (0)