use Scalar::Util qw/weaken blessed/;
use Try::Tiny;
+use DBIx::Class::_Util 'UNRESOLVABLE_CONDITION';
use namespace::clean;
=head1 NAME
}
catch {
$self->throw_exception ($_) if $self->in_storage;
- $DBIx::Class::ResultSource::UNRESOLVABLE_CONDITION; # RV, no return()
+ UNRESOLVABLE_CONDITION; # RV, no return()
};
# keep in mind that the following if() block is part of a do{} - no return()s!!!
# FIXME - this conditional doesn't seem correct - got to figure out
# at some point what it does. Also the entire UNRESOLVABLE_CONDITION
# business seems shady - we could simply not query *at all*
- if ($cond eq $DBIx::Class::ResultSource::UNRESOLVABLE_CONDITION) {
+ if ($cond eq UNRESOLVABLE_CONDITION) {
my $reverse = $rsrc->reverse_relationship_info($rel);
foreach my $rev_rel (keys %$reverse) {
if ($reverse->{$rev_rel}{attrs}{accessor} && $reverse->{$rev_rel}{attrs}{accessor} eq 'multi') {
use DBIx::Class::ResultSetColumn;
use Scalar::Util qw/blessed weaken reftype/;
use DBIx::Class::_Util qw(
- fail_on_internal_wantarray is_plain_value is_literal_value
+ fail_on_internal_wantarray is_plain_value is_literal_value UNRESOLVABLE_CONDITION
);
use Try::Tiny;
use Data::Compare (); # no imports!!! guard against insane architecture
if (! defined $self->{cond}) {
# just massage $data below
}
- elsif ($self->{cond} eq $DBIx::Class::ResultSource::UNRESOLVABLE_CONDITION) {
+ elsif ($self->{cond} eq UNRESOLVABLE_CONDITION) {
%new_data = %{ $self->{attrs}{related_objects} || {} }; # nothing might have been inserted yet
@cols_from_relations = keys %new_data;
}
use DBIx::Class::ResultSourceHandle;
use DBIx::Class::Carp;
-use DBIx::Class::_Util 'is_literal_value';
+use DBIx::Class::_Util qw(is_literal_value UNRESOLVABLE_CONDITION);
use Devel::GlobalDestruction;
use Try::Tiny;
use List::Util 'first';
return wantarray ? @res : $res[0];
}
-our $UNRESOLVABLE_CONDITION = \ '1 = 0';
+# Keep this indefinitely. There is evidence of both CPAN and
+# darkpan using it, and there isn't much harm in an extra var
+# anyway.
+our $UNRESOLVABLE_CONDITION = UNRESOLVABLE_CONDITION;
+# YES I KNOW THIS IS EVIL
+# it is there to save darkpan from themselves, since internally
+# we are moving to a constant
+Internals::SvREADONLY($UNRESOLVABLE_CONDITION => 1);
# Resolves the passed condition to a concrete query fragment and a flag
# indicating whether this is a cross-table condition. Also an optional
$obj_cols->[$i],
) if $obj->in_storage;
- return $UNRESOLVABLE_CONDITION;
+ return UNRESOLVABLE_CONDITION;
}
else {
$cond->{"$plain_alias.$plain_cols->[$i]"} = $obj->get_column($obj_cols->[$i]);
}
elsif (ref $args->{condition} eq 'ARRAY') {
if (@{$args->{condition}} == 0) {
- return $UNRESOLVABLE_CONDITION;
+ return UNRESOLVABLE_CONDITION;
}
elsif (@{$args->{condition}} == 1) {
return $self->_resolve_relationship_condition({
sigwarn_silencer modver_gt_or_eq fail_on_internal_wantarray
refcount hrefaddr is_exception
is_plain_value is_literal_value
+ UNRESOLVABLE_CONDITION
);
+use constant UNRESOLVABLE_CONDITION => \ '1 = 0';
+
sub sigwarn_silencer ($) {
my $pattern = shift;