```
:) CREATE LIVE VIEW lv AS SELECT * FROM numbers(100);

CREATE LIVE VIEW lv AS
SELECT *
FROM numbers(100)

Query id: 6afc2ecd-def7-41c6-8492-2e4eef974908

[avtokmakov-dev.sas.yp-c.yandex.net] 2020.12.29 20:38:56.105766 [ 51297 ] {6afc2ecd-def7-41c6-8492-2e4eef974908} <Fatal> : Logical error: 'Logical error while creating StorageLiveView. Could not retrieve table name from select query.'.
[avtokmakov-dev.sas.yp-c.yandex.net] 2020.12.29 20:38:56.107324 [ 51591 ] <Fatal> BaseDaemon: ########################################
[avtokmakov-dev.sas.yp-c.yandex.net] 2020.12.29 20:38:56.107791 [ 51591 ] <Fatal> BaseDaemon: (version 20.13.1.1, build id: 7D0ED74E319A6E236FD247F80BA2A791980291D0) (from thread 51297) (query_id: 6afc2ecd-def7-41c6-8492-2e4eef974908) Received signal Aborted (6)
[avtokmakov-dev.sas.yp-c.yandex.net] 2020.12.29 20:38:56.108185 [ 51591 ] <Fatal> BaseDaemon: 
[avtokmakov-dev.sas.yp-c.yandex.net] 2020.12.29 20:38:56.108633 [ 51591 ] <Fatal> BaseDaemon: Stack trace: 0x7ff726fe818b 0x7ff726fc7859 0x89356dc 0x8935781 0x12363cae 0x12363609 0x1237f1f1 0x1236b215 0x1236b0db 0x1236b02b 0x1236afcb 0x1236a11d 0x11e58f9b 0x11e560c6 0x11e50180 0x119e89d7 0x119e72aa 0x119e9f05 0x11c514fe 0x11c4fdfa 0x1246574b 0x12470c68 0x16859d7c 0x1685a580 0x1698b6c3 0x169885ed 0x16987478 0x7ff7271a3609
[avtokmakov-dev.sas.yp-c.yandex.net] 2020.12.29 20:38:56.109234 [ 51591 ] <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] 2020.12.29 20:38:56.109595 [ 51591 ] <Fatal> BaseDaemon: 5. /build/glibc-YYA7BZ/glibc-2.31/stdlib/abort.c:81: abort @ 0x25859 in /usr/lib/debug/lib/x86_64-linux-gnu/libc-2.31.so
[avtokmakov-dev.sas.yp-c.yandex.net] 2020.12.29 20:38:56.110232 [ 51591 ] <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) @ 0x89356dc in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
[avtokmakov-dev.sas.yp-c.yandex.net] 2020.12.29 20:38:56.110860 [ 51591 ] <Fatal> BaseDaemon: 7. /home/avtokmakov/ch/ClickHouse/build_debug/../src/Common/Exception.cpp:56: DB::Exception::Exception(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int) @ 0x8935781 in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
[avtokmakov-dev.sas.yp-c.yandex.net] 2020.12.29 20:38:56.154576 [ 51591 ] <Fatal> BaseDaemon: 8. /home/avtokmakov/ch/ClickHouse/build_debug/../src/Storages/LiveView/StorageLiveView.cpp:83: DB::extractDependentTable(std::__1::shared_ptr<DB::IAST>&, DB::Context&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::shared_ptr<DB::IAST>&) @ 0x12363cae in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
[avtokmakov-dev.sas.yp-c.yandex.net] 2020.12.29 20:38:56.198802 [ 51591 ] <Fatal> BaseDaemon: 9. /home/avtokmakov/ch/ClickHouse/build_debug/../src/Storages/LiveView/StorageLiveView.cpp:271: DB::StorageLiveView::StorageLiveView(DB::StorageID const&, DB::Context&, DB::ASTCreateQuery const&, DB::ColumnsDescription const&) @ 0x12363609 in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
[avtokmakov-dev.sas.yp-c.yandex.net] 2020.12.29 20:38:56.245953 [ 51591 ] <Fatal> BaseDaemon: 10. /home/avtokmakov/ch/ClickHouse/build_debug/../base/common/../ext/shared_ptr_helper.h:19: std::__1::shared_ptr<DB::StorageLiveView> ext::shared_ptr_helper<DB::StorageLiveView>::create<DB::StorageID const&, DB::Context&, DB::ASTCreateQuery const&, DB::ColumnsDescription const&>(DB::StorageID const&, DB::Context&, DB::ASTCreateQuery const&, DB::ColumnsDescription const&) @ 0x1237f1f1 in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
[avtokmakov-dev.sas.yp-c.yandex.net] 2020.12.29 20:38:56.289911 [ 51591 ] <Fatal> BaseDaemon: 11. /home/avtokmakov/ch/ClickHouse/build_debug/../src/Storages/LiveView/StorageLiveView.cpp:524: DB::registerStorageLiveView(DB::StorageFactory&)::$_2::operator()(DB::StorageFactory::Arguments const&) const @ 0x1236b215 in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
[avtokmakov-dev.sas.yp-c.yandex.net] 2020.12.29 20:38:56.334505 [ 51591 ] <Fatal> BaseDaemon: 12. /home/avtokmakov/ch/ClickHouse/build_debug/../contrib/libcxx/include/type_traits:3519: decltype(std::__1::forward<DB::registerStorageLiveView(DB::StorageFactory&)::$_2&>(fp)(std::__1::forward<DB::StorageFactory::Arguments const&>(fp0))) std::__1::__invoke<DB::registerStorageLiveView(DB::StorageFactory&)::$_2&, DB::StorageFactory::Arguments const&>(DB::registerStorageLiveView(DB::StorageFactory&)::$_2&, DB::StorageFactory::Arguments const&) @ 0x1236b0db in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
[avtokmakov-dev.sas.yp-c.yandex.net] 2020.12.29 20:38:56.378854 [ 51591 ] <Fatal> BaseDaemon: 13. /home/avtokmakov/ch/ClickHouse/build_debug/../contrib/libcxx/include/__functional_base:317: std::__1::shared_ptr<DB::IStorage> std::__1::__invoke_void_return_wrapper<std::__1::shared_ptr<DB::IStorage> >::__call<DB::registerStorageLiveView(DB::StorageFactory&)::$_2&, DB::StorageFactory::Arguments const&>(DB::registerStorageLiveView(DB::StorageFactory&)::$_2&, DB::StorageFactory::Arguments const&) @ 0x1236b02b in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
[avtokmakov-dev.sas.yp-c.yandex.net] 2020.12.29 20:38:56.422729 [ 51591 ] <Fatal> BaseDaemon: 14. /home/avtokmakov/ch/ClickHouse/build_debug/../contrib/libcxx/include/functional:1540: std::__1::__function::__alloc_func<DB::registerStorageLiveView(DB::StorageFactory&)::$_2, std::__1::allocator<DB::registerStorageLiveView(DB::StorageFactory&)::$_2>, std::__1::shared_ptr<DB::IStorage> (DB::StorageFactory::Arguments const&)>::operator()(DB::StorageFactory::Arguments const&) @ 0x1236afcb in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
[avtokmakov-dev.sas.yp-c.yandex.net] 2020.12.29 20:38:56.466060 [ 51591 ] <Fatal> BaseDaemon: 15. /home/avtokmakov/ch/ClickHouse/build_debug/../contrib/libcxx/include/functional:1714: std::__1::__function::__func<DB::registerStorageLiveView(DB::StorageFactory&)::$_2, std::__1::allocator<DB::registerStorageLiveView(DB::StorageFactory&)::$_2>, std::__1::shared_ptr<DB::IStorage> (DB::StorageFactory::Arguments const&)>::operator()(DB::StorageFactory::Arguments const&) @ 0x1236a11d in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
[avtokmakov-dev.sas.yp-c.yandex.net] 2020.12.29 20:38:56.507667 [ 51591 ] <Fatal> BaseDaemon: 16. /home/avtokmakov/ch/ClickHouse/build_debug/../contrib/libcxx/include/functional:1867: std::__1::__function::__value_func<std::__1::shared_ptr<DB::IStorage> (DB::StorageFactory::Arguments const&)>::operator()(DB::StorageFactory::Arguments const&) const @ 0x11e58f9b in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
[avtokmakov-dev.sas.yp-c.yandex.net] 2020.12.29 20:38:56.548789 [ 51591 ] <Fatal> BaseDaemon: 17. /home/avtokmakov/ch/ClickHouse/build_debug/../contrib/libcxx/include/functional:2473: std::__1::function<std::__1::shared_ptr<DB::IStorage> (DB::StorageFactory::Arguments const&)>::operator()(DB::StorageFactory::Arguments const&) const @ 0x11e560c6 in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
[avtokmakov-dev.sas.yp-c.yandex.net] 2020.12.29 20:38:56.589117 [ 51591 ] <Fatal> BaseDaemon: 18. /home/avtokmakov/ch/ClickHouse/build_debug/../src/Storages/StorageFactory.cpp:183: DB::StorageFactory::get(DB::ASTCreateQuery const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, DB::Context&, DB::Context&, DB::ColumnsDescription const&, DB::ConstraintsDescription const&, bool) const @ 0x11e50180 in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
[avtokmakov-dev.sas.yp-c.yandex.net] 2020.12.29 20:38:56.626377 [ 51591 ] <Fatal> BaseDaemon: 19. /home/avtokmakov/ch/ClickHouse/build_debug/../src/Interpreters/InterpreterCreateQuery.cpp:926: DB::InterpreterCreateQuery::doCreateTable(DB::ASTCreateQuery&, DB::InterpreterCreateQuery::TableProperties const&) @ 0x119e89d7 in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
[avtokmakov-dev.sas.yp-c.yandex.net] 2020.12.29 20:38:56.662902 [ 51591 ] <Fatal> BaseDaemon: 20. /home/avtokmakov/ch/ClickHouse/build_debug/../src/Interpreters/InterpreterCreateQuery.cpp:842: DB::InterpreterCreateQuery::createTable(DB::ASTCreateQuery&) @ 0x119e72aa in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
[avtokmakov-dev.sas.yp-c.yandex.net] 2020.12.29 20:38:56.700182 [ 51591 ] <Fatal> BaseDaemon: 21. /home/avtokmakov/ch/ClickHouse/build_debug/../src/Interpreters/InterpreterCreateQuery.cpp:1135: DB::InterpreterCreateQuery::execute() @ 0x119e9f05 in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
[avtokmakov-dev.sas.yp-c.yandex.net] 2020.12.29 20:38:56.739710 [ 51591 ] <Fatal> BaseDaemon: 22. /home/avtokmakov/ch/ClickHouse/build_debug/../src/Interpreters/executeQuery.cpp:525: DB::executeQueryImpl(char const*, char const*, DB::Context&, bool, DB::QueryProcessingStage::Enum, bool, DB::ReadBuffer*) @ 0x11c514fe in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
[avtokmakov-dev.sas.yp-c.yandex.net] 2020.12.29 20:38:56.778981 [ 51591 ] <Fatal> BaseDaemon: 23. /home/avtokmakov/ch/ClickHouse/build_debug/../src/Interpreters/executeQuery.cpp:868: DB::executeQuery(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, DB::Context&, bool, DB::QueryProcessingStage::Enum, bool) @ 0x11c4fdfa in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
[avtokmakov-dev.sas.yp-c.yandex.net] 2020.12.29 20:38:56.823330 [ 51591 ] <Fatal> BaseDaemon: 24. /home/avtokmakov/ch/ClickHouse/build_debug/../src/Server/TCPHandler.cpp:260: DB::TCPHandler::runImpl() @ 0x1246574b in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
[avtokmakov-dev.sas.yp-c.yandex.net] 2020.12.29 20:38:56.867777 [ 51591 ] <Fatal> BaseDaemon: 25. /home/avtokmakov/ch/ClickHouse/build_debug/../src/Server/TCPHandler.cpp:1414: DB::TCPHandler::run() @ 0x12470c68 in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
[avtokmakov-dev.sas.yp-c.yandex.net] 2020.12.29 20:38:56.925702 [ 51591 ] <Fatal> BaseDaemon: 26. /home/avtokmakov/ch/ClickHouse/build_debug/../contrib/poco/Net/src/TCPServerConnection.cpp:43: Poco::Net::TCPServerConnection::start() @ 0x16859d7c in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
[avtokmakov-dev.sas.yp-c.yandex.net] 2020.12.29 20:38:56.983639 [ 51591 ] <Fatal> BaseDaemon: 27. /home/avtokmakov/ch/ClickHouse/build_debug/../contrib/poco/Net/src/TCPServerDispatcher.cpp:112: Poco::Net::TCPServerDispatcher::run() @ 0x1685a580 in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
[avtokmakov-dev.sas.yp-c.yandex.net] 2020.12.29 20:38:57.042263 [ 51591 ] <Fatal> BaseDaemon: 28. /home/avtokmakov/ch/ClickHouse/build_debug/../contrib/poco/Foundation/src/ThreadPool.cpp:199: Poco::PooledThread::run() @ 0x1698b6c3 in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
[avtokmakov-dev.sas.yp-c.yandex.net] 2020.12.29 20:38:57.099651 [ 51591 ] <Fatal> BaseDaemon: 29. /home/avtokmakov/ch/ClickHouse/build_debug/../contrib/poco/Foundation/src/Thread.cpp:56: Poco::(anonymous namespace)::RunnableHolder::run() @ 0x169885ed in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
[avtokmakov-dev.sas.yp-c.yandex.net] 2020.12.29 20:38:57.157147 [ 51591 ] <Fatal> BaseDaemon: 30. /home/avtokmakov/ch/ClickHouse/build_debug/../contrib/poco/Foundation/src/Thread_POSIX.cpp:345: Poco::ThreadImpl::runnableEntry(void*) @ 0x16987478 in /home/avtokmakov/ch/ClickHouse/build_debug/programs/clickhouse
[avtokmakov-dev.sas.yp-c.yandex.net] 2020.12.29 20:38:57.157929 [ 51591 ] <Fatal> BaseDaemon: 31. start_thread @ 0x9609 in /lib/x86_64-linux-gnu/libpthread-2.31.so

```

cc: @vzakaznikov
const Names & ,
    const StorageMetadataPtr & ,
    SelectQueryInfo & ,
    ContextPtr ,
    QueryProcessingStage::Enum ,
    const size_t ,
    const unsigned )
{
    std::lock_guard lock(mutex);
    if (!(*blocks_ptr))
        refresh(false);
    else if (is_periodically_refreshed)
    {
        Seconds current_time = std::chrono::duration_cast<Seconds>(std::chrono::system_clock::now().time_since_epoch());
        Seconds blocks_time = std::chrono::duration_cast<Seconds>(getBlocksTime().time_since_epoch());
        if ((current_time - periodic_live_view_refresh) >= blocks_time)
            refresh(false);
    }
    return Pipe(std::make_shared<BlocksSource>(blocks_ptr, getHeader()));
}
BlockInputStreams StorageLiveView::watch(