2017-04-01 09:19:00 +00:00
|
|
|
#include <DataTypes/DataTypeString.h>
|
|
|
|
#include <DataTypes/DataTypesNumber.h>
|
2017-05-24 21:06:29 +00:00
|
|
|
#include <Interpreters/Context.h>
|
2017-04-01 09:19:00 +00:00
|
|
|
#include <Storages/System/StorageSystemSettings.h>
|
2014-10-06 03:49:56 +00:00
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
2018-07-24 14:28:56 +00:00
|
|
|
NamesAndTypesList StorageSystemSettings::getNamesAndTypes()
|
2018-01-25 14:42:39 +00:00
|
|
|
{
|
2018-07-24 14:28:56 +00:00
|
|
|
return {
|
|
|
|
{"name", std::make_shared<DataTypeString>()},
|
|
|
|
{"value", std::make_shared<DataTypeString>()},
|
|
|
|
{"changed", std::make_shared<DataTypeUInt8>()},
|
|
|
|
{"description", std::make_shared<DataTypeString>()},
|
|
|
|
};
|
2014-10-06 03:49:56 +00:00
|
|
|
}
|
|
|
|
|
2018-08-23 01:42:55 +00:00
|
|
|
#ifndef __clang__
|
|
|
|
#pragma GCC optimize("-fno-var-tracking-assignments")
|
|
|
|
#endif
|
|
|
|
|
2018-07-24 14:28:56 +00:00
|
|
|
void StorageSystemSettings::fillData(MutableColumns & res_columns, const Context & context, const SelectQueryInfo &) const
|
2014-10-06 03:49:56 +00:00
|
|
|
{
|
2017-05-24 21:06:29 +00:00
|
|
|
const Settings & settings = context.getSettingsRef();
|
|
|
|
|
2018-07-24 14:28:56 +00:00
|
|
|
#define ADD_SETTING(TYPE, NAME, DEFAULT, DESCRIPTION) \
|
|
|
|
res_columns[0]->insert(String(#NAME)); \
|
|
|
|
res_columns[1]->insert(settings.NAME.toString()); \
|
2017-12-16 00:49:03 +00:00
|
|
|
res_columns[2]->insert(UInt64(settings.NAME.changed)); \
|
|
|
|
res_columns[3]->insert(String(DESCRIPTION));
|
2017-04-01 07:20:54 +00:00
|
|
|
APPLY_FOR_SETTINGS(ADD_SETTING)
|
2014-10-06 03:49:56 +00:00
|
|
|
#undef ADD_SETTING
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|