Skip to content

std::out_of_range with IN empty tuple #88343

@PedroTadim

Description

@PedroTadim

Describe the bug

Reproduces on the current head. Time to bisect...

How to reproduce

Run Fiddle: https://fiddle.clickhouse.com/e3af5e74-8004-4593-a994-8c2bf609e0be

Error message and/or stacktrace

Stack trace:

<Fatal> : Logical error: 'std::exception. Code: 1001, type: std::out_of_range, e.what() = vector (version 25.10.1.2182 (official build)), Stack trace:

0. contrib/llvm-project/libcxx/include/__exception/exception.h:113: std::logic_error::logic_error(char const*) @ 0x00000000288aed74
1. contrib/llvm-project/libcxx/include/stdexcept:162: std::out_of_range::out_of_range[abi:se190107](char const*) @ 0x000000000d34cac9
2. contrib/llvm-project/libcxx/include/stdexcept:248: std::__throw_out_of_range[abi:se190107](char const*) @ 0x000000000d34ca5f
3. contrib/llvm-project/libcxx/include/vector:1001: ? @ 0x0000000016ee984d
4. contrib/llvm-project/libcxx/include/vector:1458: DB::Set::insertFromColumns(std::vector<COW<DB::IColumn>::immutable_ptr<DB::IColumn>, std::allocator<COW<DB::IColumn>::immutable_ptr<DB::IColumn>>> const&, DB::SetKeyColumns&) @ 0x000000001a81ec27
5. src/Interpreters/PreparedSets.cpp:98: DB::FutureSetFromTuple::FutureSetFromTuple(CityHash_v1_0_2::uint128, std::shared_ptr<DB::IAST>, std::vector<DB::ColumnWithTypeAndName, std::allocator<DB::ColumnWithTypeAndName>>, bool, DB::SizeLimits) @ 0x000000001a7d81fa
6. contrib/llvm-project/libcxx/include/__memory/construct_at.h:41: DB::FutureSetFromTuple* std::construct_at[abi:se190107]<DB::FutureSetFromTuple, CityHash_v1_0_2::uint128&, std::shared_ptr<DB::IAST>, std::vector<DB::ColumnWithTypeAndName, std::allocator<DB::ColumnWithTypeAndName>>, DB::SettingFieldNumber<bool> const&, DB::SizeLimits&, DB::FutureSetFromTuple*>(DB::FutureSetFromTuple*, CityHash_v1_0_2::uint128&, std::shared_ptr<DB::IAST>&&, std::vector<DB::ColumnWithTypeAndName, std::allocator<DB::ColumnWithTypeAndName>>&&, DB::SettingFieldNumber<bool> const&, DB::SizeLimits&) @ 0x0000000019e31c89
7. contrib/llvm-project/libcxx/include/__memory/construct_at.h:49: DB::QueryAnalyzer::resolveFunction(std::shared_ptr<DB::IQueryTreeNode>&, DB::IdentifierResolveScope&) @ 0x0000000019e24af2
8. src/Analyzer/Resolve/QueryAnalyzer.cpp:2810: DB::QueryAnalyzer::resolveExpressionNode(std::shared_ptr<DB::IQueryTreeNode>&, DB::IdentifierResolveScope&, bool, bool, bool) @ 0x0000000019b8c49e
9. src/Analyzer/Resolve/QueryAnalyzer.cpp:2961: DB::QueryAnalyzer::resolveExpressionNodeList(std::shared_ptr<DB::IQueryTreeNode>&, DB::IdentifierResolveScope&, bool, bool) @ 0x0000000019b8b7b1
10. src/Analyzer/Resolve/QueryAnalyzer.cpp:3285: DB::QueryAnalyzer::resolveProjectionExpressionNodeList(std::shared_ptr<DB::IQueryTreeNode>&, DB::IdentifierResolveScope&) @ 0x0000000019baa472
11. src/Analyzer/Resolve/QueryAnalyzer.cpp:4715: DB::QueryAnalyzer::resolveQuery(std::shared_ptr<DB::IQueryTreeNode> const&, DB::IdentifierResolveScope&) @ 0x0000000019b85f20
12. src/Analyzer/Resolve/QueryAnalyzer.cpp:135: DB::QueryAnalyzer::resolve(std::shared_ptr<DB::IQueryTreeNode>&, std::shared_ptr<DB::IQueryTreeNode> const&, std::shared_ptr<DB::Context const>) @ 0x0000000019b84e34
13. src/Analyzer/Resolve/QueryAnalysisPass.cpp:18: DB::QueryAnalysisPass::run(std::shared_ptr<DB::IQueryTreeNode>&, std::shared_ptr<DB::Context const>) @ 0x0000000019b844d0
14. src/Analyzer/QueryTreePassManager.cpp:191: DB::QueryTreePassManager::run(std::shared_ptr<DB::IQueryTreeNode>) @ 0x0000000019bda5d3
15. src/Interpreters/InterpreterSelectQueryAnalyzer.cpp:165: DB::buildQueryTreeAndRunPasses(std::shared_ptr<DB::IAST> const&, DB::SelectQueryOptions const&, std::shared_ptr<DB::Context const> const&, std::shared_ptr<DB::IStorage> const&) @ 0x000000001a762727
16. src/Interpreters/InterpreterSelectQueryAnalyzer.cpp:182: 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&) @ 0x000000001a760ff8
17. contrib/llvm-project/libcxx/include/__memory/unique_ptr.h:634: std::__unique_if<DB::InterpreterSelectQueryAnalyzer>::__unique_single std::make_unique[abi:se190107]<DB::InterpreterSelectQueryAnalyzer, std::shared_ptr<DB::IAST>&, std::shared_ptr<DB::Context> const&, DB::SelectQueryOptions const&>(std::shared_ptr<DB::IAST>&, std::shared_ptr<DB::Context> const&, DB::SelectQueryOptions const&) @ 0x000000001a7639f0
18. contrib/llvm-project/libcxx/include/__functional/function.h:716: ? @ 0x000000001a6ecf04
19. 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 ()>) @ 0x000000001aa80f81
20. src/Interpreters/executeQuery.cpp:1812: DB::executeQuery(String const&, std::shared_ptr<DB::Context>, DB::QueryFlags, DB::QueryProcessingStage::Enum) @ 0x000000001aa7b372
21. src/Server/TCPHandler.cpp:743: DB::TCPHandler::runImpl() @ 0x000000001e3497ae
22. src/Server/TCPHandler.cpp:2754: DB::TCPHandler::run() @ 0x000000001e3630e4
23. base/poco/Net/src/TCPServerConnection.cpp:40: Poco::Net::TCPServerConnection::start() @ 0x00000000241c3c87
24. base/poco/Net/src/TCPServerDispatcher.cpp:115: Poco::Net::TCPServerDispatcher::run() @ 0x00000000241c4265
25. base/poco/Foundation/src/ThreadPool.cpp:205: Poco::PooledThread::run() @ 0x00000000241633ff
26. base/poco/Foundation/src/Thread_POSIX.cpp:341: Poco::ThreadImpl::runnableEntry(void*) @ 0x0000000024160ad1
27. start_thread @ 0x00000000000a27f1
28. __GI___clone3 @ 0x0000000000133b5c

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugConfirmed user-visible misbehaviour in official releasefuzzProblem found by one of the fuzzersminorPriority: minor

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions