| 1 | package DBIx::Class::Storage::DBI::Pg; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 4 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 4 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||
| 6 | 4 | ▶ | use base qw/DBIx::Class::Storage::DBI/; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | 4 | ▶ | use Scope::Guard (); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 9 | 4 | ▶ | use Context::Preserve 'preserve_context'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 10 | 4 | ▶ | use DBIx::Class::Carp; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 11 | 4 | ▶ | use Try::Tiny; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 12 | 4 | ▶ | use namespace::clean; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||
| 14 | 4 | __PACKAGE__->sql_limit_dialect ('LimitOffset'); | |||||||||||||||||||||||||||
| 15 | 4 | __PACKAGE__->sql_quote_char ('"'); | |||||||||||||||||||||||||||
| 16 | 4 | __PACKAGE__->datetime_parser_type ('DateTime::Format::Pg'); | |||||||||||||||||||||||||||
| 17 | 4 | __PACKAGE__->_use_multicolumn_in (1); | |||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||
| 19 | 0 | ▶ | sub _determine_supports_insert_returning { | ||||||||||||||||||||||||||
|
Subroutine
_determine_supports_insert_returning: not called CC=2 SCAR=17.9
| |||||||||||||||||||||||||||||
| 20 | 0 | ▶ | return shift->_server_info->{normalized_dbms_version} >= 8.002 | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 21 | ? 1 | ||||||||||||||||||||||||||||
| 22 | : 0 | ||||||||||||||||||||||||||||
| 23 | ; | ||||||||||||||||||||||||||||
| 24 | } | ||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||
| 26 | 0 | ▶ | sub with_deferred_fk_checks { | ||||||||||||||||||||||||||
|
Subroutine
with_deferred_fk_checks: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 27 | 0 | my ($self, $sub) = @_; | |||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||
| 29 | 0 | my $txn_scope_guard = $self->txn_scope_guard; | |||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||
| 31 | 0 | $self->_do_query('SET CONSTRAINTS ALL DEFERRED'); | |||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||
| 33 | 0 | ▶ | my $sg = Scope::Guard->new(sub { | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 34 | 0 | $self->_do_query('SET CONSTRAINTS ALL IMMEDIATE'); | |||||||||||||||||||||||||||
| 35 | 0 | }); | |||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||
| 37 | 0 | ▶ | return preserve_context { $sub->() } after => sub { $txn_scope_guard->commit }; | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 38 | } | ||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||
| 40 | # only used when INSERT ... RETURNING is disabled | ||||||||||||||||||||||||||||
| 41 | 0 | ▶ | sub last_insert_id { | ||||||||||||||||||||||||||
|
Subroutine
last_insert_id: not called CC=4 SCAR=30.0
Pod
documented
| |||||||||||||||||||||||||||||
| 42 | 0 | my ($self,$source,@cols) = @_; | |||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||
| 44 | 0 | my @values; | |||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||
| 46 | 0 | my $col_info = $source->columns_info(\@cols); | |||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||
| 48 | 0 | for my $col (@cols) { | |||||||||||||||||||||||||||
| 49 | 0 | ▶ | my $seq = ( $col_info->{$col}{sequence} ||= $self->dbh_do('_dbh_get_autoinc_seq', $source, $col) ) | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$col_info->{$col}{"sequence"} ||= $self->dbh_do("_dbh_get_autoinc_seq", $source, $col)
MC/DC0%0/2
$col_info->{$col}{"sequence"} ||= $self->dbh_do("_dbh_get_autoinc_seq", $source, $col)
$col_info->{$col}{"sequence"}
$self->dbh_do("_dbh_get_autoinc_seq", $source, $col)
Truth table0%0/3
A ||= B
A= $col_info->{$col}{"sequence"}B= $self->dbh_do("_dbh_get_autoinc_seq", $source, $col)
| |||||||||||||||||||||||||||||
| 50 | or $self->throw_exception( sprintf( | ||||||||||||||||||||||||||||
| 51 | "Could not determine sequence for column '%s.%s', please consider adding a schema-qualified sequence to its column info", | ||||||||||||||||||||||||||||
| 52 | $source->name, | ||||||||||||||||||||||||||||
| 53 | $col, | ||||||||||||||||||||||||||||
| 54 | )); | ||||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||
| 56 | 0 | push @values, $self->_dbh->last_insert_id(undef, undef, undef, undef, {sequence => $seq}); | |||||||||||||||||||||||||||
| 57 | } | ||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||
| 59 | 0 | return @values; | |||||||||||||||||||||||||||
| 60 | } | ||||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||
| 62 | 0 | ▶ | sub _sequence_fetch { | ||||||||||||||||||||||||||
|
Subroutine
_sequence_fetch: not called CC=3 SCAR=24.8
| |||||||||||||||||||||||||||||
| 63 | 0 | my ($self, $function, $sequence) = @_; | |||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||
| 65 | 0 | ▶ | $self->throw_exception('No sequence to fetch') unless $sequence; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 66 | |||||||||||||||||||||||||||||
| 67 | 0 | ▶ | my ($val) = $self->_get_dbh->selectrow_array( | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 68 | sprintf ("select %s('%s')", $function, (ref $sequence eq 'SCALAR') ? $$sequence : $sequence) | ||||||||||||||||||||||||||||
| 69 | ); | ||||||||||||||||||||||||||||
| 70 | |||||||||||||||||||||||||||||
| 71 | 0 | return $val; | |||||||||||||||||||||||||||
| 72 | } | ||||||||||||||||||||||||||||
| 73 | |||||||||||||||||||||||||||||
| 74 | 0 | ▶ | sub _dbh_get_autoinc_seq { | ||||||||||||||||||||||||||
|
Subroutine
_dbh_get_autoinc_seq: not called CC=9 SCAR=45.0
| |||||||||||||||||||||||||||||
| 75 | 0 | my ($self, $dbh, $source, $col) = @_; | |||||||||||||||||||||||||||
| 76 | |||||||||||||||||||||||||||||
| 77 | 0 | my $schema; | |||||||||||||||||||||||||||
| 78 | 0 | my $table = $source->name; | |||||||||||||||||||||||||||
| 79 | |||||||||||||||||||||||||||||
| 80 | # deref table name if it needs it | ||||||||||||||||||||||||||||
| 81 | 0 | ▶ | $table = $$table | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 82 | if ref $table eq 'SCALAR'; | ||||||||||||||||||||||||||||
| 83 | |||||||||||||||||||||||||||||
| 84 | # parse out schema name if present | ||||||||||||||||||||||||||||
| 85 | 0 | ▶ | if( $table =~ /^(.+)\.(.+)$/ ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 86 | 0 | ( $schema, $table ) = ( $1, $2 ); | |||||||||||||||||||||||||||
| 87 | } | ||||||||||||||||||||||||||||
| 88 | |||||||||||||||||||||||||||||
| 89 | # get the column default using a Postgres-specific pg_catalog query | ||||||||||||||||||||||||||||
| 90 | 0 | my $seq_expr = $self->_dbh_get_column_default( $dbh, $schema, $table, $col ); | |||||||||||||||||||||||||||
| 91 | |||||||||||||||||||||||||||||
| 92 | # if no default value is set on the column, or if we can't parse the | ||||||||||||||||||||||||||||
| 93 | # default value as a sequence, throw. | ||||||||||||||||||||||||||||
| 94 | 0 | ▶ | unless ( defined $seq_expr and $seq_expr =~ /^nextval\(+'([^']+)'::(?:text|regclass)\)/i ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $seq_expr and $seq_expr =~ /^nextval\(+'([^']+)'::(?:text|regclass)\)/i
MC/DC0%0/2
defined $seq_expr and $seq_expr =~ /^nextval\(+'([^']+)'::(?:text|regclass)\)/i
defined $seq_expr
$seq_expr =~ /^nextval\(+'([^']+)'::(?:text|regclass)\)/i
Truth table0%0/3
A and B
A= defined $seq_exprB= $seq_expr =~ /^nextval\(+'([^']+)'::(?:text|regclass)\)/i
| |||||||||||||||||||||||||||||
| 95 | 0 | ▶ | $seq_expr = '' unless defined $seq_expr; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 96 | 0 | ▶ | $schema = "$schema." if defined $schema && length $schema; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $schema and length $schema
MC/DC0%0/2
defined $schema and length $schema
defined $schema
length $schema
Truth table0%0/3
A and B
A= defined $schemaB= length $schema
| |||||||||||||||||||||||||||||
| 97 | 0 | ▶ | $self->throw_exception( sprintf ( | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 98 | "No sequence found for '%s%s.%s', check the RDBMS table definition or explicitly set the ". | ||||||||||||||||||||||||||||
| 99 | "'sequence' for this column in %s", | ||||||||||||||||||||||||||||
| 100 | $schema ? "$schema." : '', | ||||||||||||||||||||||||||||
| 101 | $table, | ||||||||||||||||||||||||||||
| 102 | $col, | ||||||||||||||||||||||||||||
| 103 | $source->source_name, | ||||||||||||||||||||||||||||
| 104 | )); | ||||||||||||||||||||||||||||
| 105 | } | ||||||||||||||||||||||||||||
| 106 | |||||||||||||||||||||||||||||
| 107 | 0 | return $1; # exception thrown unless match is made above | |||||||||||||||||||||||||||
| 108 | } | ||||||||||||||||||||||||||||
| 109 | |||||||||||||||||||||||||||||
| 110 | # custom method for fetching column default, since column_info has a | ||||||||||||||||||||||||||||
| 111 | # bug with older versions of DBD::Pg | ||||||||||||||||||||||||||||
| 112 | 0 | ▶ | sub _dbh_get_column_default { | ||||||||||||||||||||||||||
|
Subroutine
_dbh_get_column_default: not called CC=3 SCAR=24.8
| |||||||||||||||||||||||||||||
| 113 | 0 | my ( $self, $dbh, $schema, $table, $col ) = @_; | |||||||||||||||||||||||||||
| 114 | |||||||||||||||||||||||||||||
| 115 | # Build and execute a query into the pg_catalog to find the Pg | ||||||||||||||||||||||||||||
| 116 | # expression for the default value for this column in this table. | ||||||||||||||||||||||||||||
| 117 | # If the table name is schema-qualified, query using that specific | ||||||||||||||||||||||||||||
| 118 | # schema name. | ||||||||||||||||||||||||||||
| 119 | |||||||||||||||||||||||||||||
| 120 | # Otherwise, find the table in the standard Postgres way, using the | ||||||||||||||||||||||||||||
| 121 | # search path. This is done with the pg_catalog.pg_table_is_visible | ||||||||||||||||||||||||||||
| 122 | # function, which returns true if a given table is 'visible', | ||||||||||||||||||||||||||||
| 123 | # meaning the first table of that name to be found in the search | ||||||||||||||||||||||||||||
| 124 | # path. | ||||||||||||||||||||||||||||
| 125 | |||||||||||||||||||||||||||||
| 126 | # I *think* we can be assured that this query will always find the | ||||||||||||||||||||||||||||
| 127 | # correct column according to standard Postgres semantics. | ||||||||||||||||||||||||||||
| 128 | # | ||||||||||||||||||||||||||||
| 129 | # -- rbuels | ||||||||||||||||||||||||||||
| 130 | |||||||||||||||||||||||||||||
| 131 | 0 | my $sqlmaker = $self->sql_maker; | |||||||||||||||||||||||||||
| 132 | 0 | local $sqlmaker->{bindtype} = 'normal'; | |||||||||||||||||||||||||||
| 133 | |||||||||||||||||||||||||||||
| 134 | 0 | ▶ | my ($where, @bind) = $sqlmaker->where ({ | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $schema and length $schema
MC/DC0%0/2
defined $schema and length $schema
defined $schema
length $schema
Truth table0%0/3
A and B
A= defined $schemaB= length $schema
| |||||||||||||||||||||||||||||
| 135 | 'a.attnum' => {'>', 0}, | ||||||||||||||||||||||||||||
| 136 | 'c.relname' => $table, | ||||||||||||||||||||||||||||
| 137 | 'a.attname' => $col, | ||||||||||||||||||||||||||||
| 138 | -not_bool => 'a.attisdropped', | ||||||||||||||||||||||||||||
| 139 | (defined $schema && length $schema) | ||||||||||||||||||||||||||||
| 140 | ? ( 'n.nspname' => $schema ) | ||||||||||||||||||||||||||||
| 141 | : ( -bool => \'pg_catalog.pg_table_is_visible(c.oid)' ) | ||||||||||||||||||||||||||||
| 142 | }); | ||||||||||||||||||||||||||||
| 143 | |||||||||||||||||||||||||||||
| 144 | 0 | my ($seq_expr) = $dbh->selectrow_array(<<EOS,undef,@bind); | |||||||||||||||||||||||||||
| 145 | |||||||||||||||||||||||||||||
| 146 | SELECT | ||||||||||||||||||||||||||||
| 147 | (SELECT pg_catalog.pg_get_expr(d.adbin, d.adrelid) | ||||||||||||||||||||||||||||
| 148 | FROM pg_catalog.pg_attrdef d | ||||||||||||||||||||||||||||
| 149 | WHERE d.adrelid = a.attrelid AND d.adnum = a.attnum AND a.atthasdef) | ||||||||||||||||||||||||||||
| 150 | FROM pg_catalog.pg_class c | ||||||||||||||||||||||||||||
| 151 | LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace | ||||||||||||||||||||||||||||
| 152 | JOIN pg_catalog.pg_attribute a ON a.attrelid = c.oid | ||||||||||||||||||||||||||||
| 153 | $where | ||||||||||||||||||||||||||||
| 154 | |||||||||||||||||||||||||||||
| 155 | EOS | ||||||||||||||||||||||||||||
| 156 | |||||||||||||||||||||||||||||
| 157 | 0 | return $seq_expr; | |||||||||||||||||||||||||||
| 158 | } | ||||||||||||||||||||||||||||
| 159 | |||||||||||||||||||||||||||||
| 160 | |||||||||||||||||||||||||||||
| 161 | 0 | ▶ | sub sqlt_type { | ||||||||||||||||||||||||||
|
Subroutine
sqlt_type: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 162 | 0 | return 'PostgreSQL'; | |||||||||||||||||||||||||||
| 163 | } | ||||||||||||||||||||||||||||
| 164 | |||||||||||||||||||||||||||||
| 165 | # Pg is not able to MAX(boolean_column), sigh... | ||||||||||||||||||||||||||||
| 166 | # | ||||||||||||||||||||||||||||
| 167 | # Generally it would make more sense to have this in the SQLMaker hierarchy, | ||||||||||||||||||||||||||||
| 168 | # so that eventually { -max => ... } DTRT, but plans going forward are | ||||||||||||||||||||||||||||
| 169 | # murky at best | ||||||||||||||||||||||||||||
| 170 | # --ribasushi | ||||||||||||||||||||||||||||
| 171 | # | ||||||||||||||||||||||||||||
| 172 | 2 | ▶ | sub _minmax_operator_for_datatype { | ||||||||||||||||||||||||||
|
Subroutine
_minmax_operator_for_datatype: called CC=4 SCAR=15.8
| |||||||||||||||||||||||||||||
| 173 | #my ($self, $datatype, $want_max) = @_; | ||||||||||||||||||||||||||||
| 174 | |||||||||||||||||||||||||||||
| 175 | 2 | ▶ | return ($_[2] ? 'BOOL_OR' : 'BOOL_AND') | ||||||||||||||||||||||||||
|
Branch: 2 branches
Condition50%1/2
$_[1] || ''
MC/DC0%0/1
$_[1] || ''
$_[1]
Truth table50%1/2
A
A= $_[1]
| |||||||||||||||||||||||||||||
| 176 | if ($_[1] || '') =~ /\Abool(?:ean)?\z/i; | ||||||||||||||||||||||||||||
| 177 | |||||||||||||||||||||||||||||
| 178 | 0 | shift->next::method(@_); | |||||||||||||||||||||||||||
| 179 | } | ||||||||||||||||||||||||||||
| 180 | |||||||||||||||||||||||||||||
| 181 | 0 | ▶ | sub bind_attribute_by_data_type { | ||||||||||||||||||||||||||
|
Subroutine
bind_attribute_by_data_type: not called CC=6 SCAR=37.4
Pod
documented
| |||||||||||||||||||||||||||||
| 182 | 0 | my ($self,$data_type) = @_; | |||||||||||||||||||||||||||
| 183 | |||||||||||||||||||||||||||||
| 184 | 0 | ▶ | if ($self->_is_binary_lob_type($data_type)) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 185 | # this is a hot-ish codepath, use an escape flag to minimize | ||||||||||||||||||||||||||||
| 186 | # amount of function/method calls | ||||||||||||||||||||||||||||
| 187 | # additionally version.pm is cock, and memleaks on multiple | ||||||||||||||||||||||||||||
| 188 | # ->VERSION calls | ||||||||||||||||||||||||||||
| 189 | # the flag is stored in the DBD namespace, so that Class::Unload | ||||||||||||||||||||||||||||
| 190 | # will work (unlikely, but still) | ||||||||||||||||||||||||||||
| 191 | 0 | ▶ | unless ($DBD::Pg::__DBIC_DBD_VERSION_CHECK_DONE__) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 192 | 0 | ▶ | if ($self->_server_info->{normalized_dbms_version} >= 9.0) { | ||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||
| 193 | 0 | ▶ | try { DBD::Pg->VERSION('2.17.2'); 1 } or carp ( | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 194 | __PACKAGE__.': BYTEA columns are known to not work on Pg >= 9.0 with DBD::Pg < 2.17.2' | ||||||||||||||||||||||||||||
| 195 | ); | ||||||||||||||||||||||||||||
| 196 | } | ||||||||||||||||||||||||||||
| 197 | 0 | ▶ | elsif (not try { DBD::Pg->VERSION('2.9.2'); 1 } ) { carp ( | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 198 | __PACKAGE__.': DBD::Pg 2.9.2 or greater is strongly recommended for BYTEA column support' | ||||||||||||||||||||||||||||
| 199 | )} | ||||||||||||||||||||||||||||
| 200 | |||||||||||||||||||||||||||||
| 201 | 0 | $DBD::Pg::__DBIC_DBD_VERSION_CHECK_DONE__ = 1; | |||||||||||||||||||||||||||
| 202 | } | ||||||||||||||||||||||||||||
| 203 | |||||||||||||||||||||||||||||
| 204 | 0 | return { pg_type => DBD::Pg::PG_BYTEA() }; | |||||||||||||||||||||||||||
| 205 | } | ||||||||||||||||||||||||||||
| 206 | else { | ||||||||||||||||||||||||||||
| 207 | 0 | return undef; | |||||||||||||||||||||||||||
| 208 | } | ||||||||||||||||||||||||||||
| 209 | } | ||||||||||||||||||||||||||||
| 210 | |||||||||||||||||||||||||||||
| 211 | 0 | ▶ | sub _exec_svp_begin { | ||||||||||||||||||||||||||
|
Subroutine
_exec_svp_begin: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 212 | 0 | my ($self, $name) = @_; | |||||||||||||||||||||||||||
| 213 | |||||||||||||||||||||||||||||
| 214 | 0 | $self->_dbh->pg_savepoint($name); | |||||||||||||||||||||||||||
| 215 | } | ||||||||||||||||||||||||||||
| 216 | |||||||||||||||||||||||||||||
| 217 | 0 | ▶ | sub _exec_svp_release { | ||||||||||||||||||||||||||
|
Subroutine
_exec_svp_release: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 218 | 0 | my ($self, $name) = @_; | |||||||||||||||||||||||||||
| 219 | |||||||||||||||||||||||||||||
| 220 | 0 | $self->_dbh->pg_release($name); | |||||||||||||||||||||||||||
| 221 | } | ||||||||||||||||||||||||||||
| 222 | |||||||||||||||||||||||||||||
| 223 | 0 | ▶ | sub _exec_svp_rollback { | ||||||||||||||||||||||||||
|
Subroutine
_exec_svp_rollback: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 224 | 0 | my ($self, $name) = @_; | |||||||||||||||||||||||||||
| 225 | |||||||||||||||||||||||||||||
| 226 | 0 | $self->_dbh->pg_rollback_to($name); | |||||||||||||||||||||||||||
| 227 | } | ||||||||||||||||||||||||||||
| 228 | |||||||||||||||||||||||||||||
| 229 | 0 | ▶ | sub deployment_statements { | ||||||||||||||||||||||||||
|
Subroutine
deployment_statements: not called CC=4 SCAR=30.0
Pod
documented
| |||||||||||||||||||||||||||||
| 230 | 0 | my $self = shift;; | |||||||||||||||||||||||||||
| 231 | 0 | my ($schema, $type, $version, $dir, $sqltargs, @rest) = @_; | |||||||||||||||||||||||||||
| 232 | |||||||||||||||||||||||||||||
| 233 | 0 | ▶ | $sqltargs ||= {}; | ||||||||||||||||||||||||||
|
Condition0%0/2
$sqltargs ||= {}
MC/DC0%0/1
$sqltargs ||= {}
$sqltargs
Truth table0%0/2
A
A= $sqltargs
| |||||||||||||||||||||||||||||
| 234 | |||||||||||||||||||||||||||||
| 235 | 0 | ▶ | if ( | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
not exists $sqltargs->{"producer_args"}{"postgres_version"} and my $dver = $self->_server_info->{"normalized_dbms_version"}
MC/DC0%0/2
not exists $sqltargs->{"producer_args"}{"postgres_version"} and my $dver = $self->_server_info->{"normalized_dbms_version"}
not exists $sqltargs->{"producer_args"}{"postgres_version"}
my $dver = $self->_server_info->{"normalized_dbms_version"}
Truth table0%0/3
not(A) and B
A= not exists $sqltargs->{"producer_args"}{"postgres_version"}B= my $dver = $self->_server_info->{"normalized_dbms_version"}
| |||||||||||||||||||||||||||||
| 236 | ! exists $sqltargs->{producer_args}{postgres_version} | ||||||||||||||||||||||||||||
| 237 | and | ||||||||||||||||||||||||||||
| 238 | my $dver = $self->_server_info->{normalized_dbms_version} | ||||||||||||||||||||||||||||
| 239 | ) { | ||||||||||||||||||||||||||||
| 240 | 0 | $sqltargs->{producer_args}{postgres_version} = $dver; | |||||||||||||||||||||||||||
| 241 | } | ||||||||||||||||||||||||||||
| 242 | |||||||||||||||||||||||||||||
| 243 | 0 | $self->next::method($schema, $type, $version, $dir, $sqltargs, @rest); | |||||||||||||||||||||||||||
| 244 | } | ||||||||||||||||||||||||||||
| 245 | |||||||||||||||||||||||||||||
| 246 | 4 | 1; | |||||||||||||||||||||||||||
| 247 | |||||||||||||||||||||||||||||
| 248 | __END__ | ||||||||||||||||||||||||||||