Skip to content

Error when filtering on updated enum column type #512

@valyala

Description

@valyala

Clickhouse version 1.1.54164.

Steps to reproduce

  1. Create a MergeTree table with Enum field in primary key:
CREATE TABLE t (d Date, e Enum8('foo'=1)) Engine = MergeTree(d, (d, e), 8192);
  1. Insert at least one row into the table:
insert into t (d, e) values ('2017-02-20', 'foo');
  1. Add new value to enum field:
alter table t modify column e Enum8('foo'=1, 'bar'=2);
  1. Try to select on new enum value:
select count(*) from t where e = 'bar';

Actual result:

Clickhouse returns the following error:

Primary key expression contains comparison between inconvertible types: Enum8('foo' = 1) and String inside e = 'bar'.

Expected result:

Clickhouse must return

0 rows in set.

Temporary workaround:

Use 'IN' instead of '=' in the filter on updated enum column:

select count(*) from t where e in('bar');

This issue is related to #364 .

Metadata

Metadata

Assignees

Labels

bugConfirmed user-visible misbehaviour in official release

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions