Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot convert Enum while insert in native format after ALTER. #7836

Closed
CurtizJ opened this issue Nov 19, 2019 · 0 comments · Fixed by #7908
Closed

Cannot convert Enum while insert in native format after ALTER. #7836

CurtizJ opened this issue Nov 19, 2019 · 0 comments · Fixed by #7908
Labels
bug Confirmed user-visible misbehaviour in official release

Comments

@CurtizJ
Copy link
Member

CurtizJ commented Nov 19, 2019

Describe the bug or unexpected behaviour
If we have some data with enum column in native format and then we perfom alter on this column in table, we aren't able to insert this data to table. BTW, it works at versions lower than 19.15.

How to reproduce

ap11-nix :) CREATE TABLE enum_bug(e Enum('a'=0)) ENGINE = MergeTree ORDER BY tuple()
ap11-nix :) INSERT INTO enum_bug VALUES ('a')

ap11@ap11-nix:~$ clickhouse client -q "SELECT * FROM enum_bug FORMAT Native" > sample.bin 
ap11@ap11-nix:~$ clickhouse client -q "ALTER TABLE enum_bug MODIFY COLUMN e Enum8('a'=0, 'b'=1)"
ap11@ap11-nix:~$ clickhouse client -q "INSERT INTO enum_bug FORMAT Native" < sample.bin  --stacktrace
Code: 53. DB::Exception: Cannot convert: Enum8('a' = 0) to Enum8('a' = 0, 'b' = 1)

Stack trace:
0. 0x35398d7 StackTrace::StackTrace() /home/ap11/ClickHouse/build_clang/../dbms/src/Common/StackTrace.cpp:228
1. 0x688615e DB::recursiveLowCardinalityConversion(COW<DB::IColumn>::immutable_ptr<DB::IColumn> const&, std::__1::shared_ptr<DB::IDataType const> const&, std::__1::shared_ptr<DB::IDataType const> const&) /home/ap11/ClickHouse/build_clang/../dbms/src/Common/Exception.h:0
2. 0x680b2c3 DB::NativeBlockInputStream::readImpl() /home/ap11/ClickHouse/build_clang/../contrib/boost/boost/smart_ptr/intrusive_ptr.hpp:115
3. 0x6805315 DB::IBlockInputStream::read() /home/ap11/ClickHouse/build_clang/../dbms/src/DataStreams/IBlockInputStream.cpp:0
4. 0x6803d2f DB::AsynchronousBlockInputStream::calculate() /home/ap11/ClickHouse/build_clang/../dbms/src/Core/Block.h:28
5. 0x6804154 std::__1::__function::__func<DB::AsynchronousBlockInputStream::next()::$_0, std::__1::allocator<DB::AsynchronousBlockInputStream::next()::$_0>, void ()>::operator()() /home/ap11/ClickHouse/build_clang/../contrib/libcxx/include/atomic:1036
6. 0x3575902 ThreadPoolImpl<ThreadFromGlobalPool>::worker(std::__1::__list_iterator<ThreadFromGlobalPool, void*>) /home/ap11/ClickHouse/build_clang/../contrib/libcxx/include/atomic:1036
7. 0x3577748 std::__1::__function::__func<ThreadFromGlobalPool::ThreadFromGlobalPool<void ThreadPoolImpl<ThreadFromGlobalPool>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda1'()>(void&&)::'lambda'(), std::__1::allocator<ThreadFromGlobalPool::ThreadFromGlobalPool<void ThreadPoolImpl<ThreadFromGlobalPool>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda1'()>(void&&)::'lambda'()>, void ()>::operator()() /home/ap11/ClickHouse/build_clang/../dbms/src/Common/ThreadPool.cpp:0
8. 0x35741f1 ThreadPoolImpl<std::__1::thread>::worker(std::__1::__list_iterator<std::__1::thread, void*>) /home/ap11/ClickHouse/build_clang/../contrib/libcxx/include/atomic:1036
9. 0x35764e0 void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda1'()> >(void*) /home/ap11/ClickHouse/build_clang/../contrib/libcxx/include/memory:2648
10. 0x7f23104516db start_thread /lib/x86_64-linux-gnu/libpthread-2.27.so
11. 0x7f230fd6e88f __clone /build/glibc-OTsEL5/glibc-2.27/misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:97
@CurtizJ CurtizJ added the bug Confirmed user-visible misbehaviour in official release label Nov 19, 2019
@CurtizJ CurtizJ changed the title Cannot convert Enum after ALTER in native format. Cannot convert Enum while insert in native format after ALTER. Nov 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Confirmed user-visible misbehaviour in official release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant