0. ./contrib/llvm-project/libcxx/include/__exception/exception.h:113: Poco::Exception::Exception(String const&, int) @ 0x000000001ed589f2
1. ./build-release-2/./src/Common/Exception.cpp:129: DB::Exception::Exception(DB::Exception::MessageMasked&&, int, bool) @ 0x00000000106084de
2. DB::Exception::Exception(String&&, int, String, bool) @ 0x000000000948070e
3. DB::Exception::Exception(PreformattedMessage&&, int) @ 0x0000000009480300
4. DB::Exception::Exception<String, String>(int, FormatStringHelperImpl<std::type_identity<String>::type, std::type_identity<String>::type>, String&&, String&&) @ 0x000000000947f8ab
5. ./build-release-2/./src/Interpreters/ActionsVisitor.cpp:890: DB::ActionsMatcher::visit(DB::ASTIdentifier const&, std::shared_ptr<DB::IAST> const&, DB::ActionsMatcher::Data&) @ 0x0000000016108d90
6. ./build-release-2/./src/Interpreters/ActionsVisitor.cpp:1282: DB::ActionsMatcher::visit(DB::ASTFunction const&, std::shared_ptr<DB::IAST> const&, DB::ActionsMatcher::Data&) @ 0x000000001610adcb
7. ./build-release-2/./src/Interpreters/ActionsVisitor.cpp:1282: DB::ActionsMatcher::visit(DB::ASTFunction const&, std::shared_ptr<DB::IAST> const&, DB::ActionsMatcher::Data&) @ 0x000000001610adcb
8. ./build-release-2/./src/Interpreters/ActionsVisitor.cpp:1282: DB::ActionsMatcher::visit(DB::ASTFunction const&, std::shared_ptr<DB::IAST> const&, DB::ActionsMatcher::Data&) @ 0x000000001610adcb
9. ./build-release-2/./src/Interpreters/ActionsVisitor.cpp:0: DB::ActionsMatcher::visit(DB::ASTExpressionList&, std::shared_ptr<DB::IAST> const&, DB::ActionsMatcher::Data&) @ 0x00000000161110c9
10. ./src/Interpreters/InDepthNodeVisitor.h:71: DB::InDepthNodeVisitor<DB::ActionsMatcher, true, false, std::shared_ptr<DB::IAST> const>::doVisit(std::shared_ptr<DB::IAST> const&) @ 0x0000000016100895
11. ./src/Interpreters/InDepthNodeVisitor.h:61: DB::ExpressionAnalyzer::getRootActions(std::shared_ptr<DB::IAST> const&, bool, DB::ActionsDAG&, bool) @ 0x00000000160e7d6d
12. ./build-release-2/./src/Interpreters/ExpressionAnalyzer.cpp:1599: DB::SelectQueryExpressionAnalyzer::appendSelect(DB::ExpressionActionsChain&, bool) @ 0x00000000160f498b
13. ./build-release-2/./src/Interpreters/ExpressionAnalyzer.cpp:2184: DB::ExpressionAnalysisResult::ExpressionAnalysisResult(DB::SelectQueryExpressionAnalyzer&, std::shared_ptr<DB::StorageInMemoryMetadata const> const&, bool, bool, bool, std::shared_ptr<DB::FilterDAGInfo> const&, std::shared_ptr<DB::FilterDAGInfo> const&, DB::Block const&) @ 0x00000000160fa623
14. ./build-release-2/./src/Interpreters/InterpreterSelectQuery.cpp:1188: DB::InterpreterSelectQuery::getSampleBlockImpl() @ 0x0000000016220d96
15. ./build-release-2/./src/Interpreters/InterpreterSelectQuery.cpp:928: DB::InterpreterSelectQuery::InterpreterSelectQuery(std::shared_ptr<DB::IAST> const&, std::shared_ptr<DB::Context> const&, std::optional<DB::Pipe>, std::shared_ptr<DB::IStorage> const&, DB::SelectQueryOptions const&, std::vector<String, std::allocator<String>> const&, std::shared_ptr<DB::StorageInMemoryMetadata const> const&, std::shared_ptr<DB::PreparedSets>)::$_0::operator()(bool) const @ 0x0000000016217bec
16. ./build-release-2/./src/Interpreters/InterpreterSelectQuery.cpp:938: DB::InterpreterSelectQuery::InterpreterSelectQuery(std::shared_ptr<DB::IAST> const&, std::shared_ptr<DB::Context> const&, std::optional<DB::Pipe>, std::shared_ptr<DB::IStorage> const&, DB::SelectQueryOptions const&, std::vector<String, std::allocator<String>> const&, std::shared_ptr<DB::StorageInMemoryMetadata const> const&, std::shared_ptr<DB::PreparedSets>) @ 0x00000000162124a4
17. ./build-release-2/./src/Interpreters/InterpreterSelectQuery.cpp:321: DB::InterpreterSelectQuery::InterpreterSelectQuery(std::shared_ptr<DB::IAST> const&, std::shared_ptr<DB::Context> const&, DB::SelectQueryOptions const&, std::vector<String, std::allocator<String>> const&) @ 0x000000001620eb51
18. ./contrib/llvm-project/libcxx/include/__memory/unique_ptr.h:634: DB::InterpreterSelectWithUnionQuery::buildCurrentChildInterpreter(std::shared_ptr<DB::IAST> const&, std::vector<String, std::allocator<String>> const&) @ 0x0000000016244512
19. ./build-release-2/./src/Interpreters/InterpreterSelectWithUnionQuery.cpp:167: DB::InterpreterSelectWithUnionQuery::InterpreterSelectWithUnionQuery(std::shared_ptr<DB::IAST> const&, std::shared_ptr<DB::Context>, DB::SelectQueryOptions const&, std::vector<String, std::allocator<String>> const&) @ 0x0000000016243191
20. ./contrib/llvm-project/libcxx/include/__memory/unique_ptr.h:634: std::unique_ptr<DB::IInterpreter, std::default_delete<DB::IInterpreter>> std::__function::__policy_invoker<std::unique_ptr<DB::IInterpreter, std::default_delete<DB::IInterpreter>> (DB::InterpreterFactory::Arguments const&)>::__call_impl[abi:ne190107]<std::__function::__default_alloc_func<DB::registerInterpreterSelectWithUnionQuery(DB::InterpreterFactory&)::$_0, std::unique_ptr<DB::IInterpreter, std::default_delete<DB::IInterpreter>> (DB::InterpreterFactory::Arguments const&)>>(std::__function::__policy_storage const*, DB::InterpreterFactory::Arguments const&) @ 0x0000000016246a57
21. ./contrib/llvm-project/libcxx/include/__functional/function.h:716: ? @ 0x00000000161c54a9
22. ./build-release-2/./src/Interpreters/executeQuery.cpp:1534: DB::executeQueryImpl(char const*, char const*, std::shared_ptr<DB::Context>, DB::QueryFlags, DB::QueryProcessingStage::Enum, std::unique_ptr<DB::ReadBuffer, std::default_delete<DB::ReadBuffer>>&, std::shared_ptr<DB::IAST>&, std::shared_ptr<DB::ImplicitTransactionControlExecutor>, std::function<void ()>) @ 0x00000000165a891b
23. ./build-release-2/./src/Interpreters/executeQuery.cpp:1812: DB::executeQuery(String const&, std::shared_ptr<DB::Context>, DB::QueryFlags, DB::QueryProcessingStage::Enum) @ 0x00000000165a4712
24. ./build-release-2/./src/Server/TCPHandler.cpp:745: DB::TCPHandler::runImpl() @ 0x0000000019b461ef
25. ./build-release-2/./src/Server/TCPHandler.cpp:2843: DB::TCPHandler::run() @ 0x0000000019b63a16
26. ./build-release-2/./base/poco/Net/src/TCPServerConnection.cpp:40: Poco::Net::TCPServerConnection::start() @ 0x000000001ee13bc7
27. ./build-release-2/./base/poco/Net/src/TCPServerDispatcher.cpp:115: Poco::Net::TCPServerDispatcher::run() @ 0x000000001ee1417e
28. ./build-release-2/./base/poco/Foundation/src/ThreadPool.cpp:205: Poco::PooledThread::run() @ 0x000000001edb333f
29. ./base/poco/Foundation/src/Thread_POSIX.cpp:341: Poco::ThreadImpl::runnableEntry(void*) @ 0x000000001edb094f
30. start_thread @ 0x000000000009caa4
31. clone3 @ 0x0000000000129c6c
Repro
Stack trace
Information
Happens after #87958 was merged. Removing the following if statement seems to fix the issue:
ClickHouse/src/Interpreters/TreeOptimizer.cpp
Lines 136 to 140 in a10d260