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
Step 2 and 3 followed below behaves exact the same if enum is replaced with set for the step above.
2. What did you expect to see? (Required)
mysql> select * from t join t1 on t.b = t1.b1;
+------+------+------+------+
| a | b | a1 | b1 |
+------+------+------+------+
| 1 | A | 1 | A |
+------+------+------+------+
1 row in set (0.00 sec)
3. What did you see instead (Required)
tidb> select /*+ HASH_JOIN(t, t1) */ * from t join t1 on t.b = t1.b1;
Empty set (0.01 sec)
4. Affected version (Required)
v4.0.x
5. Root Cause Analysis
It looks that when building the HashTable used by HashJoin, the hash key is built from the offset of enum/set value:
bb7133
changed the title
executor: unexpected result for hash join on enum columns
executor: unexpected result for hash join on enum and set columns
Jul 29, 2020
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
Step 2 and 3 followed below behaves exact the same if
enum
is replaced withset
for the step above.2. What did you expect to see? (Required)
3. What did you see instead (Required)
4. Affected version (Required)
v4.0.x
5. Root Cause Analysis
It looks that when building the HashTable used by HashJoin, the hash key is built from the offset of
enum
/set
value:https://github.com/pingcap/tidb/blob/master/util/codec/codec.go#L571
When the values of
enum
/set
have different offsets by their definitions, the join result would be wrong.The text was updated successfully, but these errors were encountered: