Branch Coverage

blib/lib/SQL/Translator/Producer/Oracle.pm
Criterion Covered Total %
branch 134 202 66.3


line true false branch
199 4 6 unless $no_comments
200 6 4 if $translator->quote_table_names
201 6 4 if $translator->quote_field_names
203 1 9 if ($translator->parser_type =~ /mysql/i)
204 1 0 unless $no_comments
244 2 8 if (wantarray) { }
245 0 2 defined $create ? :
270 5 16 unless $options->{'no_comments'}
271 16 5 if $options->{'add_drop_table'}
277 84 0 if ref $field_create
278 84 0 if ref $field_defs
279 84 0 if ref $trigger_defs
280 84 0 if ref $field_comments
288 5 2 if (ref $opt eq "HASH")
290 0 5 if (ref $value eq 'ARRAY') { }
0 5 elsif (not defined $value) { }
314 0 35 if not @fields and $c->type ne "CHECK"
316 18 17 if ($c->type eq 'PRIMARY KEY') { }
10 7 elsif ($c->type eq 'UNIQUE') { }
0 7 elsif ($c->type eq 'CHECK') { }
7 0 elsif ($c->type eq 'FOREIGN KEY') { }
319 2 16 if $options->{'delay_constraints'}
321 2 16 $name ? :
326 10 0 if (my $pk = $table->primary_key)
329 0 10 if $u_fields eq $pk_fields
332 10 0 if ($name) { }
335 10 0 unless $name =~ /^$table_name/
344 0 10 unless my $field_def = $table->get_field($f)
345 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}
346 0 10 if ($WARN and $dtype =~ /clob/i)
369 7 0 if (@fields)
377 7 0 if (@rfields)
381 0 7 if ($c->match_type)
382 0 0 ' MATCH ' . $c->match_type =~ /full/i ? :
386 0 7 if ($on_delete and $on_delete ne "RESTRICT")
407 0 11 unless @fields
411 3 0 if (ref $opt eq "HASH")
413 0 3 if (ref $value eq 'ARRAY') { }
0 3 elsif (not defined $value) { }
428 3 8 @index_options ? :
431 0 11 if ($index_type eq 'PRIMARY KEY') { }
10 1 elsif ($index_type eq 'NORMAL') { }
1 0 elsif ($index_type eq 'UNIQUE') { }
432 0 0 $index_name ? :
439 10 0 $index_name ? :
448 1 0 $index_name ? :
457 0 0 if $WARN
462 0 21 if (my(@table_comments) = $table->comments)
464 0 0 unless $comment
467 0 0 unless $options->{'no_comments'}
471 5 16 @table_options ? :
475 2 19 $options->{'delay_constraints'} ? :
481 0 21 if ($WARN)
482 0 0 if (%truncated)
488 2 19 $options->{'delay_constraints'} ? :
499 0 2 if ($to_field->is_nullable and not $from_field->is_nullable) { }
1 1 elsif (not $from_field->is_nullable || $to_field->is_nullable) { }
555 1 86 if ($data_type eq 'enum') { }
0 86 elsif ($data_type eq 'set') { }
565 82 4 if (defined $translate{$data_type})
566 0 82 if (ref $translate{$data_type} eq 'ARRAY') { }
576 73 14 if (defined $max_size{$data_type})
581 41 40 ref $max_size{$data_type} eq 'ARRAY' ? :
582 0 81 if $size[$i] > $max
590 1 86 if ($data_type eq "clob" and $field->is_primary_key)
593 0 1 if $WARN
597 0 87 if ($data_type eq "clob" and $field->is_unique)
600 0 0 if $WARN
607 13 74 if ($data_type =~ /(date|clob)/i)
616 38 49 if ($data_type =~ /^($_)$/i)
622 71 16 if (defined $size[0] and $size[0] > 0)
630 35 52 if (defined $default)
637 0 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()') { }
646 0 1 if ($default =~ /^true$/i) { }
0 1 elsif ($default =~ /^false$/i) { }
651 1 0 $default ? :
662 0 34 $default =~ /null/i ? :
671 35 52 unless ($field->is_nullable)
675 1 86 if $check
680 15 72 if ($field->is_auto_increment)
685 11 4 if $options->{'add_drop_table'}
703 6 81 if (lc $field->data_type eq "timestamp")
719 5 82 if (my $comment = $field->comments)
723 0 5 unless $options->{'no_comments'}
739 1 5 if (my $materialized = $extra->{'materialized'})
746 5 1 if $options->{'add_drop_view'}
760 0 153 if $type =~ /^\d/
764 48 105 $type ? :
767 7 146 if length $basename > $max_name
769 48 105 $type ? :
771 0 153 if ($basename ne $basename_orig and $critical)
772 0 0 $type ? :
773 0 0 if $WARN
779 20 133 if (my $prev = $scope->{$name})
781 2 18 if length $name >= $max_id_length - 1
785 0 20 if $WARN
799 183 253 unless $q and $name