Branch Coverage

blib/lib/SQL/Translator/Producer/Oracle.pm
Criterion Covered Total %
branch 144 214 67.2


line true false branch
201 4 3 unless $no_comments
202 4 3 if $translator->quote_table_names
203 4 3 if $translator->quote_field_names
205 1 6 if ($translator->parser_type =~ /mysql/i)
206 1 0 unless $no_comments
247 1 6 if (wantarray) { }
248 0 1 defined $create ? :
273 5 9 unless $options->{'no_comments'}
274 8 6 if $options->{'add_drop_table'}
281 53 0 if ref $field_create
282 53 0 if ref $field_defs
283 53 0 if ref $trigger_defs
284 53 0 if ref $field_comments
292 5 2 if (ref $opt eq "HASH")
294 0 5 if (ref $value eq 'ARRAY') { }
0 5 elsif (not defined $value) { }
315 16 0 if ($constr)
316 3 13 if ($c->type eq 'FOREIGN KEY') { }
333 0 7 unless @fields
337 3 0 if (ref $opt eq "HASH")
339 0 3 if (ref $value eq 'ARRAY') { }
0 3 elsif (not defined $value) { }
354 3 4 @index_options ? :
357 0 7 if ($index_type eq 'PRIMARY KEY') { }
7 0 elsif ($index_type eq 'NORMAL' or $index_type eq 'UNIQUE') { }
358 0 0 $index_name ? :
368 0 0 if $WARN
373 0 14 if (my(@table_comments) = $table->comments)
375 0 0 unless $comment
378 0 0 unless $options->{'no_comments'}
382 5 9 @table_options ? :
385 2 12 $options->{'delay_constraints'} ? :
390 0 14 if ($WARN)
391 0 0 if (%truncated)
397 2 12 $options->{'delay_constraints'} ? :
408 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) { }
409 0 1 if ($from_field->data_type =~ /text/) { }
482 1 59 if ($data_type eq 'enum') { }
0 59 elsif ($data_type eq 'set') { }
492 53 6 if (defined $translate{$data_type})
493 0 53 if (ref $translate{$data_type} eq 'ARRAY') { }
503 51 9 if (defined $max_size{$data_type})
508 26 29 ref $max_size{$data_type} eq 'ARRAY' ? :
509 0 55 if $size[$i] > $max
517 1 59 if ($data_type eq "clob" and $field->is_primary_key)
520 0 1 if $WARN
524 0 60 if ($data_type eq "clob" and $field->is_unique)
527 0 0 if $WARN
534 8 52 if ($data_type =~ /(date|clob)/i)
543 26 34 if ($data_type =~ /^($_)$/i)
549 49 11 if (defined $size[0] and $size[0] > 0)
557 16 44 if (defined $default)
565 1 15 if (ref $default and defined $$default) { }
0 15 elsif (ref $default) { }
1 14 elsif ($data_type =~ /^number$/i and not $default =~ /^-?\d+$/ and not $default =~ /null/i) { }
0 14 elsif ($data_type =~ /date/ and $default eq 'current_timestamp' || $default eq 'now()') { }
574 0 1 if ($default =~ /^true$/i) { }
0 1 elsif ($default =~ /^false$/i) { }
579 1 0 $default ? :
590 0 14 $default =~ /null/i ? :
599 35 25 unless ($field->is_nullable)
604 1 59 if $check
609 7 53 if ($field->is_auto_increment)
615 3 4 if $options->{'add_drop_table'}
635 1 59 if (my $comment = $field->comments)
640 0 1 unless $options->{'no_comments'}
671 8 0 $index_name ? :
674 0 48 unless $_
680 7 1 lc $index->type eq 'normal' ? :
8 0 $index_name ? :
694 8 1 if ($c->name) { }
1 0 elsif ($c->type eq 'PRIMARY KEY') { }
726 0 21 if not @fields and $c->type ne "CHECK"
730 12 9 if ($c->type eq 'PRIMARY KEY') { }
2 7 elsif ($c->type eq 'UNIQUE') { }
1 6 elsif ($c->type eq 'CHECK') { }
6 0 elsif ($c->type eq 'FOREIGN KEY') { }
734 2 10 if $options->{'delay_constraints'}
736 2 10 $name ? :
741 2 0 if (my $pk = $table->primary_key)
744 0 2 if $u_fields eq $pk_fields
747 2 0 if ($name) { }
750 2 0 unless $name =~ /^$table_name/
759 0 2 unless my $field_def = $table->get_field($f)
760 0 2 ref $field_def->data_type eq 'ARRAY' ? :
0 2 unless my $dtype = $translate{ref $field_def->data_type eq "ARRAY" ? $field_def->data_type->[0] : $field_def->data_type}
761 0 2 if ($WARN and $dtype =~ /clob/i)
785 6 0 if (@fields)
793 6 0 if (@rfields)
797 0 6 if ($c->match_type)
798 0 0 ' MATCH ' . $c->match_type =~ /full/i ? :
802 1 5 if ($on_delete and $on_delete ne "RESTRICT")
807 21 0 $definition ? :
818 1 1 if (my $materialized = $extra->{'materialized'})
825 1 1 if $options->{'add_drop_view'}
839 0 92 if $type =~ /^\d/
843 18 74 $type ? :
846 4 88 if length $basename > $max_name
848 18 74 $type ? :
850 0 92 if ($basename ne $basename_orig and $critical)
851 0 0 $type ? :
852 0 0 if $WARN
858 2 90 if (my $prev = $scope->{$name})
860 0 2 if length $name >= $max_id_length - 1
864 0 2 if $WARN
878 189 166 unless $q and $name