**Describe the bug**
1. https://clickhouse-test-reports.s3.yandex.net/19736/68c542aec681bbf841f45fc879c1e97052449555/fuzzer_ubsan/server.log
2. https://clickhouse-test-reports.s3.yandex.net/19736/68c542aec681bbf841f45fc879c1e97052449555/fuzzer_asan/server.log
3. https://clickhouse-test-reports.s3.yandex.net/19736/68c542aec681bbf841f45fc879c1e97052449555/fuzzer_msan/server.log
4. https://clickhouse-test-reports.s3.yandex.net/19736/342326978f2bb2fe5c108c2801cdbabaf407fa68/fuzzer_debug/server.log
5. https://clickhouse-test-reports.s3.yandex.net/19736/342326978f2bb2fe5c108c2801cdbabaf407fa68/fuzzer_tsan/server.log

CC @zhang2014 
#include <optional>
#include <Core/Field.h>
#include <Common/FieldVisitors.h>
#include <Core/Row.h>
#include <Columns/ColumnsNumber.h>
#include <Columns/ColumnTuple.h>
#include <Common/typeid_cast.h>
#include <DataStreams/IBlockInputStream.h>
#include <DataTypes/DataTypeTuple.h>
#include <DataTypes/DataTypeNullable.h>
#include <Parsers/ASTExpressionList.h>
#include <Parsers/ASTFunction.h>
#include <Parsers/ASTLiteral.h>
#include <Interpreters/Set.h>
#include <Interpreters/convertFieldToType.h>
#include <Interpreters/evaluateConstantExpression.h>
#include <Interpreters/NullableUtils.h>
#include <Interpreters/sortBlock.h>
#include <Interpreters/castColumn.h>
#include <Interpreters/Context.h>
#include <Storages/MergeTree/KeyCondition.h>
#include <ext/range.h>
#include <DataTypes/DataTypeLowCardinality.h>
namespace DB
{
namespace ErrorCodes
{
    extern const int LOGICAL_ERROR;