From: Peter Rabbitson Date: Wed, 30 Mar 2011 11:11:28 +0000 (+0200) Subject: Fix/clarify Oracle decision whether to use WhereJoins X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=86b234150d8ab7b49520deb14428df15c3b9e60d;p=dbsrgits%2FDBIx-Class-Historic.git Fix/clarify Oracle decision whether to use WhereJoins Remove the suggestion that 8i supports ANSI but is slow - leave it as a test only (the docs are confusing enough already) --- diff --git a/lib/DBIx/Class/SQLMaker/OracleJoins.pm b/lib/DBIx/Class/SQLMaker/OracleJoins.pm index 3401a93..0313a4f 100644 --- a/lib/DBIx/Class/SQLMaker/OracleJoins.pm +++ b/lib/DBIx/Class/SQLMaker/OracleJoins.pm @@ -102,9 +102,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 diff --git a/lib/DBIx/Class/Storage/DBI/Oracle.pm b/lib/DBIx/Class/Storage/DBI/Oracle.pm index 722c624..2457596 100644 --- a/lib/DBIx/Class/Storage/DBI/Oracle.pm +++ b/lib/DBIx/Class/Storage/DBI/Oracle.pm @@ -12,7 +12,7 @@ sub _rebless { my ($self) = @_; # Default driver - my $class = $self->_server_info->{normalized_dbms_version} <= 8 + my $class = $self->_server_info->{normalized_dbms_version} < 9 ? 'DBIx::Class::Storage::DBI::Oracle::WhereJoins' : 'DBIx::Class::Storage::DBI::Oracle::Generic'; @@ -31,7 +31,7 @@ DBIx::Class::Storage::DBI::Oracle - Base class for Oracle driver This class simply provides a mechanism for discovering and loading a sub-class for a specific version Oracle backend. It should be transparent to the user. -For Oracle major versions <= 8 it loads the ::Oracle::WhereJoins subclass, +For Oracle major versions < 9 it loads the ::Oracle::WhereJoins subclass, which unrolls the ANSI join style DBIC normally generates into entries in the WHERE clause for compatibility purposes. To force usage of this version no matter the database version, add diff --git a/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm b/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm index 8c6b9d3..4bca652 100644 --- a/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm +++ b/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm @@ -70,7 +70,7 @@ DBIx::Class::Storage::DBI::Oracle::Generic - Oracle Support for DBIx::Class This class implements base Oracle support. The subclass L is for C<(+)> joins in Oracle -versions before 9. +versions before 9.0. =head1 METHODS diff --git a/lib/DBIx/Class/Storage/DBI/Oracle/WhereJoins.pm b/lib/DBIx/Class/Storage/DBI/Oracle/WhereJoins.pm index eace5ee..c0b46e8 100644 --- a/lib/DBIx/Class/Storage/DBI/Oracle/WhereJoins.pm +++ b/lib/DBIx/Class/Storage/DBI/Oracle/WhereJoins.pm @@ -21,9 +21,8 @@ support (instead of ANSI). =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 diff --git a/t/73oracle.t b/t/73oracle.t index eaea830..8bab7af 100644 --- a/t/73oracle.t +++ b/t/73oracle.t @@ -73,10 +73,13 @@ my $v = do { sprintf('%d.%03d', $1, $2); }; +# while 8i (8.1) does not document support for ansi joins, and the the drivers do not use +# them because performance sucks, there is strong evidence they are in fact supported +# means we can test 'em :) my $test_server_supports_only_orajoins = $v < 8.001; # TODO find out which version supports the RETURNING syntax -# 8i has it and earlier docs are a 404 on oracle.com +# 8i (8.1) has it and earlier docs are a 404 on oracle.com my $test_server_supports_insert_returning = $v >= 8.001; is ( @@ -383,6 +386,7 @@ sub _run_tests { $schema->storage->debug (0); local $TODO = 'Something is confusing column bindtype assignment when quotes are active' + . ': https://rt.cpan.org/Ticket/Display.html?id=64206' if $q; foreach my $type (qw( blob clob )) {