$self->{tagtree}=$self->elements_to_tree(\@elements);
if($self->{tagtree})
{
+# use Data::Dumper;
+# print Dumper $self->{tagtree};
# my ($conditions, @joins)=$self->{tagtree}->to_sql();
# print "CONDITIONS(", scalar(@joins), "): ", $conditions, "\n";
}
# print("LEFT: ", $left->print(), "\n") if ($left);
# print("RIGHT: ", $right->print(), "\n") if($right);
}
+ elsif($op eq "OR")
+ {
+ # if left child is a not, we need an extra (inner) join
+ if($left && $left->name() && $left->name() eq "NOT")
+ {
+ push(@joins, "INNER");
+ push(@outjoins, "INNER");
+ }
+ }
}
my ($rightstr, @rightjoins) = $right->to_sql($hasvals, $not, @joins) if($right);
push(@outjoins, @rightjoins);
$str="(" . $str . ")";
}
# print "STR: $str\n";
+# my @all=(@joins, @rightjoins);
+# print "JOINS: RETURN ", scalar(@outjoins), " ALL ", scalar(@all), "\n";
return($str, @outjoins);
}
}