ClickHouse/src/Storages/System/StorageSystemLicenses.cpp
Ivan 495c6e03aa
Replace all Context references with std::weak_ptr (#22297)
* 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
2021-04-11 02:33:54 +03:00

32 lines
861 B
C++

#include "StorageSystemLicenses.h"
#include <algorithm>
#include <DataTypes/DataTypeString.h>
extern const char * library_licenses[];
namespace DB
{
NamesAndTypesList StorageSystemLicenses::getNamesAndTypes()
{
return {
{"library_name", std::make_shared<DataTypeString>()},
{"license_type", std::make_shared<DataTypeString>()},
{"license_path", std::make_shared<DataTypeString>()},
{"license_text", std::make_shared<DataTypeString>()},
};
}
void StorageSystemLicenses::fillData(MutableColumns & res_columns, ContextPtr, const SelectQueryInfo &) const
{
for (const auto * it = library_licenses; *it; it += 4)
{
res_columns[0]->insert(String(it[0]));
res_columns[1]->insert(String(it[1]));
res_columns[2]->insert(String(it[2]));
res_columns[3]->insert(String(it[3]));
}
}
}