Package: libima-dbi-perl
Severity: minor
Version: 0.34-2
Tags: patch

When rebuilding libclass-dbi-plugin-retrieveall-perl these warnings
appear:

/usr/bin/make -C . OPTIMIZE="-g -Wall -O2" test
make[1]: Entering directory 
`/home/bart/src/libclass-dbi-plugin-retrieveall-perl/libclass-dbi-plugin-retrieveall-perl-1.04'
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 
'blib/lib', 'blib/arch')" t/*.t
t/01..............prepare_cached(INSERT INTO Movies (title, year)
VALUES (?, ?)
) statement handle DBIx::ContextualFetch::st=HASH(0x852b0ac) still Active at 
/usr/share/perl5/Ima/DBI.pm line 381
prepare_cached(INSERT INTO Movies (title, year)
VALUES (?, ?)
) statement handle DBIx::ContextualFetch::st=HASH(0x852b0ac) still Active at 
/usr/share/perl5/Ima/DBI.pm line 381
prepare_cached(INSERT INTO Movies (title, year)
VALUES (?, ?)
) statement handle DBIx::ContextualFetch::st=HASH(0x852b0ac) still Active at 
/usr/share/perl5/Ima/DBI.pm line 381
prepare_cached(INSERT INTO Movies (title, year)
VALUES (?, ?)
) statement handle DBIx::ContextualFetch::st=HASH(0x852b0ac) still Active at 
/usr/share/perl5/Ima/DBI.pm line 381
prepare_cached(INSERT INTO Movies (title, year)
VALUES (?, ?)
) statement handle DBIx::ContextualFetch::st=HASH(0x852b0ac) still Active at 
/usr/share/perl5/Ima/DBI.pm line 381
prepare_cached(INSERT INTO Movies (title, year)
VALUES (?, ?)
) statement handle DBIx::ContextualFetch::st=HASH(0x852b0ac) still Active at 
/usr/share/perl5/Ima/DBI.pm line 381
ok
t/pod-coverage....ok
t/pod.............ok
All tests successful.

The attached patch suppresses these warnings, so that the above output
is reduced to this:

/usr/bin/make -C . OPTIMIZE="-g -Wall -O2" test
make[1]: Entering directory 
`/home/bart/src/libclass-dbi-plugin-retrieveall-perl/libclass-dbi-plugin-retrieveall-perl-1.04'
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 
'blib/lib', 'blib/arch')" t/*.t
t/01..............ok
t/pod-coverage....ok
t/pod.............ok
All tests successful.

Quoting from "man DBI":

$sth = $dbh->prepare_cached($statement, \%attr, $if_active)
The $if_active parameter lets you adjust the behaviour if an already
cached statement handle is still Active.
0: A warning will be generated, and finish() will be called on the
statement handle before it is returned.  This is the default behaviour
if $if_active is not passed.
1: finish() will be called on the statement handle, but the warning is
suppressed.

The patch changes if_active from 0 (the default) to 1, thereby
suppressing the warning.

diff -ruN orig/libima-dbi-perl-0.34/lib/Ima/DBI.pm libima-dbi-perl-0.34/lib/Ima/DBI.pm
--- orig/libima-dbi-perl-0.34/lib/Ima/DBI.pm	2005-09-05 11:16:44.000000000 +0200
+++ libima-dbi-perl-0.34/lib/Ima/DBI.pm	2006-11-19 07:20:12.000000000 +0100
@@ -379,7 +379,7 @@
 		# This is to do proper '%%' translation.
 		my $sql = $class->transform_sql($statement => @_);
 		return $cache
-			? $dbh->prepare_cached($sql)
+			? $dbh->prepare_cached($sql,undef,1)
 			: $dbh->prepare($sql);
 	};
 }

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to