Skip to content

Logical error: Column identifier A is already registered (STID: 4697-4326) #99931

@PedroTadim

Description

@PedroTadim

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: Column identifier A is already registered (STID: 4697-4326)
CI report: AST fuzzer (amd_debug)
Failing test history: cidb

Test output:

Error:
Logical error: 'Column identifier a is already registered'.
---

Failed query:
SELECT toInt128(-2), * FROM (SELECT DISTINCT materialize(7), 256 + x AS a FROM table_1 LIMIT 1048577) SETTINGS additional_result_filter = 'a != 3') EXCEPT DISTINCT (SELECT toInt128(toNullable(-2)), * FROM (SELECT DISTINCT materialize(7), 256 + x AS a FROM table_1) SETTINGS additional_result_filter = 'a != 3')
---

Stack trace:
pthread_kill@@GLIBC_2.34 @ 0x00000000000969fd
__GI_raise @ 0x0000000000042476
__lgamma_r_finite @ 0x00000000000287f3
/ClickHouse/src/Common/Exception.cpp:60:5: DB::abortOnFailedAssertion(String const&, std::basic_string_view<char, std::char_traits<char>>, void* const*, unsigned long, unsigned long) @ 0x00000000162152dd
/ClickHouse/src/Common/Exception.cpp:93:13: DB::handle_error_code(String const&, std::basic_string_view<char, std::char_traits<char>>, int, bool, std::vector<void*, std::allocator<void*>> const&) @ 0x00000000162166cd
/ClickHouse/src/Common/Exception.cpp:146:19: DB::Exception::Exception(DB::Exception::MessageMasked&&, int, bool) @ 0x00000000162169b9
/ClickHouse/src/Common/Exception.h:171:100: DB::Exception::Exception(String&&, int, String, bool) @ 0x000000000e267f54
/ClickHouse/src/Common/Exception.h:57:54: DB::Exception::Exception(PreformattedMessage&&, int) @ 0x000000000e267a51
/ClickHouse/src/Common/Exception.h:189:77: DB::Exception::Exception<String&>(int, FormatStringHelperImpl<std::type_identity<String&>::type>, String&) @ 0x000000000e28f143
/ClickHouse/src/Planner/PlannerContext.cpp:39:15: DB::GlobalPlannerContext::createColumnIdentifier(DB::NameAndTypePair const&, std::shared_ptr<DB::IQueryTreeNode> const&) @ 0x000000001b9af02e
/ClickHouse/src/Planner/PlannerContext.cpp:24:12: DB::GlobalPlannerContext::createColumnIdentifier(std::shared_ptr<DB::IQueryTreeNode> const&) @ 0x000000001b9aed17
inlined from /ClickHouse/src/Planner/CollectTableExpressionData.cpp:153: DB::(anonymous namespace)::CollectSourceColumnsVisitor::enterImpl(std::shared_ptr<DB::IQueryTreeNode>&)
/ClickHouse/src/Analyzer/InDepthQueryTreeVisitor.h:153:78: DB::InDepthQueryTreeVisitorWithContext<DB::(anonymous namespace)::CollectSourceColumnsVisitor>::visit(std::shared_ptr<DB::IQueryTreeNode>&) @ 0x000000001bca6dc4
inlined from /ClickHouse/contrib/llvm-project/libcxx/include/__vector/vector.h:0: DB::InDepthQueryTreeVisitorWithContext<DB::(anonymous namespace)::CollectSourceColumnsVisitor>::visitChildIfNeeded(std::shared_ptr<DB::IQueryTreeNode>&, std::shared_ptr<DB::IQueryTreeNode>&)
inlined from /ClickHouse/src/Analyzer/InDepthQueryTreeVisitor.h:213: DB::InDepthQueryTreeVisitorWithContext<DB::(anonymous namespace)::CollectSourceColumnsVisitor>::visitChildren(std::shared_ptr<DB::IQueryTreeNode>&)
/ClickHouse/src/Analyzer/InDepthQueryTreeVisitor.h:155:12: DB::InDepthQueryTreeVisitorWithContext<DB::(anonymous namespace)::CollectSourceColumnsVisitor>::visit(std::shared_ptr<DB::IQueryTreeNode>&) @ 0x000000001bca6f22
inlined from /ClickHouse/contrib/llvm-project/libcxx/include/__vector/vector.h:0: DB::InDepthQueryTreeVisitorWithContext<DB::(anonymous namespace)::CollectSourceColumnsVisitor>::visitChildIfNeeded(std::shared_ptr<DB::IQueryTreeNode>&, std::shared_ptr<DB::IQueryTreeNode>&)
inlined from /ClickHouse/src/Analyzer/InDepthQueryTreeVisitor.h:213: DB::InDepthQueryTreeVisitorWithContext<DB::(anonymous namespace)::CollectSourceColumnsVisitor>::visitChildren(std::shared_ptr<DB::IQueryTreeNode>&)
/ClickHouse/src/Analyzer/InDepthQueryTreeVisitor.h:155:12: DB::InDepthQueryTreeVisitorWithContext<DB::(anonymous namespace)::CollectSourceColumnsVisitor>::visit(std::shared_ptr<DB::IQueryTreeNode>&) @ 0x000000001bca6f22
/ClickHouse/src/Planner/CollectTableExpressionData.cpp:462:36: DB::collectSourceColumns(std::shared_ptr<DB::IQueryTreeNode>&, std::shared_ptr<DB::PlannerContext>&, bool) @ 0x000000001bca81d8
/ClickHouse/src/Planner/Utils.cpp:516:5: DB::buildFilterInfo(std::shared_ptr<DB::IQueryTreeNode>, std::shared_ptr<DB::IQueryTreeNode> const&, std::shared_ptr<DB::PlannerContext>&, std::unordered_set<String, std::hash<String>, std::equal_to<String>, std::allocator<String>>) @ 0x000000001b9c328e
/ClickHouse/src/Planner/Utils.cpp:501:12: DB::buildFilterInfo(boost::intrusive_ptr<DB::IAST>, std::shared_ptr<DB::IQueryTreeNode> const&, std::shared_ptr<DB::PlannerContext>&, std::unordered_set<String, std::hash<String>, std::equal_to<String>, std::allocator<String>>) @ 0x000000001b9c3087
inlined from /ClickHouse/src/Planner/Planner.cpp:1573: DB::(anonymous namespace)::addAdditionalFilterStepIfNeeded(DB::QueryPlan&, DB::QueryNode const&, DB::SelectQueryOptions const&, std::shared_ptr<DB::PlannerContext>&)
/ClickHouse/src/Planner/Planner.cpp:2244:24: DB::Planner::buildPlanForQueryNode() @ 0x000000001bcc5573
/ClickHouse/src/Planner/Planner.cpp:1670:9: DB::Planner::buildQueryPlanIfNeeded() @ 0x000000001bcb9aaa
/ClickHouse/src/Planner/Planner.cpp:1710:23: DB::Planner::buildPlanForUnionNode() @ 0x000000001bcba1a6
/ClickHouse/src/Planner/Planner.cpp:1668:9: DB::Planner::buildQueryPlanIfNeeded() @ 0x000000001bcb9a7b
/ClickHouse/src/Interpreters/InterpreterSelectQueryAnalyzer.cpp:318:13: DB::InterpreterSelectQueryAnalyzer::getQueryPlan() @ 0x000000001c5ec50d
/ClickHouse/src/Interpreters/executeQuery.cpp:1722:48: 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>>&, boost::intrusive_ptr<DB::IAST>&, std::shared_ptr<DB::ImplicitTransactionControlExecutor>, std::function<void ()>, DB::QueryResultDetails&) @ 0x000000001c963bcd
/ClickHouse/src/Interpreters/executeQuery.cpp:2105:11: DB::executeQuery(String const&, std::shared_ptr<DB::Context>, DB::QueryFlags, DB::QueryProcessingStage::Enum) @ 0x000000001c95e563
/ClickHouse/src/Server/TCPHandler.cpp:821:68: DB::TCPHandler::runImpl() @ 0x00000000200d6458
/ClickHouse/src/Server/TCPHandler.cpp:2959:9: DB::TCPHandler::run() @ 0x00000000200f1ae4
/ClickHouse/base/poco/Net/src/TCPServerConnection.cpp:40:3: Poco::Net::TCPServerConnection::start() @ 0x0000000026bdf40e
/ClickHouse/base/poco/Net/src/TCPServerDispatcher.cpp:115:42: Poco::Net::TCPServerDispatcher::run() @ 0x0000000026bdfa52
/ClickHouse/base/poco/Foundation/src/ThreadPool.cpp:205:14: Poco::PooledThread::run() @ 0x0000000026b7f73f
/ClickHouse/base/poco/Foundation/src/Thread_POSIX.cpp:341:27: Poco::ThreadImpl::runnableEntry(void*) @ 0x0000000026b7cdcf
start_thread @ 0x0000000000094ac3
clone3 @ 0x00000000001268d0

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