Skip to content

Logical error with Dynamic column #91215

@PedroTadim

Description

@PedroTadim

Describe the bug

The type has to be Tuple(Dynamic,LowCardinality(Int)). Strange combination. cc @Avogar related to any of the recent changes?

How to reproduce

On a debug build run:

SET allow_suspicious_low_cardinality_types = 1;
CREATE TABLE t0 (c0 Tuple(Dynamic,LowCardinality(Int))) ENGINE = CoalescingMergeTree() ORDER BY tuple();
INSERT INTO TABLE t0 (c0) VALUES (([1], 2)), ((3, 4));

On the release build, I get a strange error instead: https://fiddle.clickhouse.com/8e39ceee-c543-4e09-93aa-37464b620bbe

Error message and/or stacktrace

Stack trace:

<Fatal> : Logical error: '(isConst() || isSparse() || isReplicated()) ? getDataType() == rhs.getDataType() : typeid(*this) == typeid(rhs)'.
<Fatal> : Stack trace (when copying this message, always include the lines below):

0. src/Common/StackTrace.cpp:397: StackTrace::StackTrace() @ 0x0000000015cf91a4
1. src/Common/Exception.cpp:57: DB::abortOnFailedAssertion(String const&) @ 0x0000000015c59715
2. src/Columns/IColumn.h:807: DB::IColumn::assertTypeEquality(DB::IColumn const&) const @ 0x000000000d994210
3. src/Columns/IColumn.h:226: DB::ColumnTuple::doInsertFrom(DB::IColumn const&, unsigned long) @ 0x000000001e326ff5
4. src/Processors/Merges/Algorithms/SummingSortedAlgorithm.cpp:690: DB::SummingSortedAlgorithm::SummingMergedData::finishGroup() @ 0x000000001fb38f12
5. src/Processors/Merges/Algorithms/SummingSortedAlgorithm.cpp:885: DB::SummingSortedAlgorithm::merge() @ 0x000000001fb3ceac
6. src/Storages/MergeTree/MergeTreeDataWriter.cpp:610: DB::MergeTreeDataWriter::mergeBlock(DB::Block&&, std::shared_ptr<DB::StorageInMemoryMetadata const> const&, DB::SortDescription, DB::PODArray<unsigned long, 4096ul, Allocator<false, false>, 63ul, 64ul>*&, DB::MergeTreeData::MergingParams const&) @ 0x000000001ef00ffb
7. src/Storages/MergeTree/MergeTreeDataWriter.cpp:775: DB::MergeTreeDataWriter::writeTempPartImpl(DB::BlockWithPartition&, std::shared_ptr<DB::StorageInMemoryMetadata const>, String, DB::SourcePartsSetForPatch, std::shared_ptr<DB::Context const>, unsigned long) @ 0x000000001ef03141
8. src/Storages/MergeTree/MergeTreeDataWriter.cpp:632: DB::MergeTreeDataWriter::writeTempPart(DB::BlockWithPartition&, std::shared_ptr<DB::StorageInMemoryMetadata const>, std::shared_ptr<DB::Context const>) @ 0x000000001ef0195c
9. src/Storages/MergeTree/MergeTreeSink.cpp:111: DB::MergeTreeSink::consume(DB::Chunk&) @ 0x000000001f09b843
10. src/Processors/Sinks/SinkToStorage.cpp:10: DB::SinkToStorage::onConsume(DB::Chunk) @ 0x000000001fa60353
11. src/Processors/Transforms/ExceptionKeepingTransform.cpp:135: void std::__function::__policy_func<void ()>::__call_func[abi:se210105]<DB::ExceptionKeepingTransform::work()::$_1>(std::__function::__policy_storage const*) @ 0x000000001f941674
12. contrib/llvm-project/libcxx/include/__functional/function.h:508: ? @ 0x000000001f941441
13. src/Processors/Transforms/ExceptionKeepingTransform.cpp:135: DB::ExceptionKeepingTransform::work() @ 0x000000001f940d0e
14. src/Processors/Executors/ExecutionThreadContext.cpp:53: DB::ExecutionThreadContext::executeTask() @ 0x000000001f6a1af0
15. src/Processors/Executors/PipelineExecutor.cpp:351: DB::PipelineExecutor::executeStepImpl(unsigned long, DB::IAcquiredSlot*, std::atomic<bool>*) @ 0x000000001f694618
16. src/Processors/Executors/PipelineExecutor.cpp:279: DB::PipelineExecutor::executeSingleThread(unsigned long, DB::IAcquiredSlot*) @ 0x000000001f694c29
17. src/Processors/Executors/PipelineExecutor.cpp:565: void std::__function::__policy_func<void ()>::__call_func[abi:se210105]<DB::PipelineExecutor::spawnThreads(std::shared_ptr<DB::IAcquiredSlot>)::$_0>(std::__function::__policy_storage const*) @ 0x000000001f695d41
18. contrib/llvm-project/libcxx/include/__functional/function.h:508: ? @ 0x0000000015da6d76
19. contrib/llvm-project/libcxx/include/__type_traits/invoke.h:217: ThreadFromGlobalPoolImpl<false, true>::ThreadFromGlobalPoolImpl<void (ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool::*)(), ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool*>(void (ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool::*&&)(), ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool*&&)::'lambda'()::operator()() @ 0x0000000015dad126
20. contrib/llvm-project/libcxx/include/__functional/function.h:508: ? @ 0x0000000015da41b2
21. contrib/llvm-project/libcxx/include/__type_traits/invoke.h:217: void* std::__thread_proxy[abi:se210105]<std::tuple<std::unique_ptr<std::__thread_struct, std::default_delete<std::__thread_struct>>, void (ThreadPoolImpl<std::thread>::ThreadFromThreadPool::*)(), ThreadPoolImpl<std::thread>::ThreadFromThreadPool*>>(void*) @ 0x0000000015daacc0
22. ? @ 0x00000000000a3d64
23. __clone3 @ 0x00000000001373bc

Metadata

Metadata

Assignees

Labels

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

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions