Subject: | "AS" is added to GROUP BY when using slice |
"AS" be added to GROUP BY when using slice.
For example, when the following script is processed, the following wrong
query is generated.
#### Script ####
my $rs = $self->resultset('artist')->search({}, {group_by => [qw( name )]});
my ($artist) = $rs->slice(0);
$artist->artistid;
#### Generated SQL ####
SELECT * FROM
(
SELECT A.*, ROWNUM r FROM
(
SELECT me.artistid AS col1, me.name AS col2 FROM artist me GROUP
BY name AS col3
) A
WHERE ROWNUM < 2
) B
WHERE r >= 1
* My test environment
- Perl v5.8.8 built for i686-linux
- DBIx::Class 0.07999_02
- DBI 1.53
- DBD::Oracle 1.19
- Oracle 9.2.0.1