-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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 result using cte with cornel value #52470
Labels
fuzz/randomtest
severity/moderate
sig/planner
SIG: Planner
type/bug
The issue is confirmed as a bug.
Comments
Maybe duplicate with #50051 |
change the condition from [18:15:37]TiDB root:test> desc WITH `cte_2151` (`col_6516`, `col_6517`, `col_6518`, `col_6519`, `col_6520`) AS (SELECT `t5d31e16c`.`col_35` AS `r0`,SUBSTRING(`t5d31e16c`.`col_35`, 0) AS `r1`,`t5d31e16c`.`col_35` AS `r2`,REVERSE(`t5d31e16c`.`col_35`) AS `r3`,MID(`t5d31e16c
-> `.`col_35`, 1, 3) AS `r4` FROM `t5d31e16c` GROUP BY `t5d31e16c`.`col_35` HAVING `t5d31e16c`.`col_35`<13227180432975340348) (SELECT 1 FROM `cte_2151` where not (`cte_2151`.`col_6518`<=9223372036854775806));
+---------------------------+---------+-----------+---------------------------------------+---------------------------------------------------------------------------------+
| id | estRows | task | access object | operator info |
+---------------------------+---------+-----------+---------------------------------------+---------------------------------------------------------------------------------+
| Projection_12 | 200.00 | root | | 1->Column#20 |
| └─StreamAgg_30 | 200.00 | root | | group by:test.t5d31e16c.col_35, funcs:firstrow(Column#30)->Column#22 |
| └─IndexReader_31 | 200.00 | root | | index:StreamAgg_16 |
| └─StreamAgg_16 | 200.00 | cop[tikv] | | group by:test.t5d31e16c.col_35, funcs:firstrow(1)->Column#30 |
| └─IndexRangeScan_29 | 250.00 | cop[tikv] | table:t5d31e16c, index:idx_17(col_35) | range:(9223372036854775806,13227180432975340348), keep order:true, stats:pseudo |
+---------------------------+---------+-----------+---------------------------------------+---------------------------------------------------------------------------------+
5 rows in set
Time: 0.004s
[18:15:41]TiDB root:test> desc WITH `cte_2151` (`col_6516`, `col_6517`, `col_6518`, `col_6519`, `col_6520`) AS (SELECT `t5d31e16c`.`col_35` AS `r0`,SUBSTRING(`t5d31e16c`.`col_35`, 0) AS `r1`,`t5d31e16c`.`col_35` AS `r2`,REVERSE(`t5d31e16c`.`col_35`) AS `r3`,MID(`t5d31e16c
-> `.`col_35`, 1, 3) AS `r4` FROM `t5d31e16c` GROUP BY `t5d31e16c`.`col_35` HAVING `t5d31e16c`.`col_35`<13227180432975340348) (SELECT 1 FROM `cte_2151` where not (`cte_2151`.`col_6518`<=9223372036854775807));
+------------------+---------+------+---------------+--------------------------------------------------------------+
| id | estRows | task | access object | operator info |
+------------------+---------+------+---------------+--------------------------------------------------------------+
| Projection_12 | 200.00 | root | | 1->Column#20 |
| └─StreamAgg_16 | 200.00 | root | | group by:test.t5d31e16c.col_35, funcs:firstrow(1)->Column#22 |
| └─TableDual_21 | 250.00 | root | | rows:0 |
+------------------+---------+------+---------------+--------------------------------------------------------------+
3 rows in set |
It is now fixed on master. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
fuzz/randomtest
severity/moderate
sig/planner
SIG: Planner
type/bug
The issue is confirmed as a bug.
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
2. What did you expect to see? (Required)
3. What did you see instead (Required)
4. What is your TiDB version? (Required)
12833e8
The text was updated successfully, but these errors were encountered: