-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
Different results between plan on tiflash and plan on tikv #30542
Comments
|
minimal reproduce: drop table t;
create table t(a char(5));
alter table t set tiflash replica 1;
insert into t values ('-1'), ('-1');
SELECT /*+ READ_FROM_STORAGE(tikv[t]) */ sum(Cast(a AS DECIMAL)) FROM t;
+-------------------------+
| sum(Cast(a AS DECIMAL)) |
+-------------------------+
| -2 |
+-------------------------+
SELECT /*+ READ_FROM_STORAGE(tiflash[t]) */ sum(Cast(a AS DECIMAL)) FROM t;
+-------------------------+
| sum(Cast(a AS DECIMAL)) |
+-------------------------+
| 2 |
+-------------------------+
explain SELECT /*+ READ_FROM_STORAGE(tiflash[t]) */ sum(Cast(a AS DECIMAL)) FROM t;
+------------------------------+---------+-------------------+---------------+------------------------------------------------+
| id | estRows | task | access object | operator info |
+------------------------------+---------+-------------------+---------------+------------------------------------------------+
| StreamAgg_21 | 1.00 | root | | funcs:sum(Column#6)->Column#3 |
| └─TableReader_22 | 1.00 | root | | data:StreamAgg_9 |
| └─StreamAgg_9 | 1.00 | batchCop[tiflash] | | funcs:sum(Column#7)->Column#6 |
| └─Projection_25 | 2.00 | batchCop[tiflash] | | cast(test.t.a, decimal(32,0) BINARY)->Column#7 |
| └─TableFullScan_20 | 2.00 | batchCop[tiflash] | table:t | keep order:false, stats:pseudo |
+------------------------------+---------+-------------------+---------------+------------------------------------------------+
5 rows in set (0.00 sec) |
Please check whether the issue should be labeled with 'affects-x.y' or 'fixes-x.y.z', and then remove 'needs-more-info' label. |
Hi here, this issue will be closed because it will be transferred to tiflash's repo. update: we have found the root cause and solution of this bug, and will fix it in the next release. Thanks for the feedback! |
Please check whether the issue should be labeled with 'affects-x.y' or 'fixes-x.y.z', and then remove 'needs-more-info' label. |
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
2. What did you expect to see? (Required)
The two queries have the same results.
3. What did you see instead (Required)
4. What is your TiDB version? (Required)
The text was updated successfully, but these errors were encountered: