2013-09-03 20:21:28 +00:00
|
|
|
#pragma once
|
|
|
|
|
2017-04-01 09:19:00 +00:00
|
|
|
#include <Parsers/IParserBase.h>
|
|
|
|
#include <Parsers/ParserQueryWithOutput.h>
|
|
|
|
#include <Parsers/CommonParsers.h>
|
|
|
|
#include <Parsers/ExpressionElementParsers.h>
|
|
|
|
#include <Parsers/ASTShowProcesslistQuery.h>
|
2013-09-03 20:21:28 +00:00
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
2017-05-27 17:29:55 +00:00
|
|
|
/** Query SHOW PROCESSLIST
|
2013-09-03 20:21:28 +00:00
|
|
|
*/
|
2017-01-11 19:05:46 +00:00
|
|
|
class ParserShowProcesslistQuery : public IParserBase
|
2013-09-03 20:21:28 +00:00
|
|
|
{
|
|
|
|
protected:
|
2017-04-01 07:20:54 +00:00
|
|
|
const char * getName() const { return "SHOW PROCESSLIST query"; }
|
2013-09-03 20:21:28 +00:00
|
|
|
|
2017-04-01 07:20:54 +00:00
|
|
|
bool parseImpl(Pos & pos, Pos end, ASTPtr & node, Pos & max_parsed_pos, Expected & expected)
|
|
|
|
{
|
|
|
|
Pos begin = pos;
|
2013-09-03 20:21:28 +00:00
|
|
|
|
2017-06-15 17:55:57 +00:00
|
|
|
ParserWhitespaceOrComments ws;
|
2013-09-03 20:21:28 +00:00
|
|
|
|
2017-04-01 07:20:54 +00:00
|
|
|
auto query = std::make_shared<ASTShowProcesslistQuery>();
|
2013-09-03 20:21:28 +00:00
|
|
|
|
2017-04-01 07:20:54 +00:00
|
|
|
ws.ignore(pos, end);
|
2013-09-03 20:21:28 +00:00
|
|
|
|
2017-06-18 03:07:03 +00:00
|
|
|
if (!ParserKeyword("SHOW PROCESSLIST").ignore(pos, end, max_parsed_pos, expected))
|
2017-04-01 07:20:54 +00:00
|
|
|
return false;
|
2013-09-03 20:21:28 +00:00
|
|
|
|
2017-04-01 07:20:54 +00:00
|
|
|
ws.ignore(pos, end);
|
2013-09-03 20:21:28 +00:00
|
|
|
|
2017-04-01 07:20:54 +00:00
|
|
|
query->range = StringRange(begin, pos);
|
|
|
|
node = query;
|
2013-09-03 20:21:28 +00:00
|
|
|
|
2017-04-01 07:20:54 +00:00
|
|
|
return true;
|
|
|
|
}
|
2013-09-03 20:21:28 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|