```
2020.08.26 09:13:35.081818 [ 97 ] {94018202-348d-482a-a507-d911dfe36336} <Debug> executeQuery: (from [::1]:36574) SELECT * FROM b
2020.08.26 09:13:35.084392 [ 97 ] {94018202-348d-482a-a507-d911dfe36336} <Trace> ContextAccess (default): Access granted: SELECT(id1, id2, valA, val1, val2) ON default.b
2020.08.26 09:13:35.087388 [ 97 ] {94018202-348d-482a-a507-d911dfe36336} <Debug> HashJoin: Right sample block: id1 UInt32 UInt32(size = 0), val1 UInt8 UInt8(size = 0)
2020.08.26 09:13:35.091278 [ 97 ] {94018202-348d-482a-a507-d911dfe36336} <Debug> HashJoin: Right sample block: id1 UInt32 UInt32(size = 0), val1 UInt8 UInt8(size = 0)
2020.08.26 09:13:35.094011 [ 97 ] {94018202-348d-482a-a507-d911dfe36336} <Debug> HashJoin: Right sample block: id2 UInt32 UInt32(size = 0), val2 UInt8 UInt8(size = 0)
2020.08.26 09:13:35.095734 [ 97 ] {94018202-348d-482a-a507-d911dfe36336} <Trace> InterpreterSelectQuery: FetchColumns -> Complete
2020.08.26 09:13:35.096322 [ 97 ] {94018202-348d-482a-a507-d911dfe36336} <Trace> InterpreterSelectQuery: FetchColumns -> Complete
2020.08.26 09:13:35.102741 [ 97 ] {94018202-348d-482a-a507-d911dfe36336} <Trace> InterpreterSelectQuery: FetchColumns -> Complete
2020.08.26 09:13:35.104310 [ 97 ] {94018202-348d-482a-a507-d911dfe36336} <Error> : Logical error: 'Extremes transform was already added to pipeline.'.
clickhouse-server: ../src/Common/Exception.cpp:45: DB::Exception::Exception(const std::string &, int): Assertion `false' failed.
2020.08.26 09:13:35.104721 [ 64 ] {} <Trace> BaseDaemon: Received signal 6
2020.08.26 09:13:35.105005 [ 248 ] {} <Fatal> BaseDaemon: ########################################
2020.08.26 09:13:35.105422 [ 248 ] {} <Fatal> BaseDaemon: (version 20.8.1.4470, build id: 79B2358424232F7A) (from thread 97) (query_id: 94018202-348d-482a-a507-d911dfe36336) Received signal Aborted (6)
2020.08.26 09:13:35.105601 [ 248 ] {} <Fatal> BaseDaemon: 
2020.08.26 09:13:35.105797 [ 248 ] {} <Fatal> BaseDaemon: Stack trace: 0x7f8f73bf3f47 0x7f8f73bf58b1 0x7f8f73be542a 0x7f8f73be54a2 0x25c981c1 0x30ea5f41 0x311cc2a9 0x311df4cf 0x311fa8c3 0x30316bf8 0x304d5617 0x304d460a 0x30dfccc6 0x30e04158 0x34a8945c 0x34a89c6c 0x34bcba73 0x34bc89ad 0x34bc7838 0x7f8f743b96db 0x7f8f73cd6a3f
2020.08.26 09:13:35.106176 [ 248 ] {} <Fatal> BaseDaemon: 4. /build/glibc-2ORdQG/glibc-2.27/signal/../sysdeps/unix/sysv/linux/raise.c:51: raise @ 0x3ef47 in /usr/lib/debug/lib/x86_64-linux-gnu/libc-2.27.so
2020.08.26 09:13:35.106441 [ 248 ] {} <Fatal> BaseDaemon: 5. /build/glibc-2ORdQG/glibc-2.27/stdlib/abort.c:81: abort @ 0x408b1 in /usr/lib/debug/lib/x86_64-linux-gnu/libc-2.27.so
2020.08.26 09:13:35.106686 [ 248 ] {} <Fatal> BaseDaemon: 6. /build/glibc-2ORdQG/glibc-2.27/assert/assert.c:89: __assert_fail_base @ 0x3042a in /usr/lib/debug/lib/x86_64-linux-gnu/libc-2.27.so
2020.08.26 09:13:35.107084 [ 248 ] {} <Fatal> BaseDaemon: 7. ? @ 0x304a2 in /usr/lib/debug/lib/x86_64-linux-gnu/libc-2.27.so
2020.08.26 09:13:35.107460 [ 248 ] {} <Fatal> BaseDaemon: 8. /build/obj-x86_64-linux-gnu/../src/Common/Exception.cpp:48: DB::Exception::Exception(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int) @ 0x25c981c1 in /workspace/clickhouse
2020.08.26 09:13:35.167617 [ 248 ] {} <Fatal> BaseDaemon: 9. /build/obj-x86_64-linux-gnu/../src/Processors/QueryPipeline.cpp:191: DB::QueryPipeline::addExtremesTransform() @ 0x30ea5f41 in /workspace/clickhouse
2020.08.26 09:13:35.230240 [ 248 ] {} <Fatal> BaseDaemon: 10. /build/obj-x86_64-linux-gnu/../src/Processors/QueryPlan/ExtremesStep.cpp:31: DB::ExtremesStep::transformPipeline(DB::QueryPipeline&) @ 0x311cc2a9 in /workspace/clickhouse
2020.08.26 09:13:35.292104 [ 248 ] {} <Fatal> BaseDaemon: 11. /build/obj-x86_64-linux-gnu/../src/Processors/QueryPlan/ITransformingStep.cpp:44: DB::ITransformingStep::updatePipeline(std::__1::vector<std::__1::unique_ptr<DB::QueryPipeline, std::__1::default_delete<DB::QueryPipeline> >, std::__1::allocator<std::__1::unique_ptr<DB::QueryPipeline, std::__1::default_delete<DB::QueryPipeline> > > >) @ 0x311df4cf in /workspace/clickhouse
2020.08.26 09:13:35.354345 [ 248 ] {} <Fatal> BaseDaemon: 12. /build/obj-x86_64-linux-gnu/../src/Processors/QueryPlan/QueryPlan.cpp:169: DB::QueryPlan::buildQueryPipeline() @ 0x311fa8c3 in /workspace/clickhouse
2020.08.26 09:13:35.403571 [ 248 ] {} <Fatal> BaseDaemon: 13. /build/obj-x86_64-linux-gnu/../src/Interpreters/InterpreterSelectWithUnionQuery.cpp:208: DB::InterpreterSelectWithUnionQuery::execute() @ 0x30316bf8 in /workspace/clickhouse
2020.08.26 09:13:35.455289 [ 248 ] {} <Fatal> BaseDaemon: 14. /build/obj-x86_64-linux-gnu/../src/Interpreters/executeQuery.cpp:389: DB::executeQueryImpl(char const*, char const*, DB::Context&, bool, DB::QueryProcessingStage::Enum, bool, DB::ReadBuffer*) @ 0x304d5617 in /workspace/clickhouse
2020.08.26 09:13:35.506682 [ 248 ] {} <Fatal> BaseDaemon: 15. /build/obj-x86_64-linux-gnu/../src/Interpreters/executeQuery.cpp:675: DB::executeQuery(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, DB::Context&, bool, DB::QueryProcessingStage::Enum, bool) @ 0x304d460a in /workspace/clickhouse
2020.08.26 09:13:35.565299 [ 248 ] {} <Fatal> BaseDaemon: 16. /build/obj-x86_64-linux-gnu/../src/Server/TCPHandler.cpp:253: DB::TCPHandler::runImpl() @ 0x30dfccc6 in /workspace/clickhouse
2020.08.26 09:13:35.623803 [ 248 ] {} <Fatal> BaseDaemon: 17. /build/obj-x86_64-linux-gnu/../src/Server/TCPHandler.cpp:1213: DB::TCPHandler::run() @ 0x30e04158 in /workspace/clickhouse
2020.08.26 09:13:35.690771 [ 248 ] {} <Fatal> BaseDaemon: 18. /build/obj-x86_64-linux-gnu/../contrib/poco/Net/src/TCPServerConnection.cpp:43: Poco::Net::TCPServerConnection::start() @ 0x34a8945c in /workspace/clickhouse
2020.08.26 09:13:35.762628 [ 248 ] {} <Fatal> BaseDaemon: 19. /build/obj-x86_64-linux-gnu/../contrib/poco/Net/src/TCPServerDispatcher.cpp:114: Poco::Net::TCPServerDispatcher::run() @ 0x34a89c6c in /workspace/clickhouse
2020.08.26 09:13:35.831167 [ 248 ] {} <Fatal> BaseDaemon: 20. /build/obj-x86_64-linux-gnu/../contrib/poco/Foundation/src/ThreadPool.cpp:199: Poco::PooledThread::run() @ 0x34bcba73 in /workspace/clickhouse
2020.08.26 09:13:35.877334 [ 70 ] {} <Trace> SystemLog (system.trace_log): Flushing system log, 9 entries to flush
2020.08.26 09:13:35.879794 [ 70 ] {} <Debug> DiskLocal: Reserving 1.00 MiB on disk `default`, having unreserved 433.76 GiB.
2020.08.26 09:13:35.899046 [ 248 ] {} <Fatal> BaseDaemon: 21. /build/obj-x86_64-linux-gnu/../contrib/poco/Foundation/src/Thread.cpp:56: Poco::(anonymous namespace)::RunnableHolder::run() @ 0x34bc89ad in /workspace/clickhouse
```

I found only the CREATE VIEW statement for b
``` sql
2020.08.26 09:13:30.636180 [ 97 ] {22290044-f0f2-4f9d-a8ec-44bccd31e716} <Debug> executeQuery: (from [::1]:36574) CREATE VIEW b AS SELECT * FROM (SELECT * FROM a ANY LEFT JOIN id1 USING (id1)) AS js1 ANY LEFT JOIN id2 USING (id2)
```

https://clickhouse-test-reports.s3.yandex.net/13860/dc9ca2a878fcdae624318994a3a8c306dc74fb2a/fuzzer/server.log

https://clickhouse-test-reports.s3.yandex.net/13860/dc9ca2a878fcdae624318994a3a8c306dc74fb2a/fuzzer/fuzzer.log

https://clickhouse-test-reports.s3.yandex.net/13860/dc9ca2a878fcdae624318994a3a8c306dc74fb2a/fuzzer/main.log

{
    pipe.dropTotals();
    pipe.dropExtremes();
}
void QueryPipeline::addExtremesTransform()
{
    checkInitializedAndNotCompleted();
    if (pipe.getExtremesPort())
        throw Exception("Extremes transform was already added to pipeline.", ErrorCodes::LOGICAL_ERROR);
    resize(1);
    auto transform = std::make_shared<ExtremesTransform>(getHeader());
    auto * port = &transform->getExtremesPort();
    pipe.addTransform(std::move(transform), nullptr, port);
}
void QueryPipeline::setOutputFormat(ProcessorPtr output)