File Coverage

blib/lib/MySQL/Partition/Type/List.pm
Criterion Covered Total %
statement 19 19 100.0
branch 6 8 75.0
condition 2 3 66.6
subroutine 4 4 100.0
pod n/a
total 31 34 91.1


line stmt bran cond sub pod time code
1             package MySQL::Partition::Type::List;
2 1     1   420 use strict;
  1         2  
  1         20  
3 1     1   4 use warnings;
  1         1  
  1         21  
4              
5 1     1   328 use parent 'MySQL::Partition';
  1         252  
  1         3  
6              
7             sub _build_partition_part {
8 3     3   9 my ($self, $partition_name, $partition_description) = @_;
9              
10 3         4 my $comment;
11 3 100 66     10 if (ref $partition_description && ref $partition_description eq 'HASH') {
12 1         2 $comment = $partition_description->{comment};
13 1 50       13 $comment =~ s/'//g if defined $comment;
14 1         2 $partition_description = $partition_description->{description};
15 1 50       3 die 'no partition_description is specified' unless $partition_description;
16             }
17 3         10 my $part = sprintf 'PARTITION %s VALUES IN (%s)', $partition_name, $partition_description;
18 3 100       9 $part .= " COMMENT = '$comment'" if $comment;
19 3         10 $part;
20             }
21              
22             1;
23             __END__