
**Describe the bug**
[A link to the report](https://s3.amazonaws.com/clickhouse-test-reports/32291/2f43445a34c91beb1104422308ba5abfdf7be5bb/fuzzer_astfuzzertsan,actions//report.html)

**How to reproduce**

```SQL
CREATE TABLE t1 (`id` Int32, `key` String, `key2` String) ENGINE = TinyLog;
CREATE TABLE t2 (`id` Int32, `key` String, `key2` String) ENGINE = TinyLog;
SELECT (t1.id = t2.id) AND (t2.key = t2.key2) AND ((t1.id = t2.id) AND (t2.key = t2.key2) AND (t1.key = t1.key2) AND (t2.key2 = NULL)) AND (t1.key = t1.key2) AND (t2.key2 = NULL), NULL FROM t1 ANY INNER JOIN t2 ON (t1.key = t1
.key2) AND (NULL = t1.key) AND (t2.key = t2.key2) AND ((NULL = t1.key) = t2.id) AND (('' = t1.key) = t2.id) AND (t2.key2 = NULL);
```

const Block & block_right, const Names & key_names_right, const String & condition_name_right)
{
    checkTypesOfKeys(block_left, key_names_left, block_right, key_names_right);
    checkTypesOfMasks(block_left, condition_name_left, block_right, condition_name_right);
}
void checkTypesOfMasks(const Block & block_left, const String & condition_name_left,
                       const Block & block_right, const String & condition_name_right)
{
    auto check_cond_column_type = [](const Block & block, const String & col_name)
    {
        if (col_name.empty())
            return;
        DataTypePtr dtype = removeNullable(recursiveRemoveLowCardinality(block.getByName(col_name).type));
        if (!dtype->equals(DataTypeUInt8{}))
            throw Exception(ErrorCodes::INVALID_JOIN_ON_EXPRESSION,
                            "Expected logical expression in JOIN ON section, got unexpected column '{}' of type '{}'",
                            col_name, dtype->getName());
    };
    check_cond_column_type(block_left, condition_name_left);
    check_cond_column_type(block_right, condition_name_right);
}
void createMissedColumns(Block & block)