2021-07-09 09:27:51 +00:00
|
|
|
#include <memory>
|
|
|
|
#include <Storages/System/StorageSystemWarnings.h>
|
|
|
|
#include <Interpreters/Context.h>
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
|
|
|
NamesAndTypesList StorageSystemWarnings::getNamesAndTypes()
|
|
|
|
{
|
|
|
|
return {
|
2021-07-09 14:40:32 +00:00
|
|
|
{"message", std::make_shared<DataTypeString>()},
|
2021-07-09 09:27:51 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
void StorageSystemWarnings::fillData(MutableColumns & res_columns, ContextPtr context, const SelectQueryInfo &) const
|
|
|
|
{
|
|
|
|
for (auto& warning : context->getWarnings()) {
|
2021-07-09 14:40:32 +00:00
|
|
|
res_columns[0]->insert("Warning: " + warning);
|
2021-07-09 09:27:51 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|