Skip to content

Logical error: 'Unexpected return type from __getScalar. Expected LowCardinality. Got UInt8' #93975

@PedroTadim

Description

@PedroTadim

Describe the bug

Not sure if this already exists. The test case is trivial.

How to reproduce

Run Fiddle: https://fiddle.clickhouse.com/7ab02ccd-23fa-49aa-85c4-81b7660d70e6

Error message and/or stacktrace

Stack trace:

<Fatal> : Logical error: 'Unexpected return type from __getScalar. Expected LowCardinality. Got UInt8'.
<Fatal> : Format string: 'Unexpected return type from {}. Expected {}. Got {}'.
<Fatal> : Stack trace (when copying this message, always include the lines below):

0. contrib/llvm-project/libcxx/include/__exception/exception.h:113: Poco::Exception::Exception(String const&, int) @ 0x0000000026846572
1. src/Common/Exception.cpp:136: DB::Exception::Exception(DB::Exception::MessageMasked&&, int, bool) @ 0x00000000163e75a9
2. src/Common/Exception.h:172: DB::Exception::Exception(String&&, int, String, bool) @ 0x000000000d9d6e14
3. src/Common/Exception.h:58: DB::Exception::Exception(PreformattedMessage&&, int) @ 0x000000000d9d6911
4. src/Common/Exception.h:190: DB::Exception::Exception<String, DB::TypeIndex, DB::TypeIndex>(int, FormatStringHelperImpl<std::type_identity<String>::type, std::type_identity<DB::TypeIndex>::type, std::type_identity<DB::TypeIndex>::type>, String&&, DB::TypeIndex&&, DB::TypeIndex&&) @ 0x000000001bc42389
5. src/Interpreters/ActionsDAG.cpp:436: DB::ActionsDAG::addFunctionImpl(std::shared_ptr<DB::IFunctionBase const> const&, std::vector<DB::ActionsDAG::Node const*, std::allocator<DB::ActionsDAG::Node const*>>, std::vector<DB::ColumnWithTypeAndName, std::allocator<DB::ColumnWithTypeAndName>>, String, std::shared_ptr<DB::IDataType const>, bool) @ 0x000000001bc1a38d
6. src/Interpreters/ActionsDAG.cpp:351: DB::ActionsDAG::addFunction(std::shared_ptr<DB::IFunctionOverloadResolver> const&, std::vector<DB::ActionsDAG::Node const*, std::allocator<DB::ActionsDAG::Node const*>>, String) @ 0x000000001bc195c0
7. src/Interpreters/ActionsVisitor.cpp:698: DB::ScopeStack::addFunction(std::shared_ptr<DB::IFunctionOverloadResolver> const&, std::vector<String, std::allocator<String>> const&, String) @ 0x000000001c6f0a17
8. src/Interpreters/ActionsMatcher.h:178: DB::ActionsMatcher::Data::addFunction(std::shared_ptr<DB::IFunctionOverloadResolver> const&, std::vector<String, std::allocator<String>> const&, String) @ 0x000000001c6fd43c
9. src/Interpreters/ActionsVisitor.cpp:1371: DB::ActionsMatcher::visit(DB::ASTFunction const&, std::shared_ptr<DB::IAST> const&, DB::ActionsMatcher::Data&) @ 0x000000001c6f513a
10. src/Interpreters/ActionsVisitor.cpp:1284: DB::ActionsMatcher::visit(DB::ASTFunction const&, std::shared_ptr<DB::IAST> const&, DB::ActionsMatcher::Data&) @ 0x000000001c6f4015
11. src/Interpreters/InDepthNodeVisitor.h:71: DB::InDepthNodeVisitor<DB::ActionsMatcher, true, false, std::shared_ptr<DB::IAST> const>::doVisit(std::shared_ptr<DB::IAST> const&) @ 0x000000001c6e9818
12. src/Interpreters/InDepthNodeVisitor.h:61: DB::ExpressionAnalyzer::getRootActions(std::shared_ptr<DB::IAST> const&, bool, DB::ActionsDAG&, bool) @ 0x000000001c6d153e
13. src/Interpreters/ExpressionAnalyzer.cpp:1869: DB::ExpressionAnalyzer::getActionsDAG(bool, bool) @ 0x000000001c6e019c
14. src/Interpreters/ExpressionAnalyzer.cpp:1904: DB::ExpressionAnalyzer::getActions(bool, bool, DB::CompileExpressions) @ 0x000000001c6e06f9
15. src/Storages/IndicesDescription.cpp:147: DB::IndexDescription::initExpressionInfo(std::shared_ptr<DB::IAST>, DB::ColumnsDescription const&, std::shared_ptr<DB::Context const>) @ 0x000000001f46959a
16. src/Storages/IndicesDescription.cpp:101: DB::IndexDescription::getIndexFromAST(std::shared_ptr<DB::IAST> const&, DB::ColumnsDescription const&, bool, std::shared_ptr<DB::Context const>) @ 0x000000001f468db1
17. src/Interpreters/InterpreterCreateQuery.cpp:774: DB::InterpreterCreateQuery::getTablePropertiesAndNormalizeCreateQuery(DB::ASTCreateQuery&, DB::LoadingStrictnessLevel) const @ 0x000000001c7c6a86
18. src/Interpreters/InterpreterCreateQuery.cpp:1650: DB::InterpreterCreateQuery::createTable(DB::ASTCreateQuery&) @ 0x000000001c7d14b8
19. src/Interpreters/InterpreterCreateQuery.cpp:2390: DB::InterpreterCreateQuery::execute() @ 0x000000001c7dfcb2
20. src/Interpreters/executeQuery.cpp:1738: 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&) @ 0x000000001cba5628
21. src/Interpreters/executeQuery.cpp:1962: DB::executeQuery(String const&, std::shared_ptr<DB::Context>, DB::QueryFlags, DB::QueryProcessingStage::Enum) @ 0x000000001cb9f054
22. src/Server/TCPHandler.cpp:774: DB::TCPHandler::runImpl() @ 0x00000000203fe6c9
23. src/Server/TCPHandler.cpp:2867: DB::TCPHandler::run() @ 0x00000000204196e4
24. base/poco/Net/src/TCPServerConnection.cpp:40: Poco::Net::TCPServerConnection::start() @ 0x00000000268fbfce
25. base/poco/Net/src/TCPServerDispatcher.cpp:115: Poco::Net::TCPServerDispatcher::run() @ 0x00000000268fc63b
26. base/poco/Foundation/src/ThreadPool.cpp:205: Poco::PooledThread::run() @ 0x000000002689cb3f
27. base/poco/Foundation/src/Thread_POSIX.cpp:341: Poco::ThreadImpl::runnableEntry(void*) @ 0x000000002689a1cf
28. ? @ 0x00000000000a3d64
29. __clone3 @ 0x00000000001373bc

Metadata

Metadata

Labels

bugConfirmed user-visible misbehaviour in official releasefuzzProblem found by one of the fuzzers

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions