Skip to content

Commit

Permalink
Fix join calculation for one-to-many indexes
Browse files Browse the repository at this point in the history
  • Loading branch information
muglug committed May 15, 2023
1 parent 048071e commit 363db04
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/Query/JoinProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,11 @@ private static function getIndexRefsFromMappings(
foreach ($left_index_pks as $left_index_pk) {
if (isset($left_mappings[$left_index_pk])) {
$index_refs[$left_index_name] ??= dict[];
$index_refs[$left_index_name][$left_index_key] = $left_mappings[$left_index_pk];
$index_refs[$left_index_name][$left_index_key] ??= keyset[];
$index_refs[$left_index_name][$left_index_key] = Keyset\union(
$index_refs[$left_index_name][$left_index_key],
$left_mappings[$left_index_pk],
);
}
}
}
Expand All @@ -441,7 +445,11 @@ private static function getIndexRefsFromMappings(
foreach ($right_index_pks as $right_index_pk) {
if (isset($right_mappings[$right_index_pk])) {
$index_refs[$right_index_name] ??= dict[];
$index_refs[$right_index_name][$right_index_key] = $right_mappings[$right_index_pk];
$index_refs[$right_index_name][$right_index_key] ??= keyset[];
$index_refs[$right_index_name][$right_index_key] = Keyset\union(
$index_refs[$right_index_name][$right_index_key],
$right_mappings[$right_index_pk],
);
}
}
}
Expand Down

0 comments on commit 363db04

Please sign in to comment.