1
package GenTest::Transform::Distinct;
5
use GenTest::Constants;
8
my ($class, $orig_query) = @_;
10
# At this time we do not handle LIMIT because it may cause
11
# both duplicate elimination AND extra rows to appear
13
return STATUS_WONT_HANDLE if $orig_query =~ m{LIMIT}io;
15
if ($orig_query =~ m{SELECT\s+DISTINCT}io) {
16
$orig_query =~ s{SELECT\s+DISTINCT}{SELECT }io;
17
return $orig_query." /* TRANSFORM_OUTCOME_SUPERSET */ ";
19
$orig_query =~ s{SELECT}{SELECT DISTINCT}io;
20
return $orig_query." /* TRANSFORM_OUTCOME_DISTINCT */ ";