Skip to content

The result of where not ifnull() is not correct #4829

@JQWong7

Description

@JQWong7

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

drop table  if exists t;
create table t(a int, b int);
insert into t value(1, null);
insert into t value(null, 1);
alter table t set tiflash replica 1;
select * from t where not ifnull(a > b, null);

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

empty set

3. What did you see instead (Required)

mysql> select * from t where not ifnull(t.a > t.b, null); 
+------+------+
| a    | b    |
+------+------+
|    1 | NULL |
| NULL |    1 |
+------+------+
2 rows in set (0.02 sec)

mysql> select a, b, a>b, ifnull(a > b, null), not ifnull(a > b, null)  from t where not ifnull(a > b, null);
+------+------+------+---------------------+-------------------------+
| a    | b    | a>b  | ifnull(a > b, null) | not ifnull(a > b, null) |
+------+------+------+---------------------+-------------------------+
|    1 | NULL | NULL |                NULL |                    NULL |
| NULL |    1 | NULL |                NULL |                    NULL |
+------+------+------+---------------------+-------------------------+
2 rows in set (0.01 sec)

4. What is your TiFlash version? (Required)

Release Version: v6.0.0
Edition: Community
Git Commit Hash: 25545c4

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions