my @uniq = grep { !$seen{Data::Dumper::Concise::Dumper($_)}++ } @top;
+ return \$uniq[0] if @uniq == 1;
+
return \Operator({ 'SQL.Naive' => 'AND' }, \@uniq);
}
if (! defined $self->{cond}) {
# just massage $data below
}
- elsif ($self->{cond} eq $DBIx::Class::ResultSource::UNRESOLVABLE_CONDITION) {
- %new_data = %{ $self->{attrs}{related_objects} || {} }; # nothing might have been inserted yet
- @cols_from_relations = keys %new_data;
- }
elsif (ref $self->{cond} eq 'HASH') {
# precedence must be given to passed values over values inherited from
# the cond, so the order here is important.
}
}
elsif (ref $self->{cond} eq 'REF' and ref ${$self->{cond}} eq 'HASH') {
- %new_data = %{$self->_remove_alias(
- $self->result_source
- ->_extract_fixed_values_for(${$self->{cond}}),
- $alias
- )};
+ if ((${$self->{cond}})->{'DBIx::Class::ResultSource.UNRESOLVABLE'}) {
+ %new_data = %{ $self->{attrs}{related_objects} || {} }; # nothing might have been inserted yet
+ @cols_from_relations = keys %new_data;
+ } else {
+ %new_data = %{$self->_remove_alias(
+ $self->result_source
+ ->_extract_fixed_values_for(${$self->{cond}}),
+ $alias
+ )};
+ }
}
else {
$self->throw_exception(
$self->_resolve_condition (@_);
}
-our $UNRESOLVABLE_CONDITION = \ '1 = 0';
+our $UNRESOLVABLE_CONDITION = \Literal(SQL => '1 = 0');
+
+${$UNRESOLVABLE_CONDITION}->{'DBIx::Class::ResultSource.UNRESOLVABLE'} = 1;
# Resolves the passed condition to a concrete query fragment and a flag
# indicating whether this is a cross-table condition. Also an optional