-
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 estRows and result using CTE #55818
Labels
affects-7.1
affects-7.5
affects-8.1
fuzz/randomtest
impact/inconsistency
incorrect/inconsistency/inconsistent
severity/major
sig/planner
SIG: Planner
type/bug
The issue is confirmed as a bug.
Comments
EstRows is incorrect. mysql> desc WITH `cte_11235` (`col_60767`) AS (SELECT /*+ USE_INDEX_MERGE(`tceb7972c` `t61a85298`)*/ `tceb7972c`.`col_17` AS `r0` FROM `t61a85298` JOIN `tceb7972c` ON `tceb7972c`.`col_19`=`t61a85298`.`col_71` WHERE NOT (`t61a85298`.`col_75`<=43.851) AND `t61a85298`.`col_78`<'@tikQ6I^' ORDER BY `r0`) (SELECT * FROM `cte_11235` WHERE 16739493649928310215 MEMBER OF (`cte_11235`.`col_60767`) OR NOT (JSON_CONTAINS(`cte_11235`.`col_60767`, '6019730272580550835')));
+------------------------------+---------+-----------+-----------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| id | estRows | task | access object | operator info |
+------------------------------+---------+-----------+-----------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| HashJoin_24 | NaN | root | | CARTESIAN inner join |
| ├─TableReader_31(Build) | 7.98 | root | | data:Selection_30 |
| │ └─Selection_30 | 7.98 | cop[tikv] | | gt(test.t61a85298.col_75, 43.851), lt(test.t61a85298.col_78, "@tikQ6I^") |
| │ └─TableFullScan_29 | 38.00 | cop[tikv] | table:t61a85298 | keep order:false, stats:partial[col_78:unInitialized] |
| └─TableReader_28(Probe) | NaN | root | partition:all | data:Selection_27 |
| └─Selection_27 | NaN | cop[tikv] | | or(json_memberof(cast(16739493649928310215, json BINARY), test.tceb7972c.col_17), not(istrue_with_null(json_contains(test.tceb7972c.col_17, cast("6019730272580550835", json BINARY))))) |
| └─TableFullScan_26 | 6.00 | cop[tikv] | table:tceb7972c | keep order:false, stats:partial[col_17:unInitialized] |
+------------------------------+---------+-----------+-----------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
7 rows in set, 2 warnings (0.00 sec) |
We can simple the SQL like this.
|
jebter
added
sig/planner
SIG: Planner
severity/major
impact/inconsistency
incorrect/inconsistency/inconsistent
labels
Sep 4, 2024
ti-chi-bot
bot
added
may-affects-5.4
This bug maybe affects 5.4.x versions.
may-affects-6.1
may-affects-6.5
may-affects-7.1
may-affects-7.5
may-affects-8.1
labels
Sep 4, 2024
13 tasks
hawkingrei
removed
may-affects-5.4
This bug maybe affects 5.4.x versions.
may-affects-6.1
may-affects-6.5
may-affects-7.5
may-affects-8.1
labels
Sep 4, 2024
This was referenced Sep 6, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
affects-7.1
affects-7.5
affects-8.1
fuzz/randomtest
impact/inconsistency
incorrect/inconsistency/inconsistent
severity/major
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)
Empty row.
3. What did you see instead (Required)
4. What is your TiDB version? (Required)
3d42e34
The text was updated successfully, but these errors were encountered: