Skip to content

Logical error: Bad cast from type A to B (STID: 1635-3e67) #93675

@maxknv

Description

@maxknv

Important: This issue was automatically generated and is used by CI for matching failures. DO NOT modify the body content. DO NOT remove labels.

Test name: Logical error: Bad cast from type A to B (STID: 1635-3e67)
CI report: BuzzHouse (amd_msan)
Failing test history: cidb

Test output:

Error:
Logical error: 'Bad cast from type DB::IdentifierNode to DB::ColumnNode'.
---

Failed query:
SELECT [1], ['哪国人' + `t1d0`.`c3`, `t0d0`.`c1` / `t1d0`.`c1`, replaceRegexpAll(`t0d0`.`c1`, `t0d0`.`c0`, 87::Int128), (`p0`, `p1`) -> `p1`, (`t0d0`.`c1` AS `a1`), toModifiedJulianDayOrNull(`a1`), f0(`a1`)], `a1` FROM (SELECT `c0`, `c1` FROM (SELECT `t1d1`.`c0.null`, '{}'::JSON FROM d2.`d60` AS t0d1 GLOBAL CROSS JOIN d0.`d41` AS t1d1)(c0, c1)) AS t0d0 GLOBAL LEFT JOIN VALUES ((f1(91::Int256, 0.269), toRelativeMinuteNum(addSeconds(now(), 0)::Time64), [(toDecimal128('8753662285577106.581003423064', 17) AS `a0`), `a0`])) AS t1d0 USING (`c3`) INTO OUTFILE '/var/lib/clickhouse/user_files/file.data' TRUNCATE FORMAT Null;
---

Stack trace:
__GI___pthread_kill @ 0x00000000000969fd
raise @ 0x0000000000042476
__lgamma_r_finite@GLIBC_2.15 @ 0x00000000000287f3
src/Common/Exception.cpp:57: DB::abortOnFailedAssertion(String const&, std::basic_string_view<char, std::char_traits<char>>, void* const*, unsigned long, unsigned long) @ 0x000000002e6d9ae1
src/Common/Exception.cpp:90: DB::handle_error_code(String const&, std::basic_string_view<char, std::char_traits<char>>, int, bool, std::vector<void*, std::allocator<void*>> const&) @ 0x000000002e6dbc4a
src/Common/Exception.cpp:143: DB::Exception::Exception(DB::Exception::MessageMasked&&, int, bool) @ 0x000000002e6dc5de
./src/Common/Exception.h:172: DB::Exception::Exception(String&&, int, String, bool) @ 0x000000000a9ef76e
./src/Common/Exception.h:58: DB::Exception::Exception(PreformattedMessage&&, int) @ 0x000000000a9ee0cd
./src/Common/Exception.h:190: DB::Exception::Exception<String, String>(int, FormatStringHelperImpl<std::type_identity<String>::type, std::type_identity<String>::type>, String&&, String&&) @ 0x000000000a9ec34d
inlined from ./src/Common/typeid_cast.h:31: T typeid_cast<DB::ColumnNode&, DB::IQueryTreeNode>(DB::IQueryTreeNode&)
inlined from ./src/Common/TypePromotion.h:31: DB::TypePromotion<DB::IQueryTreeNode>::CastHelper<DB::ColumnNode&, false, true>::value(DB::IQueryTreeNode*)
inlined from ./src/Common/TypePromotion.h:57: std::__invoke_result_impl<void, decltype(&CastHelper<DB::ColumnNode&, false>::value), DB::TypePromotion<DB::IQueryTreeNode>::CastHelper<DB::ColumnNode&, false, std::is_reference_v<DB::ColumnNode&>>, DB::IQueryTreeNode*>::type DB::TypePromotion<DB::IQueryTreeNode>::as<DB::ColumnNode&>()
src/Analyzer/Resolve/QueryAnalyzer.cpp:1620: DB::QueryAnalyzer::updateMatchedColumnsFromJoinUsing(std::vector<std::pair<std::shared_ptr<DB::IQueryTreeNode>, String>, std::allocator<std::pair<std::shared_ptr<DB::IQueryTreeNode>, String>>>&, DB::IdentifierResolveScope&) @ 0x0000000042f0c5fe
src/Analyzer/Resolve/QueryAnalyzer.cpp:2012: DB::QueryAnalyzer::resolveUnqualifiedMatcher(std::shared_ptr<DB::IQueryTreeNode>&, DB::IdentifierResolveScope&) @ 0x0000000042f17cfe
src/Analyzer/Resolve/QueryAnalyzer.cpp:2044: DB::QueryAnalyzer::resolveMatcher(std::shared_ptr<DB::IQueryTreeNode>&, DB::IdentifierResolveScope&) @ 0x0000000042f1e0e9
src/Analyzer/Resolve/QueryAnalyzer.cpp:2855: DB::QueryAnalyzer::resolveExpressionNode(std::shared_ptr<DB::IQueryTreeNode>&, DB::IdentifierResolveScope&, bool, bool, bool) @ 0x0000000042ec805a
src/Analyzer/Resolve/QueryAnalyzer.cpp:2652: DB::QueryAnalyzer::resolveLambda(std::shared_ptr<DB::IQueryTreeNode> const&, std::shared_ptr<DB::IQueryTreeNode> const&, std::vector<std::shared_ptr<DB::IQueryTreeNode>, std::allocator<std::shared_ptr<DB::IQueryTreeNode>>> const&, DB::IdentifierResolveScope&) @ 0x0000000042f2f629
src/Analyzer/Resolve/resolveFunction.cpp:1047: DB::QueryAnalyzer::resolveFunction(std::shared_ptr<DB::IQueryTreeNode>&, DB::IdentifierResolveScope&) @ 0x0000000043d45d59
src/Analyzer/Resolve/QueryAnalyzer.cpp:2895: DB::QueryAnalyzer::resolveExpressionNode(std::shared_ptr<DB::IQueryTreeNode>&, DB::IdentifierResolveScope&, bool, bool, bool) @ 0x0000000042ec7692
src/Analyzer/Resolve/QueryAnalyzer.cpp:3046: DB::QueryAnalyzer::resolveExpressionNodeList(std::shared_ptr<DB::IQueryTreeNode>&, DB::IdentifierResolveScope&, bool, bool) @ 0x0000000042ec3db9
src/Analyzer/Resolve/resolveFunction.cpp:673: DB::QueryAnalyzer::resolveFunction(std::shared_ptr<DB::IQueryTreeNode>&, DB::IdentifierResolveScope&) @ 0x0000000043d3d77e
src/Analyzer/Resolve/QueryAnalyzer.cpp:2895: DB::QueryAnalyzer::resolveExpressionNode(std::shared_ptr<DB::IQueryTreeNode>&, DB::IdentifierResolveScope&, bool, bool, bool) @ 0x0000000042ec7692
src/Analyzer/Resolve/QueryAnalyzer.cpp:3917: DB::QueryAnalyzer::resolveTableFunction(std::shared_ptr<DB::IQueryTreeNode>&, DB::IdentifierResolveScope&, DB::QueryExpressionsAliasVisitor&, bool) @ 0x0000000042ed1459
src/Analyzer/Resolve/QueryAnalyzer.cpp:4590: DB::QueryAnalyzer::resolveQueryJoinTreeNode(std::shared_ptr<DB::IQueryTreeNode>&, DB::IdentifierResolveScope&, DB::QueryExpressionsAliasVisitor&) @ 0x0000000042f4d0e6
src/Analyzer/Resolve/QueryAnalyzer.cpp:4343: DB::QueryAnalyzer::resolveJoin(std::shared_ptr<DB::IQueryTreeNode>&, DB::IdentifierResolveScope&, DB::QueryExpressionsAliasVisitor&) @ 0x0000000042f53541
src/Analyzer/Resolve/QueryAnalyzer.cpp:4609: DB::QueryAnalyzer::resolveQueryJoinTreeNode(std::shared_ptr<DB::IQueryTreeNode>&, DB::IdentifierResolveScope&, DB::QueryExpressionsAliasVisitor&) @ 0x0000000042f4d0fe
src/Analyzer/Resolve/QueryAnalyzer.cpp:4854: DB::QueryAnalyzer::resolveQuery(std::shared_ptr<DB::IQueryTreeNode> const&, DB::IdentifierResolveScope&) @ 0x0000000042eae185
src/Analyzer/Resolve/QueryAnalyzer.cpp:138: DB::QueryAnalyzer::resolve(std::shared_ptr<DB::IQueryTreeNode>&, std::shared_ptr<DB::IQueryTreeNode> const&, std::shared_ptr<DB::Context const>) @ 0x0000000042ea9f41
src/Analyzer/Resolve/QueryAnalysisPass.cpp:18: DB::QueryAnalysisPass::run(std::shared_ptr<DB::IQueryTreeNode>&, std::shared_ptr<DB::Context const>) @ 0x0000000042ea8319
src/Analyzer/QueryTreePassManager.cpp:194: DB::QueryTreePassManager::run(std::shared_ptr<DB::IQueryTreeNode>&) @ 0x000000004302606f
src/Interpreters/InterpreterSelectQueryAnalyzer.cpp:170: DB::buildQueryTreeAndRunPasses(std::shared_ptr<DB::IAST> const&, DB::SelectQueryOptions const&, std::shared_ptr<DB::Context const> const&, std::shared_ptr<DB::IStorage> const&) @ 0x0000000046457fd2
src/Interpreters/InterpreterSelectQueryAnalyzer.cpp:184: DB::InterpreterSelectQueryAnalyzer::InterpreterSelectQueryAnalyzer(std::shared_ptr<DB::IAST> const&, std::shared_ptr<DB::Context const> const&, DB::SelectQueryOptions const&, std::vector<String, std::allocator<String>> const&) @ 0x000000004645087e
./contrib/llvm-project/libcxx/include/__memory/unique_ptr.h:759: std::unique_ptr<DB::InterpreterSelectQueryAnalyzer, std::default_delete<DB::InterpreterSelectQueryAnalyzer>> std::make_unique[abi:ne210105]<DB::InterpreterSelectQueryAnalyzer, std::shared_ptr<DB::IAST>&, std::shared_ptr<DB::Context> const&, DB::SelectQueryOptions const&, 0>(std::shared_ptr<DB::IAST>&, std::shared_ptr<DB::Context> const&, DB::SelectQueryOptions const&) @ 0x0000000046467cbf
src/Interpreters/InterpreterSelectQueryAnalyzer.cpp:393: operator()
inlined from ./contrib/llvm-project/libcxx/include/__type_traits/invoke.h:87: std::__invoke_result_impl<void, DB::registerInterpreterSelectQueryAnalyzer(DB::InterpreterFactory&)::$_0&, DB::InterpreterFactory::Arguments const&>::type std::__invoke[abi:ne210105]<DB::registerInterpreterSelectQueryAnalyzer(DB::InterpreterFactory&)::$_0&, DB::InterpreterFactory::Arguments const&>(DB::registerInterpreterSelectQueryAnalyzer(DB::InterpreterFactory&)::$_0&, DB::InterpreterFactory::Arguments const&)
inlined from ./contrib/llvm-project/libcxx/include/__type_traits/invoke.h:334: std::unique_ptr<DB::IInterpreter, std::default_delete<DB::IInterpreter>> std::__invoke_void_return_wrapper<std::unique_ptr<DB::IInterpreter, std::default_delete<DB::IInterpreter>>, false>::__call[abi:ne210105]<DB::registerInterpreterSelectQueryAnalyzer(DB::InterpreterFactory&)::$_0&, DB::InterpreterFactory::Arguments const&>(DB::registerInterpreterSelectQueryAnalyzer(DB::InterpreterFactory&)::$_0&, DB::InterpreterFactory::Arguments const&)
inlined from ./contrib/llvm-project/libcxx/include/__type_traits/invoke.h:348: std::unique_ptr<DB::IInterpreter, std::default_delete<DB::IInterpreter>> std::__invoke_r[abi:ne210105]<std::unique_ptr<DB::IInterpreter, std::default_delete<DB::IInterpreter>>, DB::registerInterpreterSelectQueryAnalyzer(DB::InterpreterFactory&)::$_0&, DB::InterpreterFactory::Arguments const&>(DB::registerInterpreterSelectQueryAnalyzer(DB::InterpreterFactory&)::$_0&, DB::InterpreterFactory::Arguments const&)
./contrib/llvm-project/libcxx/include/__functional/function.h:450: ? @ 0x0000000046467793
inlined from ./contrib/llvm-project/libcxx/include/__functional/function.h:508: ?
inlined from ./contrib/llvm-project/libcxx/include/__functional/function.h:772: ?
src/Interpreters/InterpreterFactory.cpp:408: DB::InterpreterFactory::get(std::shared_ptr<DB::IAST>&, std::shared_ptr<DB::Context>, DB::SelectQueryOptions const&) @ 0x0000000046337965
src/Interpreters/executeQuery.cpp:1677: 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 ()>, DB::QueryResultDetails&) @ 0x000000004712dd59
src/Interpreters/executeQuery.cpp:1962: DB::executeQuery(String const&, std::shared_ptr<DB::Context>, DB::QueryFlags, DB::QueryProcessingStage::Enum) @ 0x000000004711d9d7
src/Server/TCPHandler.cpp:774: DB::TCPHandler::runImpl() @ 0x00000000564c3375
src/Server/TCPHandler.cpp:2867: DB::TCPHandler::run() @ 0x0000000056538844
base/poco/Net/src/TCPServerConnection.cpp:40: Poco::Net::TCPServerConnection::start() @ 0x00000000641b50e0
base/poco/Net/src/TCPServerDispatcher.cpp:115: Poco::Net::TCPServerDispatcher::run() @ 0x00000000641b613d
base/poco/Foundation/src/ThreadPool.cpp:205: Poco::PooledThread::run() @ 0x0000000064058e35
./base/poco/Foundation/src/Thread_POSIX.cpp:341: Poco::ThreadImpl::runnableEntry(void*) @ 0x0000000064051cd1
start_thread @ 0x0000000000094ac3

Metadata

Metadata

Assignees

Labels

analyzerIssues and pull-requests related to new analyzerfuzzProblem found by one of the fuzzerstestingSpecial issue with list of bugs found by CI

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions