1 package DBIx::Class::Storage::DBI::AmbiguousGlob;
6 use base 'DBIx::Class::Storage::DBI';
10 DBIx::Class::Storage::DBI::AmbiguousGlob - Storage component for RDBMS supporting multicolumn in clauses
14 Some servers choke on things like:
16 COUNT(*) FROM (SELECT tab1.col, tab2.col FROM tab1 JOIN tab2 ... )
18 claiming that col is a duplicate column (it loses the table specifiers by
19 the time it gets to the *). Thus for any subquery count we select only the
20 primary keys of the main table in the inner query. This hopefully still
21 hits the indexes and keeps the server happy.
23 At this point the only overriden method is C<_subq_count_select()>
27 sub _subq_count_select {
28 my ($self, $source, $rs_attrs) = @_;
29 my @pcols = map { join '.', $rs_attrs->{alias}, $_ } ($source->primary_columns);
30 return @pcols ? \@pcols : [ 1 ];
35 See L<DBIx::Class/CONTRIBUTORS>
39 You may distribute this code under the same terms as Perl itself.