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

broken merge join generated when TIDB_SMJ hint is specified #9032

Closed
eurekaka opened this issue Jan 14, 2019 · 0 comments
Closed

broken merge join generated when TIDB_SMJ hint is specified #9032

eurekaka opened this issue Jan 14, 2019 · 0 comments
Assignees
Labels
sig/planner SIG: Planner type/bug The issue is confirmed as a bug.

Comments

@eurekaka
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

  1. What did you do?
mysql> select /*+ TIDB_SMJ(t1, t2) */ * from t t1 join t t2;
ERROR 1105 (HY000): Invalid arguments: Empty arguments detected.

mysql> explain select /*+ TIDB_SMJ(t1, t2) */ * from t t1 join t t2;
+-----------------------+-------+------+-------------------------------------------------------------+
| id                    | count | task | operator info                                               |
+-----------------------+-------+------+-------------------------------------------------------------+
| MergeJoin_6           | 4.00  | root | inner join                                                  |
| ├─TableReader_8       | 2.00  | root | data:TableScan_7                                            |
| │ └─TableScan_7       | 2.00  | cop  | table:t1, range:[-inf,+inf], keep order:false, stats:pseudo |
| └─TableReader_10      | 2.00  | root | data:TableScan_9                                            |
|   └─TableScan_9       | 2.00  | cop  | table:t2, range:[-inf,+inf], keep order:false, stats:pseudo |
+-----------------------+-------+------+-------------------------------------------------------------+
5 rows in set (0.00 sec)
  1. What did you expect to see?

We should not generate merge join for this query, because it has no column equal condition.

  1. What did you see instead?

Merge join is generated, but it cannot be executed.

  1. What version of TiDB are you using (tidb-server -V or run select tidb_version(); on TiDB)?
[root@bogon ~/go/src/github.com/pingcap/tidb]$ ./bin/tidb-server -V
Release Version: v2.1.0-rc.3-426-g8468e7e
Git Commit Hash: 8468e7ec515bac8bda78e9ee2dcfe887d6446a42
Git Branch: master
UTC Build Time: 2019-01-10 11:27:29
GoVersion: go version go1.11.2 linux/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/planner SIG: Planner type/bug The issue is confirmed as a bug.
Projects
None yet
Development

No branches or pull requests

1 participant