| 1 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 2 | 1 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 3 | 1 | ▶ | use DBD::SQLite 1.31; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||||||||||||||||
| 5 | 1 | ▶ | BEGIN { die 'DBD::SQLite version 1.31 required (but not version 1.38_01)' if $DBD::SQLite::VERSION eq '1.38_01' } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=2 SCAR=7.6
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||||||||||||
| 7 | package # hide from PAUSE | ||||||||||||||||||||||||||||||||||||||||||
| 8 | DBIx::DBO::DBD::SQLite; | ||||||||||||||||||||||||||||||||||||||||||
| 9 | 1 | ▶ | use Carp 'croak'; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||||||||||||||||
| 11 | sub _get_table_schema { | ||||||||||||||||||||||||||||||||||||||||||
| 12 | 9 | ▶ | my($class, $me, $schema, $table) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_get_table_schema: called CC=5 SCAR=17.8
| |||||||||||||||||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||||||||||||||||
| 14 | 9 | my $q_schema = $schema; | |||||||||||||||||||||||||||||||||||||||||
| 15 | 9 | my $q_table = $table; | |||||||||||||||||||||||||||||||||||||||||
| 16 | 9 | ▶ | $q_schema =~ s/([\\_%])/\\$1/g if defined $q_schema; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 17 | 9 | $q_table =~ s/([\\_%])/\\$1/g; | |||||||||||||||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||||||||||||||||
| 19 | # Try just these types | ||||||||||||||||||||||||||||||||||||||||||
| 20 | 9 | my $info = $me->rdbh->table_info(undef, $q_schema, $q_table, | |||||||||||||||||||||||||||||||||||||||||
| 21 | 'TABLE,VIEW,GLOBAL TEMPORARY,LOCAL TEMPORARY,SYSTEM TABLE', {Escape => '\\'})->fetchall_arrayref; | ||||||||||||||||||||||||||||||||||||||||||
| 22 | 9 | ▶ | croak 'Invalid table: '.$class->_qi($me, $schema, $table) unless $info and @$info == 1 and $info->[0][2] eq $table; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%2/6
$info and @$info == 1 and $info->[0][2] eq $table
$info and @$info == 1
MC/DC0%0/3
$info and @$info == 1 and $info->[0][2] eq $table
$info
@$info == 1
$info->[0][2] eq $table
Truth table25%1/4
A and B and C
A= $infoB= @$info == 1C= $info->[0][2] eq $table
| |||||||||||||||||||||||||||||||||||||||||||
| 23 | 9 | return $info->[0][1]; | |||||||||||||||||||||||||||||||||||||||||
| 24 | } | ||||||||||||||||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||||||||||||||||
| 26 | sub _save_last_insert_id { | ||||||||||||||||||||||||||||||||||||||||||
| 27 | 7 | ▶ | my($class, $me, $sth) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_save_last_insert_id: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 28 | 7 | $sth->{Database}->last_insert_id(undef, @$me{qw(Schema Name)}, undef); | |||||||||||||||||||||||||||||||||||||||||
| 29 | } | ||||||||||||||||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||||||||||||||||
| 31 | 1 | 1; | |||||||||||||||||||||||||||||||||||||||||