X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FSQLMaker%2FOracleJoins.pm;h=0f50467edc5008330aa3d6926d7e8e463bf08e57;hb=757891ed5c4132d95e339212a5f66a2ee9fe4503;hp=3401a9374abab00be5466edb959bb804883c0e3d;hpb=f116ff4e8c8802234686405ad4ab44bff1a545f6;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/SQLMaker/OracleJoins.pm b/lib/DBIx/Class/SQLMaker/OracleJoins.pm index 3401a93..0f50467 100644 --- a/lib/DBIx/Class/SQLMaker/OracleJoins.pm +++ b/lib/DBIx/Class/SQLMaker/OracleJoins.pm @@ -1,5 +1,4 @@ -package # Hide from PAUSE - DBIx::Class::SQLMaker::OracleJoins; +package DBIx::Class::SQLMaker::OracleJoins; use warnings; use strict; @@ -81,12 +80,35 @@ sub _recurse_oracle_joins { && $jt !~ /inner/i; } - push @where, map { \sprintf ('%s%s = %s%s', - $self->_quote($_), - $left_join, - $self->_quote($on->{$_}), - $right_join, - )} keys %$on; + # FIXME - the code below *UTTERLY* doesn't work with custom conds... sigh + # for the time being do not do any processing with the likes of _collapse_cond + # instead only unroll the -and hack if present + $on = $on->{-and}[0] if ( + ref $on eq 'HASH' + and + keys %$on == 1 + and + ref $on->{-and} eq 'ARRAY' + and + @{$on->{-and}} == 1 + ); + + + 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 }; @@ -94,7 +116,7 @@ sub _recurse_oracle_joins { 1; -=pod +__END__ =head1 NAME @@ -102,9 +124,8 @@ DBIx::Class::SQLMaker::OracleJoins - Pre-ANSI Joins-via-Where-Clause Syntax =head1 PURPOSE -This module was originally written to support Oracle < 9i where ANSI joins -weren't supported at all, but became the module for Oracle >= 8 because -Oracle's optimising of ANSI joins is horrible. +This module is used with Oracle < 9.0 due to lack of support for standard +ANSI join syntax. =head1 SYNOPSIS @@ -153,17 +174,13 @@ Does not support full outer joins (however neither really does DBIC itself) =back -=head1 AUTHOR - -Justin Wheeler C<< >> - -=head1 CONTRIBUTORS - -David Jack Olrik C<< >> - -=head1 LICENSE +=head1 FURTHER QUESTIONS? -This module is licensed under the same terms as Perl itself. +Check the list of L. -=cut +=head1 COPYRIGHT AND LICENSE +This module is free software L +by the L. You can +redistribute it and/or modify it under the same terms as the +L.