Skip to content

Ifnull enum type with not null flag has different result #24944

Closed
@wshwsh12

Description

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

drop table if exists t,t2;
create table t(e enum("a","b","c") not null, b int);
create table t2(e enum("a","b","c"), b int);
insert into t values(1,1);
insert into t2 values(1,1);

select * from t where ifnull(e,b);
select * from t2 where ifnull(e,b);

2. What did you expect to see? (Required)

Same result.

3. What did you see instead (Required)

[tidb]> select * from t where ifnull(e,b);
+---+------+
| e | b    |
+---+------+
| a |    1 |
+---+------+
1 row in set (0.001 sec)

[tidb]> select * from t2 where ifnull(e,b);
Empty set, 1 warning (0.001 sec)

4. What is your TiDB version? (Required)

master, v5.0,v4.0

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions