mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-16 03:12:43 +00:00
495c6e03aa
* Replace all Context references with std::weak_ptr * Fix shared context captured by value * Fix build * Fix Context with named sessions * Fix copy context * Fix gcc build * Merge with master and fix build * Fix gcc-9 build
29 lines
648 B
C++
29 lines
648 B
C++
#include <Common/Macros.h>
|
|
#include <Interpreters/Context.h>
|
|
#include <Storages/System/StorageSystemMacros.h>
|
|
|
|
|
|
namespace DB
|
|
{
|
|
|
|
NamesAndTypesList StorageSystemMacros::getNamesAndTypes()
|
|
{
|
|
return {
|
|
{"macro", std::make_shared<DataTypeString>()},
|
|
{"substitution", std::make_shared<DataTypeString>()},
|
|
};
|
|
}
|
|
|
|
void StorageSystemMacros::fillData(MutableColumns & res_columns, ContextPtr context, const SelectQueryInfo &) const
|
|
{
|
|
auto macros = context->getMacros();
|
|
|
|
for (const auto & macro : macros->getMacroMap())
|
|
{
|
|
res_columns[0]->insert(macro.first);
|
|
res_columns[1]->insert(macro.second);
|
|
}
|
|
}
|
|
|
|
}
|