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

Incorrect not in function behavior for rough set filter when one parameter is column type #8230

Closed
yibin87 opened this issue Oct 23, 2023 · 3 comments · Fixed by #8232
Closed
Assignees
Labels
component/storage priority/P1 The issue has P1 priority. severity/major type/bug The issue is confirmed as a bug.

Comments

@yibin87
Copy link
Contributor

yibin87 commented Oct 23, 2023

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

mysql> create table t1 (a int unsigned);
mysql> insert into t1 values(300);
mysql> insert into t1 values(null);
mysql> insert into t1 values(981);
mysql> alter table t1 set tiflash replica 1;
mysql> set session tidb_isolation_read_engines='tiflash';
mysql> select * from t1 where not cast(a as signed) not in (a, 88);

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

+------+
| a |
+------+
| 300 |
| 981 |
+------+

3. What did you see instead (Required)

Empty result set.

4. What is your TiFlash version? (Required)

@yibin87 yibin87 added the type/bug The issue is confirmed as a bug. label Oct 23, 2023
@yibin87
Copy link
Contributor Author

yibin87 commented Oct 23, 2023

From execution summary, RoughSet filter bahaves incorrectly:

mysql> explain analyze  select * from t1 where not cast(a as signed) not in (a, 88);
+----------------------------+---------+---------+--------------+---------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------+-----------+------+
| id                         | estRows | actRows | task         | access object | execution info                                                                                                                                                                                                                                                                                                                                                                                                          | operator info                                            | memory    | disk |
+----------------------------+---------+---------+--------------+---------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------+-----------+------+
| TableReader_13             | 2.40    | 0       | root         |               | time:8.33ms, loops:1, RU:0.000000, cop_task: {num: 1, max: 0s, proc_keys: 0, copr_cache_hit_ratio: 0.00}                                                                                                                                                                                                                                                                                                                | MppVersion: 2, data:ExchangeSender_12                    | 305 Bytes | N/A  |
| └─ExchangeSender_12        | 2.40    | 0       | mpp[tiflash] |               | tiflash_task:{time:5.13ms, loops:0, threads:8}                                                                                                                                                                                                                                                                                                                                                                          | ExchangeType: PassThrough                                | N/A       | N/A  |
|   └─Selection_11           | 2.40    | 0       | mpp[tiflash] |               | tiflash_task:{time:4.92ms, loops:0, threads:8}                                                                                                                                                                                                                                                                                                                                                                          | in(cast(test.t1.a, bigint(22) BINARY), test.t1.a, 88)    | N/A       | N/A  |
|     └─TableFullScan_10     | 3.00    | 0       | mpp[tiflash] | table:t1      | tiflash_task:{time:4.92ms, loops:0, threads:8}, tiflash_scan:{dtfile:{total_scanned_packs:0, total_skipped_packs:1, total_scanned_rows:0, total_skipped_rows:3, total_rs_index_check_time: 0ms, total_read_time: 0ms, total_disagg_read_cache_hit_size: 0, total_disagg_read_cache_miss_size: 0}, total_create_snapshot_time: 0ms, total_local_region_num: 1, total_remote_region_num: 0, total_learner_read_time: 0ms} | pushed down filter:empty, keep order:false, stats:pseudo | N/A       | N/A  |
+----------------------------+---------+---------+--------------+---------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------+-----------+------+

@Lloyd-Pottiger
Copy link
Contributor

introduce by #8212

@ti-chi-bot ti-chi-bot added the affects-7.5 This bug affects the 7.5.x(LTS) versions. label Oct 23, 2023
@Lloyd-Pottiger Lloyd-Pottiger removed the affects-7.5 This bug affects the 7.5.x(LTS) versions. label Oct 23, 2023
@ti-chi-bot ti-chi-bot added the affects-7.5 This bug affects the 7.5.x(LTS) versions. label Oct 24, 2023
@JaySon-Huang JaySon-Huang removed the affects-7.5 This bug affects the 7.5.x(LTS) versions. label Oct 25, 2023
@JaySon-Huang
Copy link
Contributor

Does not affects release-7.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/storage priority/P1 The issue has P1 priority. severity/major type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants