-
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
Uncertain Results by MERGE_JOIN #46580
Labels
affects-6.5
affects-7.1
fuzz/sqlancer
severity/critical
sig/planner
SIG: Planner
type/bug
The issue is confirmed as a bug.
Comments
/label fuzz/sqlancer |
ti-chi-bot
bot
added
may-affects-5.3
This bug maybe affects 5.3.x versions.
may-affects-5.4
This bug maybe affects 5.4.x versions.
may-affects-6.1
may-affects-6.5
may-affects-7.1
labels
Sep 4, 2023
After this modification, the issue is fixed diff --git a/planner/core/rule_inject_extra_projection.go b/planner/core/rule_inject_extra_projection.go
index edd972426f..8aad3c58ea 100644
--- a/planner/core/rule_inject_extra_projection.go
+++ b/planner/core/rule_inject_extra_projection.go
@@ -322,6 +322,7 @@ func TurnNominalSortIntoProj(p PhysicalPlan, onlyColumn bool, orderByItems []*ut
topProj.SetSchema(childPlan.Schema().Clone())
topProj.SetChildren(bottomProj)
+ refine4NeighbourProj(topProj, bottomProj)
if origChildProj, isChildProj := childPlan.(*PhysicalProjection); isChildProj {
refine4NeighbourProj(bottomProj, origChildProj)
}
|
The tidb:4111 [test]> explain SELECT /*+ MERGE_JOIN(t1, t0, v0)*/v0.c2, t1.c0 FROM v0, t0 CROSS JOIN t1 ORDER BY -v0.c1;
+---------------------------------------------+---------+-----------+---------------+----------------------------------------------------------------------------------------------+
| id | estRows | task | access object | operator info |
+---------------------------------------------+---------+-----------+---------------+----------------------------------------------------------------------------------------------+
| Projection_17 | 4.00 | root | | Column#3->Column#12, test.t1.c0 |
| └─Projection_40 | 4.00 | root | | Column#3, Column#6, Column#3, test.t1.c0 |
| └─Projection_39 | 4.00 | root | | Column#3, Column#6, Column#3, test.t1.c0, unaryminus(Column#6)->Column#15 |
| └─Projection_36 | 4.00 | root | | Column#3, Column#6, Column#3, test.t1.c0 |
| └─Sort_38 | 4.00 | root | | Column#6:desc |
| └─MergeJoin_37 | 4.00 | root | | inner join |
| ├─Projection_28(Build) | 2.00 | root | | test.t1.c0->Column#3, log10(cast(test.t0.c0, double BINARY))->Column#6, test.t1.c0->Column#3 |
| │ └─HashJoin_31 | 2.00 | root | | CARTESIAN inner join |
| │ ├─TableReader_33(Build) | 1.00 | root | | data:TableFullScan_32 |
| │ │ └─TableFullScan_32 | 1.00 | cop[tikv] | table:t0 | keep order:false, stats:pseudo |
| │ └─TableReader_35(Probe) | 2.00 | root | | data:TableFullScan_34 |
| │ └─TableFullScan_34 | 2.00 | cop[tikv] | table:t1 | keep order:false, stats:pseudo |
| └─MergeJoin_22(Probe) | 2.00 | root | | inner join |
| ├─TableReader_27(Build) | 2.00 | root | | data:TableFullScan_26 |
| │ └─TableFullScan_26 | 2.00 | cop[tikv] | table:t1 | keep order:false, stats:pseudo |
| └─TableReader_25(Probe) | 1.00 | root | | data:TableFullScan_24 |
| └─TableFullScan_24 | 1.00 | cop[tikv] | table:t0 | keep order:false, stats:pseudo |
+---------------------------------------------+---------+-----------+---------------+----------------------------------------------------------------------------------------------+
17 rows in set (0.00 sec) |
planner-related issue, I'll change the label to sig/planner |
I'll fix it this week. |
qw4990
added
affects-6.5
affects-7.1
and removed
may-affects-5.3
This bug maybe affects 5.3.x versions.
may-affects-5.4
This bug maybe affects 5.4.x versions.
may-affects-6.1
labels
Sep 19, 2023
13 tasks
This was referenced Sep 19, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
affects-6.5
affects-7.1
fuzz/sqlancer
severity/critical
sig/planner
SIG: Planner
type/bug
The issue is confirmed as a bug.
Bug Report
1. Minimal reproduce step (Required)
2. What did you expect to see? (Required)
3. What did you see instead (Required)
Executing the above test case multiple times and the results are not the same.
Sometimes it returns:
Sometimes it returns empty: {}.
4. What is your TiDB version? (Required)
| Release Version: v7.4.0-alpha-239-g4f2f5e1061
Edition: Community
Git Commit Hash: 4f2f5e1
Git Branch: master
UTC Build Time: 2023-08-30 12:06:00
GoVersion: go1.21.0
Race Enabled: false
Check Table Before Drop: false
Store: unistore |
The text was updated successfully, but these errors were encountered: