(you don't have to strictly follow this form)

**Describe the bug**
A link to the report: https://s3.amazonaws.com/clickhouse-test-reports/35466/d81c58b5d9be45ac69c3859b5cbe97080711f6d9/fuzzer_astfuzzerubsan,actions//report.html
The commit: https://github.com/ClickHouse/ClickHouse/commit/d81c58b5d9be45ac69c3859b5cbe97080711f6d9
if (!has_input)
    {
        interpreter_subquery = joined_tables.makeLeftTableSubquery(options.subquery());
        if (interpreter_subquery)
        {
            source_header = interpreter_subquery->getSampleBlock();
            uses_view_source |= interpreter_subquery->usesViewSource();
        }
    }
    joined_tables.rewriteDistributedInAndJoins(query_ptr);
    max_streams = settings.max_threads;
    ASTSelectQuery & query = getSelectQuery();
    std::shared_ptr<TableJoin> table_join = joined_tables.makeTableJoin(query);
    if (storage)
        row_policy_filter = context->getRowPolicyFilter(table_id.getDatabaseName(), table_id.getTableName(), RowPolicyFilterType::SELECT_FILTER);
    StorageView * view = nullptr;
    if (storage)
        view = dynamic_cast<StorageView *>(storage.get());
    
    SubqueriesForSets subquery_for_sets;
    auto analyze = [&] (bool try_move_to_prewhere)
    {
        
        ASTPtr view_table;
        if (view)
            view->replaceWithSubquery(getSelectQuery(), view_table, metadata_snapshot);
        syntax_analyzer_result = TreeRewriter(context).analyzeSelect(
            query_ptr,
            TreeRewriterResult(source_header.getNamesAndTypesList(), storage, storage_snapshot),
            options, joined_tables.tablesWithColumns(), required_result_column_names, table_join);