mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 08:32:02 +00:00
Check for dict access on underlying dict rather than table
This is better for the table function because otherwise the database is set to "_table_function" when checking access which is not the database where the actual dict is.
This commit is contained in:
parent
e8d831ce90
commit
cd9fd1880f
@ -161,9 +161,9 @@ Pipe StorageDictionary::read(
|
||||
const size_t max_block_size,
|
||||
const size_t threads)
|
||||
{
|
||||
local_context->checkAccess(AccessType::dictGet, getStorageID());
|
||||
auto registered_dictionary_name = location == Location::SameDatabaseAndNameAsDictionary ? getStorageID().getInternalDictionaryName() : dictionary_name;
|
||||
auto dictionary = getContext()->getExternalDictionariesLoader().getDictionary(registered_dictionary_name, local_context);
|
||||
local_context->checkAccess(AccessType::dictGet, dictionary->getDatabaseOrNoDatabaseTag(), dictionary->getDictionaryID().getTableName());
|
||||
return dictionary->read(column_names, max_block_size, threads);
|
||||
}
|
||||
|
||||
|
@ -80,7 +80,6 @@ ColumnsDescription TableFunctionDictionary::getActualTableStructure(ContextPtr c
|
||||
StoragePtr TableFunctionDictionary::executeImpl(
|
||||
const ASTPtr &, ContextPtr context, const std::string & table_name, ColumnsDescription, bool is_insert_query) const
|
||||
{
|
||||
context->checkAccess(AccessType::dictGet, getDatabaseName(), table_name);
|
||||
StorageID dict_id(getDatabaseName(), table_name);
|
||||
auto dictionary_table_structure = getActualTableStructure(context, is_insert_query);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user