Branch Coverage

blib/lib/MySQL/Workbench/Parser/MySQLParser.pm
Criterion Covered Total %
branch 11 102 10.7


line true false branch
832 0 2 unless defined $main::RD_ERRORS
834 0 2 unless defined $main::RD_WARN
836 2 0 unless defined $main::RD_HINT
837 0 2 $translator->trace ? :
849 0 0 $1 && $1 > $parser_version ? :
855 0 2 unless defined $result
856 0 2 if $DEBUG
859 0 2 if $result->{'database_name'}
870 0 0 unless my $table = $schema->add_table('name', $tdata->{'table_name'})
890 0 0 unless my $field = $table->add_field('name', $fdata->{'name'}, 'data_type', $fdata->{'data_type'}, 'size', $fdata->{'size'}, 'default_value', $fdata->{'default'}, 'is_auto_increment', $fdata->{'is_auto_inc'}, 'is_nullable', $fdata->{'null'}, 'comments', $fdata->{'comments'})
893 0 0 if $fdata->{'is_primary_key'}
897 0 0 if (my $val = $fdata->{$qual} || $$fdata{uc $qual})
898 0 0 if ref $val eq 'ARRAY' and not @$val
903 0 0 if ($fdata->{'has_index'})
907 0 0 unless $table->add_index('name', '', 'type', 'NORMAL', 'fields', $fdata->{'name'})
911 0 0 if ($fdata->{'is_unique'})
915 0 0 unless $table->add_constraint('name', '', 'type', 'UNIQUE', 'fields', $fdata->{'name'})
920 0 0 unless $cdata->{'type'} eq 'foreign_key'
927 0 0 unless $tdata->{'indices'}
931 0 0 unless my $index = $table->add_index('name', $idata->{'name'}, 'type', uc $idata->{'type'}, 'fields', $idata->{'fields'})
935 0 0 unless $tdata->{'table_options'}
0 0 if (my(@options) = @{[] unless $tdata->{'table_options'};})
938 0 0 $translator->parser_args->{'ignore_opts'} ? :
940 0 0 if (@ignore_opts) { }
945 0 0 unless (exists $ignores->{$option_key})
952 0 0 unless $table->options(\@cleaned_options)
955 0 0 unless $tdata->{'constraints'}
967 0 0 unless my $constraint = $table->add_constraint('name', $cdata->{'name'}, 'type', $cdata->{'type'}, 'fields', $cdata->{'fields'}, 'expression', $cdata->{'expression'}, 'reference_table', $cdata->{'reference_table'}, 'reference_fields', $cdata->{'reference_fields'}, 'match_type', $cdata->{'match_type'} || '', 'on_delete', $cdata->{'on_delete'} || $cdata->{'on_delete_do'}, 'on_update', $cdata->{'on_update'} || $cdata->{'on_update_do'})
998 5 0 unless $_->{'alias'}
999 0 2 unless $view->{'select'}{'columns'}
1000 3 0 unless $_->{'alias'}
1001 0 2 unless $view->{'from'}{'tables'}
1026 0 0 if (not ref $size and $size eq 0)
1027 0 0 if (lc $type eq 'tinyint') { }
0 0 elsif (lc $type eq 'smallint') { }
0 0 elsif (lc $type eq 'mediumint') { }
0 0 elsif ($type =~ /^int(eger)?$/i) { }
0 0 elsif (lc $type eq 'bigint') { }
0 0 elsif (lc $type =~ /(float|double|decimal|numeric|real|fixed|dec)/) { }
1049 0 0 (ref $size || '') eq 'ARRAY' ? :
1057 0 0 if ($type =~ /^tiny(text|blob)$/i) { }
0 0 elsif ($type =~ /^(blob|text)$/i) { }
0 0 elsif ($type =~ /^medium(blob|text)$/i) { }
0 0 elsif ($type =~ /^long(blob|text)$/i) { }
1074 0 0 if ($field->data_type =~ /(set|enum)/i and not $field->size)
1077 0 0 unless $extra{'list'}
1078 0 0 if $len > $longest
1081 0 0 if $longest
1085 0 0 if ($changed)
1095 0 0 if exists $type_mapping{lc $type}
1096 0 0 if @$list