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

The result of in multiple values expression is not correct #4016

Closed
lilinghai opened this issue Feb 14, 2022 · 1 comment · Fixed by #4032
Closed

The result of in multiple values expression is not correct #4016

lilinghai opened this issue Feb 14, 2022 · 1 comment · Fixed by #4032
Labels

Comments

@lilinghai
Copy link

lilinghai commented Feb 14, 2022

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

create table t2(a int primary key);
insert into t2 values(0),(1);
alter table t2 set tiflash replica 2;
set tidb_enforce_mpp=on;
select a, avg(a or 1) in (0,0) from t2 group by a;
/*
+---------------------------+---------+--------------+---------------+-----------------------------------------------------------------------------------------+
| id                        | estRows | task         | access object | operator info                                                                           |
+---------------------------+---------+--------------+---------------+-----------------------------------------------------------------------------------------+
| TableReader_11            | 2.00    | root         |               | data:ExchangeSender_10                                                                  |
| └─ExchangeSender_10       | 2.00    | cop[tiflash] |               | ExchangeType: PassThrough                                                               |
|   └─Projection_6          | 2.00    | cop[tiflash] |               | collation2.t2.a, in(cast(or(collation2.t2.a, 1), decimal(24,4) BINARY), 0, 0)->Column#3 |
|     └─TableFullScan_9     | 2.00    | cop[tiflash] | table:t2      | keep order:false, stats:pseudo                                                          |
+---------------------------+---------+--------------+---------------+-----------------------------------------------------------------------------------------+
*/

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

+---+----------------------+
| a | avg(a or 1) in (0,0) |
+---+----------------------+
| 0 |                    0 |
| 1 |                    0 |
+---+----------------------+

3. What did you see instead (Required)

+---+----------------------+
| a | avg(a or 1) in (0,0) |
+---+----------------------+
| 0 |                 NULL |
| 1 |                 NULL |
+---+----------------------+

4. What is your TiFlash version? (Required)

v5.1.4 release test

@VelocityLight
Copy link

update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants