ClickHouse/src/Storages/System/StorageSystemCollations.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

26 lines
704 B
C++

#include <Columns/Collator.h>
#include <Storages/System/StorageSystemCollations.h>
#include <DataTypes/DataTypeNullable.h>
namespace DB
{
NamesAndTypesList StorageSystemCollations::getNamesAndTypes()
{
return {
{"name", std::make_shared<DataTypeString>()},
{"language", std::make_shared<DataTypeNullable>(std::make_shared<DataTypeString>())},
};
}
void StorageSystemCollations::fillData(MutableColumns & res_columns, ContextPtr, const SelectQueryInfo &) const
{
for (const auto & [locale, lang]: AvailableCollationLocales::instance().getAvailableCollations())
{
res_columns[0]->insert(locale);
res_columns[1]->insert(lang ? *lang : Field());
}
}
}