mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-17 20:02:05 +00:00
ee37f551a2
* make interpreter factory an instance * add registerInterpreter * register interpreters individually * try wire everything up * fix style * fix test
30 lines
832 B
C++
30 lines
832 B
C++
#include <Interpreters/InterpreterFactory.h>
|
|
#include <Interpreters/Access/InterpreterShowPrivilegesQuery.h>
|
|
#include <Interpreters/executeQuery.h>
|
|
|
|
|
|
namespace DB
|
|
{
|
|
InterpreterShowPrivilegesQuery::InterpreterShowPrivilegesQuery(const ASTPtr & query_ptr_, ContextMutablePtr context_)
|
|
: query_ptr(query_ptr_), context(context_)
|
|
{
|
|
}
|
|
|
|
|
|
BlockIO InterpreterShowPrivilegesQuery::execute()
|
|
{
|
|
return executeQuery("SELECT * FROM system.privileges", context, QueryFlags{ .internal = true }).second;
|
|
}
|
|
|
|
void registerInterpreterShowPrivilegesQuery(InterpreterFactory & factory)
|
|
{
|
|
auto create_fn = [] (const InterpreterFactory::Arguments & args)
|
|
{
|
|
return std::make_unique<InterpreterShowPrivilegesQuery>(args.query, args.context);
|
|
};
|
|
factory.registerInterpreter("InterpreterShowPrivilegesQuery", create_fn);
|
|
}
|
|
|
|
|
|
}
|