Branch Coverage

blib/lib/DBIx/Pg/CallFunction.pm
Criterion Covered Total %
branch 0 68 0.0


line true false branch
167 0 0 if (defined $params)
169 0 0 if exists $$params{'RaiseError'}
170 0 0 if exists $$params{'EnableFunctionLookupCache'}
173 0 0 if (scalar keys %{$params;} > 0)
196 0 0 if $name =~ /DESTROY$/
209 0 0 defined $namespace ? :
239 0 0 if ($$self{'EnableFunctionLookupCache'})
242 0 0 if (exists $$self{'proretset_cache'}{$cachekey})
250 0 0 if (@$argnames == 0) { }
265 0 0 unless $get_proretset = $$self{'dbh'}->prepare_cached("\n WITH\n -- Unnest the proargname and proargmode\n -- arrays, so we get one argument per row,\n -- allowing us to select only the IN\n -- arguments and build new arrays.\n NamedInputArgumentFunctions AS (\n -- For functions with INOUT/OUT arguments,\n -- proargmodes is an array where each\n -- position matches proargname and\n -- indicates if its an IN, OUT or INOUT\n -- argument.\n SELECT\n pg_catalog.pg_proc.oid,\n pg_catalog.pg_proc.proname,\n pg_catalog.pg_proc.proretset,\n pg_catalog.pg_proc.pronargdefaults,\n unnest(pg_catalog.pg_proc.proargnames) AS proargname,\n unnest(pg_catalog.pg_proc.proargmodes) AS proargmode\n FROM pg_catalog.pg_proc\n INNER JOIN pg_catalog.pg_namespace ON (pg_catalog.pg_namespace.oid = pg_catalog.pg_proc.pronamespace)\n WHERE (?::name IS NULL OR pg_catalog.pg_namespace.nspname = ?::name)\n AND pg_catalog.pg_proc.proname = ?::name\n AND pg_catalog.pg_proc.proargnames IS NOT NULL\n AND pg_catalog.pg_proc.proargmodes IS NOT NULL\n ),\n OnlyINandINOUTArguments AS (\n -- Select only the IN and INOUT\n -- arguments and build new arrays\n SELECT\n oid,\n proname,\n proretset,\n pronargdefaults,\n array_agg(proargname) AS proargnames\n FROM NamedInputArgumentFunctions\n WHERE proargmode IN ('i','b')\n GROUP BY\n oid,\n proname,\n proretset,\n pronargdefaults\n UNION ALL\n -- For functions with only IN arguments,\n -- proargmodes IS NULL\n SELECT\n pg_catalog.pg_proc.oid,\n pg_catalog.pg_proc.proname,\n pg_catalog.pg_proc.proretset,\n pg_catalog.pg_proc.pronargdefaults,\n pg_catalog.pg_proc.proargnames\n FROM pg_catalog.pg_proc\n INNER JOIN pg_catalog.pg_namespace ON (pg_catalog.pg_namespace.oid = pg_catalog.pg_proc.pronamespace)\n WHERE (?::name IS NULL OR pg_catalog.pg_namespace.nspname = ?::name)\n AND pg_catalog.pg_proc.proname = ?::name\n AND pg_catalog.pg_proc.proargnames IS NOT NULL\n AND pg_catalog.pg_proc.proargmodes IS NULL\n )\n -- Find any function matching the name\n -- and having identical argument names\n SELECT * FROM OnlyINandINOUTArguments\n WHERE ?::text[] <\@ proargnames AND ((\n -- No default arguments\n pronargdefaults = 0 AND ?::text[] \@> proargnames\n ) OR (\n -- Default arguments, only require first input arguments to match\n pronargdefaults > 0 AND ?::text[] \@> proargnames[\n 1\n :\n array_upper(proargnames,1) - pronargdefaults\n ]\n ))\n -- The order of arguments doesn't matter,\n -- so compare the arrays by checking\n -- if A contains B and B contains A\n ")
341 0 0 unless $get_proretset->execute($namespace, $namespace, $name, $namespace, $namespace, $name, $argnames, $argnames, $argnames)
352 0 0 if ($i == 0) { }
0 0 elsif ($i == 1) { }
360 0 0 if $$self{'EnableFunctionLookupCache'}
376 0 0 unless (defined $args)
381 0 0 unless defined $$self{'dbh'} and defined $name
382 0 0 unless not defined $namespace or $namespace =~ /$validate_name_regex/
383 0 0 unless $name =~ /$validate_name_regex/
384 0 0 unless ref $args eq 'HASH'
391 0 0 unless ($arg_name =~ /$validate_name_regex/)
400 0 0 defined $namespace ? :
414 0 0 if ($failed and $$self{'EnableFunctionLookupCache'})
432 0 0 if scalar grep({$_ eq $query->state;} @sqlstates) > 0
436 0 0 if ($failed and $$self{'RaiseError'}) { }
0 0 elsif ($failed) { }
453 0 0 if ($row_number == 0)
457 0 0 unless $num_cols >= 1
459 0 0 if ($proretset == 0) { }
0 0 elsif ($proretset == 1) { }
462 0 0 if defined $output
463 0 0 if ($num_cols == 1) { }
0 0 elsif ($num_cols > 1) { }
477 0 0 if ($num_cols == 1) { }
0 0 elsif ($num_cols > 1) { }