Skip to content
Snippets Groups Projects
Commit 6091bb35 authored by Pontus Larsson's avatar Pontus Larsson
Browse files

Modified the handling of left join in generic_fetch to allow aliasing left joined tables

parent 38a39820
No related branches found
No related tags found
No related merge requests found
......@@ -450,8 +450,10 @@ sub generic_fetch {
if(@left_join_list) {
my %left_join_hash = map { $_->[0] => $_->[1] } @left_join_list;
while(my $t = shift @tabs) {
if( exists $left_join_hash{ $t->[0] } ) {
my $t_alias = $t->[0] . " " . $t->[1];
if( exists $left_join_hash{ $t->[0] } || exists $left_join_hash{$t_alias}) {
my $condition = $left_join_hash{ $t->[0] };
$condition ||= $left_join_hash{$t_alias};
my $syn = $t->[1];
$left_join .=
"\n LEFT JOIN " . $t->[0] . " $syn ON $condition ) ";
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment