Please answer these questions before submitting your issue. Thanks!
mysql> create table t1 (a int, b int);
Query OK, 0 rows affected (0.01 sec)
mysql> create table t2 (a int primary key, b int, c int as ((a+b)) virtual);
Query OK, 0 rows affected (0.02 sec)
mysql> insert into t1 values (1, 1);
Query OK, 1 row affected (0.00 sec)
mysql> desc select /*+ TIDB_INLJ(t2) */ * from t1, t2 where t1.a = t2.a and t2.c > 10;
+--------------------------+-------+-----------+---------------------------------------------------------------------------------+
| id | count | task | operator info |
+--------------------------+-------+-----------+---------------------------------------------------------------------------------+
| IndexJoin_10 | 1.25 | root | inner join, inner:Selection_9, outer key:jointest.t1.a, inner key:jointest.t2.a |
| ├─TableReader_20 | 1.00 | root | data:Selection_19 |
| │ └─Selection_19 | 1.00 | cop[tikv] | not(isnull(jointest.t1.a)) |
| │ └─TableScan_18 | 1.00 | cop[tikv] | table:t1, range:[-inf,+inf], keep order:false, stats:pseudo |
| └─Selection_9 | 1.00 | root | gt(jointest.t2.c, 10) |
| └─TableReader_8 | 1.00 | root | data:TableScan_7 |
| └─TableScan_7 | 1.00 | cop[tikv] | table:t2, range: decided by [jointest.t1.a], keep order:false, stats:pseudo |
+--------------------------+-------+-----------+---------------------------------------------------------------------------------+
7 rows in set (0.00 sec)
mysql> select /*+ TIDB_INLJ(t2) */ * from t1, t2 where t1.a = t2.a and t2.c > 10;
ERROR 1105 (HY000): Wrong plan type for dataReaderBuilder
What did you expect to see?
What did you see instead?
What version of TiDB are you using (tidb-server -V or run select tidb_version(); on TiDB)?
mysql> select tidb_version();
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v4.0.0-beta-156-g713099c-dirty
Git Commit Hash: 713099c1adcb1e65e5e687a1fa88d4b36311c623
Git Branch: master
UTC Build Time: 2020-02-17 08:10:06
GoVersion: go1.13
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
@wjhuang2016 PTAL
verified on
master: v4.0.0-beta.2-743-g45c9d10a