Ask for newer DBD::Pg in author mode, suggest the newer version otherwise (proper...
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / Storage / DBI / AmbiguousGlob.pm
CommitLineData
efe2cc83 1package DBIx::Class::Storage::DBI::AmbiguousGlob;
2
3use strict;
4use warnings;
5
6use base 'DBIx::Class::Storage::DBI';
7
8=head1 NAME
9
10DBIx::Class::Storage::DBI::AmbiguousGlob - Storage component for RDBMS supporting multicolumn in clauses
11
12=head1 DESCRIPTION
13
14Some servers choke on things like:
15
16 COUNT(*) FROM (SELECT tab1.col, tab2.col FROM tab1 JOIN tab2 ... )
17
18claiming that col is a duplicate column (it loses the table specifiers by
19the time it gets to the *). Thus for any subquery count we select only the
20primary keys of the main table in the inner query. This hopefully still
21hits the indexes and keeps the server happy.
22
618a0fe3 23At this point the only overriden method is C<_subq_count_select()>
efe2cc83 24
25=cut
26
618a0fe3 27sub _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 ];
efe2cc83 31}
32
33=head1 AUTHORS
34
35See L<DBIx::Class/CONTRIBUTORS>
36
37=head1 LICENSE
38
39You may distribute this code under the same terms as Perl itself.
40
41=cut
42
431;