You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SELECT /*+INL_MERGE_JOIN(table1,table2,table3,table4,table5,table6,table7,table8,table9,table10,table11,table12)*/ table1 . `col_int` AS field1 , table1 . `pk` AS field2 , table2 . `col_int` AS field3 , table2 . `col_int` AS field4 , table2 . `col_int` AS field5 , table1 . `col_int` AS field6 FROM K AS table1 LEFT JOIN A AS table2 ON table1 . `col_int_key` = table2 . `col_int_key` WHERE table2 . `pk` < table1 . `pk` ORDER BY field1, field2,field3,field4,field5,field6 ;
2. What did you expect to see?
mysql is right, and using hash join also is right, but indexjoin and indexHashJoin are also wrong.
createtablek (a int, pk intprimary key, index(a));
insert into k values(0,8),(0,23),(1,21),(1,33),(1,52),(2,17),(2,34),(2,39),(2,40),(2,66),(2,67),(3,9),(3,25),(3,41),(3,48),(4,4),(4,11),(4,15),(4,26),(4,27),(4,31),(4,35),(4,45),(4,47),(4,49);
createtablet (a int, pk intprimary key, index(a));
insert into t values(3,4),(3,5),(3,27),(3,29),(3,57),(3,58),(3,79),(3,84),(3,92),(3,95);
select/*+ inl_join(t) */count(*) from k left join t onk.a=t.aandk.pk>t.pk;
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
download the file with all DDLs
randgen_index_merge_join.txt
2. What did you expect to see?
mysql is right, and using hash join also is right, but indexjoin and indexHashJoin are also wrong.
3. What did you see instead?
4. What version of TiDB are you using? (
tidb-server -V
or runselect tidb_version();
on TiDB)| 5.7.25-TiDB-v4.0.0-beta-523-g7eba696bb-dirty |
The text was updated successfully, but these errors were encountered: