line |
true |
false |
branch |
20
|
0 |
24 |
unless $comp =~ /\A\w+\z/
|
23
|
11 |
13 |
$comp eq 'main' ? :
|
31
|
29 |
2 |
if ($sql =~ /\A\s*
create\s+table(?:\s+if\s+not\s+exists)?\s+
(?:
`([^`]+)` |
"([^"]+)" |
(\S+)
)
/six)
|
55
|
0 |
16 |
unless my($provcomp, $provver) = $row[1] =~ /\A(\w+):(\d*)\z/
|
278
|
1 |
0 |
&Scalar::Util::Numeric::isint($args{'create_from_version'}) ? :
|
|
1 |
0 |
defined $args{'create_from_version'} ? :
|
|
1 |
0 |
if defined $args{'create_from_version'} ? 1 : ($arg_err //= 'Required but not specified', 0)
|
|
0 |
1 |
if ($arg_err)
|
|
1 |
23 |
if (exists $args{'create_from_version'})
|
|
24 |
0 |
&Scalar::Util::blessed($args{'dbh'}) ? :
|
|
24 |
0 |
defined $args{'dbh'} ? :
|
|
24 |
0 |
if defined $args{'dbh'} ? 1 : ($arg_err //= 'Required but not specified', 0)
|
|
0 |
24 |
if ($arg_err)
|
|
24 |
0 |
if (exists $args{'dbh'})
|
|
0 |
24 |
unless (exists $args{'dbh'})
|
|
24 |
0 |
ref $args{'spec'} eq 'HASH' ? :
|
|
24 |
0 |
defined $args{'spec'} ? :
|
|
24 |
0 |
if defined $args{'spec'} ? 1 : ($arg_err //= 'Required but not specified', 0)
|
|
0 |
24 |
if ($arg_err)
|
|
24 |
0 |
if (exists $args{'spec'})
|
|
0 |
24 |
unless (exists $args{'spec'})
|
295
|
9 |
15 |
if (@has_meta_table)
|
302
|
9 |
15 |
if (@has_meta_table)
|
310
|
2 |
22 |
if ($spec->{'provides'}) { }
|
|
17 |
5 |
elsif ($spec->{'install'}) { }
|
316
|
1 |
4 |
if ($comp ne 'main')
|
327
|
20 |
3 |
unless my $deps = $spec->{'deps'}
|
332
|
1 |
2 |
unless defined $prov
|
341
|
1 |
1 |
unless $provver >= $reqver
|
356
|
18 |
7 |
unless $prov
|
358
|
1 |
6 |
unless $provcomp eq $comp
|
375
|
0 |
20 |
unless (defined $latest_v)
|
378
|
0 |
0 |
unless /^upgrade_to_v(\d+)$/
|
379
|
0 |
0 |
if $1 > $latest_v
|
383
|
1 |
19 |
if ($current_v > $latest_v)
|
393
|
1 |
5 |
unless $prov->[0] eq $comp
|
397
|
3 |
13 |
if (@k)
|
399
|
0 |
3 |
unless $dbh->do('DELETE FROM meta WHERE name IN (' . join(',', map({$dbh->quote($_);} @k)) . ')')
|
404
|
0 |
22 |
unless $dbh->do('INSERT INTO meta (name, value) VALUES (?, ?)', {}, "table.$t", "${comp}:$latest_v")
|
415
|
4 |
2 |
$comp eq 'main' ? :
|
420
|
6 |
0 |
if $cur_summary eq $new_summary
|
421
|
0 |
0 |
unless $dbh->do('REPLACE INTO meta (name, value) VALUES (?, ?)', {}, $key, $new_summary)
|
437
|
6 |
25 |
if $current_v >= $latest_v
|
447
|
15 |
10 |
if ($current_v == 0)
|
449
|
14 |
1 |
unless (@has_meta_table)
|
451
|
0 |
14 |
unless ($dbh->do('CREATE TABLE meta (name VARCHAR(64) NOT NULL PRIMARY KEY, value VARCHAR(255))'))
|
454
|
15 |
0 |
unless ($sv_row)
|
456
|
0 |
15 |
unless ($dbh->do("INSERT INTO meta (name,value) VALUES ('${sv_key}',0)"))
|
459
|
1 |
14 |
if ($from_v) { }
|
461
|
1 |
0 |
if ($$spec{"install_v$from_v"}) { }
|
466
|
0 |
3 |
if (ref $step eq 'CODE') { }
|
467
|
0 |
0 |
if ($@)
|
469
|
0 |
3 |
unless ($dbh->do($step))
|
474
|
0 |
1 |
unless ($dbh->do("UPDATE meta SET value=$from_v WHERE name='${sv_key}'"))
|
476
|
0 |
1 |
if ($current_v == $latest_v)
|
477
|
0 |
0 |
if (my $up_res = &$code_update_provides())
|
480
|
0 |
1 |
unless ($dbh->commit)
|
490
|
10 |
4 |
if ($spec->{'install'}) { }
|
|
4 |
0 |
elsif ($spec->{'upgrade_to_v1'}) { }
|
495
|
1 |
14 |
if (ref $step eq 'CODE') { }
|
496
|
0 |
1 |
if ($@)
|
498
|
0 |
14 |
unless ($dbh->do($step))
|
502
|
0 |
10 |
unless ($dbh->do("UPDATE meta SET value=$latest_v WHERE name='${sv_key}'"))
|
504
|
0 |
10 |
if (my $up_res = &$code_update_provides())
|
506
|
0 |
10 |
unless ($dbh->commit)
|
525
|
0 |
14 |
unless ($$spec{"upgrade_to_v$next_v"})
|
529
|
1 |
24 |
if (ref $step eq 'CODE') { }
|
530
|
1 |
0 |
if ($@)
|
532
|
2 |
22 |
unless ($dbh->do($step))
|
537
|
0 |
11 |
unless ($dbh->do("UPDATE meta SET value=$next_v WHERE name='${sv_key}'"))
|
539
|
6 |
5 |
if ($current_v == $latest_v)
|
540
|
0 |
6 |
if (my $up_res = &$code_update_provides())
|
541
|
0 |
6 |
if (my $us_res = &$code_update_summary())
|
544
|
0 |
11 |
unless ($dbh->commit)
|
551
|
3 |
16 |
if ($res->[0] != 200) { }
|
553
|
3 |
0 |
unless $db_state eq 'committed'
|
555
|
0 |
16 |
unless $db_state eq 'committed'
|