Branch Coverage

blib/lib/SQL/Translator/Producer/Oracle.pm
Criterion Covered Total %
branch 145 214 67.7


line true false branch
201 4 7 unless $no_comments
202 6 5 if $translator->quote_table_names
203 6 5 if $translator->quote_field_names
205 1 10 if ($translator->parser_type =~ /mysql/i)
206 1 0 unless $no_comments
246 3 8 if (wantarray) { }
247 0 3 defined $create ? :
273 5 17 unless $options->{'no_comments'}
275 16 6 if $options->{'add_drop_table'}
282 97 0 if ref $field_create
283 97 0 if ref $field_defs
284 97 0 if ref $trigger_defs
285 97 0 if ref $field_comments
293 5 2 if (ref $opt eq "HASH")
295 0 5 if (ref $value eq 'ARRAY') { }
0 5 elsif (not defined $value) { }
315 36 0 if ($constr)
316 7 29 if ($c->type eq 'FOREIGN KEY') { }
332 0 13 unless @fields
336 3 0 if (ref $opt eq "HASH")
338 0 3 if (ref $value eq 'ARRAY') { }
0 3 elsif (not defined $value) { }
352 3 10 @index_options ? :
354 0 13 if ($index_type eq 'PRIMARY KEY') { }
13 0 elsif ($index_type eq 'NORMAL' or $index_type eq 'UNIQUE') { }
355 0 0 $index_name ? :
364 0 0 if $WARN
369 0 22 if (my(@table_comments) = $table->comments)
371 0 0 unless $comment
374 0 0 unless $options->{'no_comments'}
378 5 17 @table_options ? :
381 2 20 $options->{'delay_constraints'} ? :
386 0 22 if ($WARN)
387 0 0 if (%truncated)
393 2 20 $options->{'delay_constraints'} ? :
404 1 3 if (not $from_field->is_nullable and $to_field->is_nullable) { }
1 2 elsif (not $from_field->is_nullable || $to_field->is_nullable) { }
405 0 1 if ($from_field->data_type =~ /text/) { }
470 1 103 if ($data_type eq 'enum') { }
0 103 elsif ($data_type eq 'set') { }
479 97 6 if (defined $translate{$data_type})
480 0 97 if (ref $translate{$data_type} eq 'ARRAY') { }
490 87 17 if (defined $max_size{$data_type})
495 46 49 ref $max_size{$data_type} eq 'ARRAY' ? :
496 0 95 if $size[$i] > $max
504 1 103 if ($data_type eq "clob" and $field->is_primary_key)
507 0 1 if $WARN
511 0 104 if ($data_type eq "clob" and $field->is_unique)
514 0 0 if $WARN
521 16 88 if ($data_type =~ /(date|clob)/i)
530 46 58 if ($data_type =~ /^($_)$/i)
536 85 19 if (defined $size[0] and $size[0] > 0)
544 36 68 if (defined $default)
552 1 35 if (ref $default and defined $$default) { }
0 35 elsif (ref $default) { }
1 34 elsif ($data_type =~ /^number$/i and not $default =~ /^-?\d+$/ and not $default =~ /null/i) { }
0 34 elsif ($data_type =~ /date/ and $default eq 'current_timestamp' || $default eq 'now()') { }
559 0 1 if ($default =~ /^true$/i) { }
0 1 elsif ($default =~ /^false$/i) { }
564 1 0 $default ? :
573 0 34 $default =~ /null/i ? :
585 47 57 unless ($field->is_nullable)
590 1 103 if $check
595 15 89 if ($field->is_auto_increment)
601 11 4 if $options->{'add_drop_table'}
621 5 99 if (my $comment = $field->comments)
625 0 5 unless $options->{'no_comments'}
656 14 0 $index_name ? :
661 0 84 unless $_
666 13 1 lc $index->type eq 'normal' ? :
14 0 $index_name ? :
679 8 1 if ($c->name) { }
1 0 elsif ($c->type eq 'PRIMARY KEY') { }
706 0 41 if not @fields and $c->type ne "CHECK"
710 20 21 if ($c->type eq 'PRIMARY KEY') { }
10 11 elsif ($c->type eq 'UNIQUE') { }
1 10 elsif ($c->type eq 'CHECK') { }
10 0 elsif ($c->type eq 'FOREIGN KEY') { }
715 2 18 if $options->{'delay_constraints'}
717 2 18 $name ? :
721 10 0 if (my $pk = $table->primary_key)
724 0 10 if $u_fields eq $pk_fields
727 10 0 if ($name) { }
731 10 0 unless $name =~ /^$table_name/
740 0 10 unless my $field_def = $table->get_field($f)
742 0 10 ref $field_def->data_type eq 'ARRAY' ? :
0 10 unless my $dtype = $translate{ref $field_def->data_type eq "ARRAY" ? $field_def->data_type->[0] : $field_def->data_type}
747 0 10 if ($WARN and $dtype =~ /clob/i)
769 10 0 if (@fields)
777 10 0 if (@rfields)
781 0 10 if ($c->match_type)
782 0 0 ' MATCH ' . $c->match_type =~ /full/i ? :
785 1 9 if ($on_delete and $on_delete ne "RESTRICT")
790 41 0 $definition ? :
801 1 5 if (my $materialized = $extra->{'materialized'})
808 5 1 if $options->{'add_drop_view'}
818 0 170 if $type =~ /^\d/
822 42 128 $type ? :
826 8 162 if length $basename > $max_name
828 42 128 $type ? :
830 0 170 if ($basename ne $basename_orig and $critical)
831 0 0 $type ? :
832 0 0 if $WARN
838 18 152 if (my $prev = $scope->{$name})
840 2 16 if length $name >= $max_id_length - 1
844 0 18 if $WARN
858 323 284 unless $q and $name