**Describe the bug**
```
SELECT pow('0.0000000257', NULL), pow(pow(NULL, NULL), NULL) - NULL, (val + NULL) = (rval * 0), * FROM (SELECT (val + 256) = (NULL * NULL), toLowCardinality(toNullable(dummy)) AS val FROM system.one) AS s1 ANY LEFT JOIN (SELECT toLowCardinality(dummy) AS rval FROM system.one) AS s2 ON (val + 0) = (rval * 255)
```

https://clickhouse-test-reports.s3.yandex.net/19868/c39ee3f58c85de0f2a7b609377e2f138305dc745/fuzzer_msan/server.log
}
    
    if (second.settings.project_input)
    {
        first.index.swap(second.index);
        first.settings.project_input = true;
    }
    else
    {
        
        for (auto it = first.index.begin(); it != first.index.end();)
        {
            auto cur = it;
            ++it;
            auto jt = removed_first_result.find(*cur);
            if (jt != removed_first_result.end() && jt->second > 0)
            {
                first.index.remove(cur);
                --jt->second;
            }
        }
        for (auto it = second.index.rbegin(); it != second.index.rend(); ++it)
            first.index.prepend(*it);
    }
    first.nodes.splice(first.nodes.end(), std::move(second.nodes));
    
    ActionsDAG::Index first_index;
    for (auto * node : first.index)
        first_index.insert(node);
    first.index.swap(first_index);