| 1 | package DBIO::MySQL::Introspect::Util; | ||||||||||||||||||||||||||||
| 2 | # ABSTRACT: Shared helpers for the MySQL/MariaDB introspect submodules | ||||||||||||||||||||||||||||
| 3 | |||||||||||||||||||||||||||||
| 4 | 46 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 46 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | 46 | our $VERSION = '0.900007'; | |||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||
| 11 | 89 | ▶ | sub keep_table { | ||||||||||||||||||||||||||
|
Subroutine
keep_table: called CC=3 SCAR=12.0
Pod
documented
| |||||||||||||||||||||||||||||
| 12 | 89 | my ($class, $tables, $name) = @_; | |||||||||||||||||||||||||||
| 13 | 89 | ▶ | return exists $tables->{ $name // '' } ? 1 : 0; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%1/2
$name // ""
MC/DC0%0/1
$name // ""
$name
Truth table50%1/2
A
A= $name
| |||||||||||||||||||||||||||||
| 14 | } | ||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||
| 17 | 78 | ▶ | sub column_size { | ||||||||||||||||||||||||||
|
Subroutine
column_size: called CC=4 SCAR=14.5
Pod
documented
| |||||||||||||||||||||||||||||
| 18 | 78 | my ($class, $column_type) = @_; | |||||||||||||||||||||||||||
| 19 | 78 | ▶ | return undef unless defined $column_type && length $column_type; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $column_type and length $column_type
MC/DC0%0/2
defined $column_type and length $column_type
defined $column_type
length $column_type
Truth table33%1/3
A and B
A= defined $column_typeB= length $column_type
| |||||||||||||||||||||||||||||
| 20 | 78 | ▶ | if ($column_type =~ /^\w+\s*\(\s*(\d+)/) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 21 | 46 | return $1 + 0; # numericify | |||||||||||||||||||||||||||
| 22 | } | ||||||||||||||||||||||||||||
| 23 | 32 | return undef; | |||||||||||||||||||||||||||
| 24 | } | ||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||
| 26 | 46 | 1; | |||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||
| 28 | __END__ | ||||||||||||||||||||||||||||