Merge badness
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / Storage / DBI / AmbiguousGlob.pm
CommitLineData
48fe9087 1package DBIx::Class::Storage::DBI::AmbiguousGlob;\r
2\r
3use strict;\r
4use warnings;\r
5\r
6use base 'DBIx::Class::Storage::DBI';\r
7\r
8=head1 NAME\r
9\r
10DBIx::Class::Storage::DBI::AmbiguousGlob - Storage component for RDBMS supporting multicolumn in clauses\r
11\r
12=head1 DESCRIPTION\r
13\r
14Some servers choke on things like:\r
15\r
16 COUNT(*) FROM (SELECT tab1.col, tab2.col FROM tab1 JOIN tab2 ... )\r
17\r
18claiming that col is a duplicate column (it loses the table specifiers by\r
19the time it gets to the *). Thus for any subquery count we select only the\r
20primary keys of the main table in the inner query. This hopefully still\r
21hits the indexes and keeps the server happy.\r
22\r
23At this point the only overriden method is C<_grouped_count_select()>\r
24\r
25=cut\r
26\r
27sub _grouped_count_select {\r
28 my ($self, $source, $rs_args) = @_;\r
29 my @pcols = map { join '.', $rs_args->{alias}, $_ } ($source->primary_columns);\r
30 return @pcols ? \@pcols : $rs_args->{group_by};\r
31}\r
32\r
33=head1 AUTHORS\r
34\r
35See L<DBIx::Class/CONTRIBUTORS>\r
36\r
37=head1 LICENSE\r
38\r
39You may distribute this code under the same terms as Perl itself.\r
40\r
41=cut\r
42\r
431;\r