From: Peter Rabbitson Date: Fri, 26 Sep 2014 02:20:51 +0000 (+0200) Subject: Adjust Oracle joinmaker for SQLA 1.80 fixes ( part of f6fff2706 ) X-Git-Tag: v0.08271~7 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f5423b148facfb1f8b7e6a5970b9fa541a546838;p=dbsrgits%2FDBIx-Class.git Adjust Oracle joinmaker for SQLA 1.80 fixes ( part of f6fff2706 ) --- diff --git a/Changes b/Changes index d52fa61..fb3b815 100644 --- a/Changes +++ b/Changes @@ -7,6 +7,7 @@ Revision history for DBIx::Class - Fix hang in t/72pg.t when run against DBD::Pg 3.5.0. The ping() implementation changes due to RT#100648 made an alarm() based timeout lock-prone. + - Adjust Oracle SQLMaker to accommodate fixed API in SQL::Abstract * Misc - Remove warning about potential side effects of RT#79576 (scheduled) diff --git a/lib/DBIx/Class/SQLMaker/OracleJoins.pm b/lib/DBIx/Class/SQLMaker/OracleJoins.pm index b95c56e..e140d59 100644 --- a/lib/DBIx/Class/SQLMaker/OracleJoins.pm +++ b/lib/DBIx/Class/SQLMaker/OracleJoins.pm @@ -81,12 +81,21 @@ sub _recurse_oracle_joins { } # sadly SQLA treats where($scalar) as literal, so we need to jump some hoops - push @where, map { \sprintf ('%s%s = %s%s', - ref $_ ? $self->_recurse_where($_) : $self->_quote($_), - $left_join, - ref $on->{$_} ? $self->_recurse_where($on->{$_}) : $self->_quote($on->{$_}), - $right_join, - )} keys %$on; + push @where, map { \do { + my ($sql) = $self->_recurse_where({ + # FIXME - more borkage, more or less a copy of the kludge in ::SQLMaker::_join_condition() + $_ => ( length ref $on->{$_} + ? $on->{$_} + : { -ident => $on->{$_} } + ) + }); + + $sql =~ s/\s*\=/$left_join =/ + if $left_join; + + "$sql$right_join"; + } + } sort keys %$on; } return { -and => \@where };