#include #include #include #include #include #include namespace DB { NamesAndTypesList StorageSystemSettingsChanges::getNamesAndTypes() { return { {"version", std::make_shared()}, {"changes", std::make_shared(std::make_shared( DataTypes{ std::make_shared(), std::make_shared(), std::make_shared(), std::make_shared()}, Names{"name", "previous_value", "new_value", "reason"}))}, }; } void StorageSystemSettingsChanges::fillData(MutableColumns & res_columns, ContextPtr, const SelectQueryInfo &) const { for (auto it = settings_changes_history.rbegin(); it != settings_changes_history.rend(); ++it) { res_columns[0]->insert(it->first.toString()); Array changes; for (const auto & change : it->second) changes.push_back(Tuple{change.name, toString(change.previous_value), toString(change.new_value), change.reason}); res_columns[1]->insert(changes); } } }