https://clickhouse-test-reports.s3.yandex.net/16193/5e0cbfe9720a56faad57d4c73a3abbea638d7ca8/fuzzer_debug/report.html#fail1

```
:) set joined_subquery_requires_alias=0
:) set any_join_distinct_right_table_keys=1
:) SELECT a FROM (SELECT 0 AS a) ANY FULL OUTER JOIN (SELECT 2 AS a, NULL AS b) USING (a) WHERE (b = -2) = 1025

SELECT a
FROM 
(
    SELECT 0 AS a
)
ANY FULL OUTER JOIN 
(
    SELECT
        2 AS a,
        NULL AS b
) USING (a)
WHERE (b = -2) = 1025

Query id: 293e7e06-d31c-4a7e-af78-5577ee6043ef

[avtokmakov-dev.sas.yp-c.yandex.net] 2021.02.09 14:54:53.301098 [ 15692 ] {293e7e06-d31c-4a7e-af78-5577ee6043ef} <Fatal> : Logical error: 'Pipeline stuck. Current state:
digraph
{
  rankdir="LR";
  { node [shape = box]
    n139693730399768[label="SourceFromSingleChunk(1 jobs, execution time: 0 sec., preparation time: 0.000008069 sec.) (PortFull)"];
    n139693730472344[label="ExpressionTransform(1 jobs, execution time: 0 sec., preparation time: 0.000022163 sec.) (PortFull)"];
    n139693730402328[label="SourceFromSingleChunk(2 jobs, execution time: 0 sec., preparation time: 0.000013782 sec.) (Finished)"];
    n139693730472664[label="JoiningTransform(1 jobs, execution time: 0 sec., preparation time: 0.000011344 sec.) (PortFull)"];
    n139693730472984[label="JoiningTransform(1 jobs, execution time: 0 sec., preparation time: 0.000011328 sec.) (Finished)"];
    n139693729984920[label="SourceFromInputStream(1 jobs, execution time: 0 sec., preparation time: 0.000003341 sec.) (Finished)"];
    n139693730174520[label="DelayedPorts(0 jobs, execution time: 0 sec., preparation time: 0.000007431 sec.) (Finished)"];
    n139693730473304[label="Resize(0 jobs, execution time: 0 sec., preparation time: 0.000036154 sec.) (Finished)"];
    n139693730366808[label="FilterTransform(0 jobs, execution time: 0 sec., preparation time: 0.000005212 sec.) (Finished)"];
    n139693730368600[label="FilterTransform(0 jobs, execution time: 0 sec., preparation time: 0.000004699 sec.) (Finished)"];
    n139693730369048[label="FilterTransform(0 jobs, execution time: 0 sec., preparation time: 0.000006876 sec.) (Finished)"];
    n139693730473624[label="ExpressionTransform(0 jobs, execution time: 0 sec., preparation time: 0.00000702 sec.) (Finished)"];
    n139693730473944[label="ExpressionTransform(0 jobs, execution time: 0 sec., preparation time: 0.000006159 sec.) (Finished)"];
    n139693730474264[label="ExpressionTransform(0 jobs, execution time: 0 sec., preparation time: 0.000006023 sec.) (Finished)"];
    n139693730401304[label="SourceFromSingleChunk(2 jobs, execution time: 0 sec., preparation time: 0.000027631 sec.) (Finished)"];
    n139693730474904[label="ExpressionTransform(1 jobs, execution time: 0 sec., preparation time: 0.000016417 sec.) (Finished)"];
    n139693730297112[label="CreatingSetsTransform(2 jobs, execution time: 0 sec., preparation time: 0.000018637 sec.) (Finished)"];
    n139693730174072[label="DelayedPorts(0 jobs, execution time: 0 sec., preparation time: 0.000020356 sec.) (Finished)"];
    n139693730474584[label="ExpressionTransform(0 jobs, execution time: 0 sec., preparation time: 0.000006359 sec.) (Finished)"];
    n139693730475224[label="ExpressionTransform(0 jobs, execution time: 0 sec., preparation time: 0.000006292 sec.) (Finished)"];
    n139693730475544[label="ExpressionTransform(0 jobs, execution time: 0 sec., preparation time: 0.000005804 sec.) (Finished)"];
    n139693730471704[label="Resize(0 jobs, execution time: 0 sec., preparation time: 0.000032733 sec.) (Finished)"];
    n139693730367704[label="LimitsCheckingTransform(0 jobs, execution time: 0 sec., preparation time: 0.000008458 sec.) (Finished)"];
    n139693730365912[label="LimitsCheckingTransform(0 jobs, execution time: 0 sec., preparation time: 0.000005878 sec.) (Finished)"];
    n139693730174296[label="NullSource(1 jobs, execution time: 0 sec., preparation time: 0.000004108 sec.) (Finished)"];
    n139693730489880[label="LazyOutputFormat(1 jobs, execution time: 0 sec., preparation time: 0.000014797 sec.) (Finished)"];
  }
  n139693730399768 -> n139693730472344;
  n139693730472344 -> n139693730472664;
  n139693730402328 -> n139693730472984;
  n139693730472664 -> n139693730174520;
  n139693730472984 -> n139693730369048;
  n139693729984920 -> n139693730174520;
  n139693730174520 -> n139693730473304;
  n139693730174520 -> n139693730473304;
  n139693730473304 -> n139693730366808;
  n139693730473304 -> n139693730368600;
  n139693730366808 -> n139693730473624;
  n139693730368600 -> n139693730473944;
  n139693730369048 -> n139693730474264;
  n139693730473624 -> n139693730174072;
  n139693730473944 -> n139693730174072;
  n139693730474264 -> n139693730475544;
  n139693730401304 -> n139693730474904;
  n139693730474904 -> n139693730297112;
  n139693730297112 -> n139693730174072;
  n139693730174072 -> n139693730474584;
  n139693730174072 -> n139693730475224;
  n139693730474584 -> n139693730471704;
  n139693730475224 -> n139693730471704;
  n139693730475544 -> n139693730365912;
  n139693730471704 -> n139693730367704;
  n139693730367704 -> n139693730489880;
  n139693730365912 -> n139693730489880;
  n139693730174296 -> n139693730489880;
}
'.
[avtokmakov-dev.sas.yp-c.yandex.net] 2021.02.09 14:54:53.303373 [ 15727 ] <Fatal> BaseDaemon: ########################################
[avtokmakov-dev.sas.yp-c.yandex.net] 2021.02.09 14:54:53.303770 [ 15727 ] <Fatal> BaseDaemon: (version 21.3.1.1, build id: 978B4959D61159DF4B0294F201F36881D789CC29) (from thread 15692) (query_id: 293e7e06-d31c-4a7e-af78-5577ee6043ef) Received signal Aborted (6)
[avtokmakov-dev.sas.yp-c.yandex.net] 2021.02.09 14:54:53.304054 [ 15727 ] <Fatal> BaseDaemon: 
[avtokmakov-dev.sas.yp-c.yandex.net] 2021.02.09 14:54:53.304356 [ 15727 ] <Fatal> BaseDaemon: Stack trace: 0x7f0dd158e18b 0x7f0dd156d859 0x86c2686 0x86c2743 0x11f16086 0x11f15391 0x11f2c970 0x11f2c8a6 0x11f2c82d 0x11f2c7f1 0x11f2c732 0x11f2c63c 0x11f2c56d 0x11f2c53d 0x11f2c515 0x11f2c4f0 0x86fe4f9 0x86fd815 0x873e03e 0x8745464 0x87453ed 0x8745345 0x8744d12 0x7f0dd1743609 0x7f0dd166a103
[avtokmakov-dev.sas.yp-c.yandex.net] 2021.02.09 14:54:53.304870 [ 15727 ] <Fatal> BaseDaemon: 4. /build/glibc-YYA7BZ/glibc-2.31/signal/../sysdeps/unix/sysv/linux/raise.c:51: __GI_raise @ 0x4618b in /usr/lib/debug/lib/x86_64-linux-gnu/libc-2.31.so
[avtokmakov-dev.sas.yp-c.yandex.net] 2021.02.09 14:54:53.305205 [ 15727 ] <Fatal> BaseDaemon: 5. /build/glibc-YYA7BZ/glibc-2.31/stdlib/abort.c:81: __GI_abort @ 0x25859 in /usr/lib/debug/lib/x86_64-linux-gnu/libc-2.31.so
[avtokmakov-dev.sas.yp-c.yandex.net] 2021.02.09 14:54:53.305774 [ 15727 ] <Fatal> BaseDaemon: 6. /home/avtokmakov/ch/ClickHouse/build_debug/../src/Common/Exception.cpp:50: DB::handle_error_code(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int) @ 0x86c2686 in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
[avtokmakov-dev.sas.yp-c.yandex.net] 2021.02.09 14:54:53.306322 [ 15727 ] <Fatal> BaseDaemon: 7. /home/avtokmakov/ch/ClickHouse/build_debug/../src/Common/Exception.cpp:57: DB::Exception::Exception(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int, bool) @ 0x86c2743 in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
[avtokmakov-dev.sas.yp-c.yandex.net] 2021.02.09 14:54:53.361183 [ 15727 ] <Fatal> BaseDaemon: 8. /home/avtokmakov/ch/ClickHouse/build_debug/../src/Processors/Executors/PipelineExecutor.cpp:461: DB::PipelineExecutor::finalizeExecution() @ 0x11f16086 in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
[avtokmakov-dev.sas.yp-c.yandex.net] 2021.02.09 14:54:53.412905 [ 15727 ] <Fatal> BaseDaemon: 9. /home/avtokmakov/ch/ClickHouse/build_debug/../src/Processors/Executors/PipelineExecutor.cpp:416: DB::PipelineExecutor::execute(unsigned long) @ 0x11f15391 in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
[avtokmakov-dev.sas.yp-c.yandex.net] 2021.02.09 14:54:53.464001 [ 15727 ] <Fatal> BaseDaemon: 10. /home/avtokmakov/ch/ClickHouse/build_debug/../src/Processors/Executors/PullingAsyncPipelineExecutor.cpp:79: DB::threadFunction(DB::PullingAsyncPipelineExecutor::Data&, std::__1::shared_ptr<DB::ThreadGroupStatus>, unsigned long) @ 0x11f2c970 in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
[avtokmakov-dev.sas.yp-c.yandex.net] 2021.02.09 14:54:53.516198 [ 15727 ] <Fatal> BaseDaemon: 11. /home/avtokmakov/ch/ClickHouse/build_debug/../src/Processors/Executors/PullingAsyncPipelineExecutor.cpp:102: DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0::operator()() const @ 0x11f2c8a6 in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
[avtokmakov-dev.sas.yp-c.yandex.net] 2021.02.09 14:54:53.568085 [ 15727 ] <Fatal> BaseDaemon: 12. /home/avtokmakov/ch/ClickHouse/build_debug/../contrib/libcxx/include/type_traits:3682: decltype(std::__1::forward<DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0&>(fp)()) std::__1::__invoke_constexpr<DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0&>(DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0&) @ 0x11f2c82d in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
[avtokmakov-dev.sas.yp-c.yandex.net] 2021.02.09 14:54:53.619592 [ 15727 ] <Fatal> BaseDaemon: 13. /home/avtokmakov/ch/ClickHouse/build_debug/../contrib/libcxx/include/tuple:1415: decltype(auto) std::__1::__apply_tuple_impl<DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0&, std::__1::tuple<>&>(DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0&, std::__1::tuple<>&, std::__1::__tuple_indices<>) @ 0x11f2c7f1 in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
[avtokmakov-dev.sas.yp-c.yandex.net] 2021.02.09 14:54:53.670825 [ 15727 ] <Fatal> BaseDaemon: 14. /home/avtokmakov/ch/ClickHouse/build_debug/../contrib/libcxx/include/tuple:1424: decltype(auto) std::__1::apply<DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0&, std::__1::tuple<>&>(DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0&, std::__1::tuple<>&) @ 0x11f2c732 in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
[avtokmakov-dev.sas.yp-c.yandex.net] 2021.02.09 14:54:53.722027 [ 15727 ] <Fatal> BaseDaemon: 15. /home/avtokmakov/ch/ClickHouse/build_debug/../src/Common/ThreadPool.h:178: ThreadFromGlobalPool::ThreadFromGlobalPool<DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0>(DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0&&)::'lambda'()::operator()() @ 0x11f2c63c in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
[avtokmakov-dev.sas.yp-c.yandex.net] 2021.02.09 14:54:53.773216 [ 15727 ] <Fatal> BaseDaemon: 16. /home/avtokmakov/ch/ClickHouse/build_debug/../contrib/libcxx/include/type_traits:3676: decltype(std::__1::forward<DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0>(fp)()) std::__1::__invoke<ThreadFromGlobalPool::ThreadFromGlobalPool<DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0>(DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0&&)::'lambda'()&>(DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0&&) @ 0x11f2c56d in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
[avtokmakov-dev.sas.yp-c.yandex.net] 2021.02.09 14:54:53.825010 [ 15727 ] <Fatal> BaseDaemon: 17. /home/avtokmakov/ch/ClickHouse/build_debug/../contrib/libcxx/include/__functional_base:349: void std::__1::__invoke_void_return_wrapper<void>::__call<ThreadFromGlobalPool::ThreadFromGlobalPool<DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0>(DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0&&)::'lambda'()&>(DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0&&...) @ 0x11f2c53d in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
[avtokmakov-dev.sas.yp-c.yandex.net] 2021.02.09 14:54:53.877192 [ 15727 ] <Fatal> BaseDaemon: 18. /home/avtokmakov/ch/ClickHouse/build_debug/../contrib/libcxx/include/functional:1608: std::__1::__function::__default_alloc_func<ThreadFromGlobalPool::ThreadFromGlobalPool<DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0>(DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0&&)::'lambda'(), void ()>::operator()() @ 0x11f2c515 in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
[avtokmakov-dev.sas.yp-c.yandex.net] 2021.02.09 14:54:53.929448 [ 15727 ] <Fatal> BaseDaemon: 19. /home/avtokmakov/ch/ClickHouse/build_debug/../contrib/libcxx/include/functional:2089: void std::__1::__function::__policy_invoker<void ()>::__call_impl<std::__1::__function::__default_alloc_func<ThreadFromGlobalPool::ThreadFromGlobalPool<DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0>(DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0&&)::'lambda'(), void ()> >(std::__1::__function::__policy_storage const*) @ 0x11f2c4f0 in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
[avtokmakov-dev.sas.yp-c.yandex.net] 2021.02.09 14:54:53.930293 [ 15727 ] <Fatal> BaseDaemon: 20. /home/avtokmakov/ch/ClickHouse/build_debug/../contrib/libcxx/include/functional:2221: std::__1::__function::__policy_func<void ()>::operator()() const @ 0x86fe4f9 in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
[avtokmakov-dev.sas.yp-c.yandex.net] 2021.02.09 14:54:53.931261 [ 15727 ] <Fatal> BaseDaemon: 21. /home/avtokmakov/ch/ClickHouse/build_debug/../contrib/libcxx/include/functional:2560: std::__1::function<void ()>::operator()() const @ 0x86fd815 in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
[avtokmakov-dev.sas.yp-c.yandex.net] 2021.02.09 14:54:53.932236 [ 15727 ] <Fatal> BaseDaemon: 22. /home/avtokmakov/ch/ClickHouse/build_debug/../src/Common/ThreadPool.cpp:247: ThreadPoolImpl<std::__1::thread>::worker(std::__1::__list_iterator<std::__1::thread, void*>) @ 0x873e03e in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
[avtokmakov-dev.sas.yp-c.yandex.net] 2021.02.09 14:54:53.933582 [ 15727 ] <Fatal> BaseDaemon: 23. /home/avtokmakov/ch/ClickHouse/build_debug/../src/Common/ThreadPool.cpp:124: void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda1'()::operator()() const @ 0x8745464 in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
[avtokmakov-dev.sas.yp-c.yandex.net] 2021.02.09 14:54:53.935088 [ 15727 ] <Fatal> BaseDaemon: 24. /home/avtokmakov/ch/ClickHouse/build_debug/../contrib/libcxx/include/type_traits:3676: decltype(std::__1::forward<void>(fp)(std::__1::forward<void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda1'()>(fp0)...)) std::__1::__invoke<void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda1'()>(void&&, void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda1'()&&...) @ 0x87453ed in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
[avtokmakov-dev.sas.yp-c.yandex.net] 2021.02.09 14:54:53.936210 [ 15727 ] <Fatal> BaseDaemon: 25. /home/avtokmakov/ch/ClickHouse/build_debug/../contrib/libcxx/include/thread:281: void std::__1::__thread_execute<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda1'()>(std::__1::tuple<void, void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda1'()>&, std::__1::__tuple_indices<>) @ 0x8745345 in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
[avtokmakov-dev.sas.yp-c.yandex.net] 2021.02.09 14:54:53.937593 [ 15727 ] <Fatal> BaseDaemon: 26. /home/avtokmakov/ch/ClickHouse/build_debug/../contrib/libcxx/include/thread:291: void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda1'()> >(void*) @ 0x8744d12 in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
[avtokmakov-dev.sas.yp-c.yandex.net] 2021.02.09 14:54:53.938261 [ 15727 ] <Fatal> BaseDaemon: 27. start_thread @ 0x9609 in /lib/x86_64-linux-gnu/libpthread-2.31.so
[avtokmakov-dev.sas.yp-c.yandex.net] 2021.02.09 14:54:53.939147 [ 15727 ] <Fatal> BaseDaemon: 28. /build/glibc-YYA7BZ/glibc-2.31/misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:97: __clone @ 0x122103 in /usr/lib/debug/lib/x86_64-linux-gnu/libc-2.31.so
[avtokmakov-dev.sas.yp-c.yandex.net] 2021.02.09 14:54:56.063432 [ 15727 ] <Fatal> BaseDaemon: Calculated checksum of the binary: 343AB058AFFB230B19EE37B5D4E5175E. There is no information about the reference checksum.

```
{
    if (!pair.is_finished)
    {
        pair.is_finished = true;
        ++num_finished_pairs;
        if (pair.output_port)
            ++num_finished_outputs;
    }
}
bool DelayedPortsProcessor::processPair(PortsPair & pair)