2020-05-08 12:50:45 +00:00
|
|
|
#include <Storages/System/StorageSystemQuotasUsage.h>
|
|
|
|
#include <Storages/System/StorageSystemQuotaUsage.h>
|
|
|
|
#include <Interpreters/Context.h>
|
|
|
|
#include <Access/AccessControlManager.h>
|
2021-10-31 08:51:20 +00:00
|
|
|
#include <Access/Common/AccessFlags.h>
|
2020-05-08 12:50:45 +00:00
|
|
|
#include <Access/QuotaUsage.h>
|
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
NamesAndTypesList StorageSystemQuotasUsage::getNamesAndTypes()
|
|
|
|
{
|
|
|
|
return StorageSystemQuotaUsage::getNamesAndTypesImpl(/* add_column_is_current = */ true);
|
|
|
|
}
|
|
|
|
|
2021-04-10 23:33:54 +00:00
|
|
|
void StorageSystemQuotasUsage::fillData(MutableColumns & res_columns, ContextPtr context, const SelectQueryInfo &) const
|
2020-05-08 12:50:45 +00:00
|
|
|
{
|
2021-04-10 23:33:54 +00:00
|
|
|
context->checkAccess(AccessType::SHOW_QUOTAS);
|
|
|
|
auto all_quotas_usage = context->getAccessControlManager().getAllQuotasUsage();
|
2020-05-08 12:50:45 +00:00
|
|
|
StorageSystemQuotaUsage::fillDataImpl(res_columns, context, /* add_column_is_current = */ true, all_quotas_usage);
|
|
|
|
}
|
|
|
|
}
|