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

executor: indexJoin and indexHashJoin error with distinct #15695

Closed
fzhedu opened this issue Mar 25, 2020 · 2 comments · Fixed by #15742
Closed

executor: indexJoin and indexHashJoin error with distinct #15695

fzhedu opened this issue Mar 25, 2020 · 2 comments · Fixed by #15742
Assignees
Labels
severity/moderate sig/execution SIG execution type/bug The issue is confirmed as a bug.

Comments

@fzhedu
Copy link
Contributor

fzhedu commented Mar 25, 2020

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. What did you do?

set the chunk size to 2 like #15696

download the file with all DDLs
randgen_index_merge_join.txt

source randgen_index_merge_join.txt
SELECT /*+INL_JOIN(table1,table2,table3,table4,table5,table6,table7,table8,table9,table10,table11,table12)*/ distinct table1 . `col_int_key` AS field1 FROM   BB AS table1  LEFT  JOIN M AS table2 ON  table1 . `pk` =  table2 . `col_int_key`   LEFT  JOIN  M AS table3  LEFT  JOIN Y AS table4 ON  table3 . `col_varchar_10_utf8_key` =  table4 . `col_varchar_10_latin1`  ON  table2 . `col_int_key` =  table4 . `col_int_key`  WHERE table2 . `col_int_key` IS  NULL  GROUP BY field1  ORDER BY field1   ;

2. What did you expect to see?

Mysql

+--------+
| field1 |
+--------+
|   NULL |
|      0 |
|      1 |
|      2 |
|      3 |
|      4 |
|      5 |
|      6 |
|      7 |
|      8 |
|      9 |
+--------+
11 rows in set (0.00 sec)

3. What did you see instead?

mysql> SELECT /*+INL_hash_JOIN(table1,table2,table3,table4,table5,table6,table7,table8,table9,table10,table11,table12)*/ distinct table1 . `col_int_key` AS field1 FROM   BB AS table1  LEFT  JOIN M AS table2 ON  table1 . `pk` =  table2 . `col_int_key`   LEFT  JOIN  M AS table3  LEFT  JOIN Y AS table4 ON  table3 . `col_varchar_10_utf8_key` =  table4 . `col_varchar_10_latin1`  ON  table2 . `col_int_key` =  table4 . `col_int_key`  WHERE table2 . `col_int_key` IS  NULL  GROUP BY field1  ORDER BY field1   ;
+--------+
| field1 |
+--------+
|   NULL |
|      1 |
|      2 |
|      3 |
|      4 |
|      5 |
|      6 |
|      7 |
|      8 |
|      9 |
+--------+
10 rows in set, 1 warning (0.01 sec)

mysql> SELECT /*+INL_JOIN(table1,table2,table3,table4,table5,table6,table7,table8,table9,table10,table11,table12)*/ distinct table1 . `col_int_key` AS field1 FROM   BB AS table1  LEFT  JOIN M AS table2 ON  table1 . `pk` =  table2 . `col_int_key`   LEFT  JOIN  M AS table3  LEFT  JOIN Y AS table4 ON  table3 . `col_varchar_10_utf8_key` =  table4 . `col_varchar_10_latin1`  ON  table2 . `col_int_key` =  table4 . `col_int_key`  WHERE table2 . `col_int_key` IS  NULL  GROUP BY field1  ORDER BY field1   ;
+--------+
| field1 |
+--------+
|   NULL |
|      1 |
|      2 |
|      3 |
|      4 |
|      5 |
|      6 |
|      7 |
|      8 |
|      9 |
+--------+
10 rows in set, 1 warning (0.01 sec)


4. What version of TiDB are you using? (tidb-server -V or run select tidb_version(); on TiDB)

5.7.25-TiDB-v4.0.0-beta-523-g7eba696bb

@fzhedu fzhedu added type/bug The issue is confirmed as a bug. sig/execution SIG execution labels Mar 25, 2020
@XuHuaiyu XuHuaiyu self-assigned this Mar 26, 2020
@XuHuaiyu
Copy link
Contributor

can not reproduce

@fzhedu
Copy link
Contributor Author

fzhedu commented Mar 26, 2020

can not reproduce
set the tidb_max_chunk_size=2 like
#15696

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/moderate sig/execution SIG execution type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants