Merge pull request #19164 from azat/COMPLEX_KEY_SSD_CACHE-dictHas-fix

Add missing type check in dictHas for COMPLEX_KEY_SSD_CACHE layout
This commit is contained in:
alexey-milovidov 2021-01-16 20:55:08 +03:00 committed by GitHub
commit 3737ef253f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

View File

@ -1644,6 +1644,8 @@ void SSDComplexKeyCacheDictionary::has(
const DataTypes & key_types,
PaddedPODArray<UInt8> & out) const
{
dict_struct.validateKeyTypes(key_types);
const auto now = std::chrono::system_clock::now();
std::unordered_map<KeyRef, std::vector<size_t>> not_found_keys;

View File

@ -42,6 +42,9 @@ LAYOUT(COMPLEX_KEY_SSD_CACHE(FILE_SIZE 8192 PATH '/var/lib/clickhouse/clickhouse
SELECT 'TEST_SMALL';
SELECT 'VALUE FROM RAM BUFFER';
-- NUMBER_OF_ARGUMENTS_DOESNT_MATCH
SELECT dictHas('database_for_dict.ssd_dict', 'a', tuple('1')); -- { serverError 42 }
SELECT dictGetUInt64('database_for_dict.ssd_dict', 'a', tuple('1', toInt32(3)));
SELECT dictGetInt32('database_for_dict.ssd_dict', 'b', tuple('1', toInt32(3)));
SELECT dictGetString('database_for_dict.ssd_dict', 'c', tuple('1', toInt32(3)));