Skip Menu |

This queue is for tickets about the DBI CPAN distribution.

Report information
The Basics
Id: 63349
Status: resolved
Priority: 0/
Queue: DBI

People
Owner: Nobody in particular
Requestors: ribasushi [...] leporine.io
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Weird interaction with localized $SIG{__WARN__}
As per #dbi: rabbit@Thesaurus:~$ perl -Mwarnings -MDBI -e 'my $x; my $y = "$x"; { warn "this should be hidden"; my $sth = DBI->connect(@ENV{map { "DBICTEST_MSSQL_ODBC_$_" } qw/DSN USER PASS/}, { AutoCommit => 0, RaiseError => 1 })->do ("SELECT 1") }' Use of uninitialized value $x in string at -e line 1. this should be hidden at -e line 1. Issuing rollback() due to DESTROY without explicit disconnect() of DBD::ODBC::db handle server=192.168.0.101;port=10308;database=dbic_test;driver=FreeTDS;tds_version=8.0. rabbit@Thesaurus:~$ perl -Mwarnings -MDBI -e '$SIG{__WARN__} = sub {}; my $x; my $y = "$x"; { warn "this should be hidden"; my $sth = DBI->connect(@ENV{map { "DBICTEST_MSSQL_ODBC_$_" } qw/DSN USER PASS/}, { AutoCommit => 0, RaiseError => 1 })->do ("SELECT 1") }' rabbit@Thesaurus:~$ perl -Mwarnings -MDBI -e 'local $SIG{__WARN__} = sub {}; my $x; my $y = "$x"; { warn "this should be hidden"; my $sth = DBI->connect(@ENV{map { "DBICTEST_MSSQL_ODBC_$_" } qw/DSN USER PASS/}, { AutoCommit => 0, RaiseError => 1 })->do ("SELECT 1") }' Issuing rollback() due to DESTROY without explicit disconnect() of DBD::ODBC::db handle server=192.168.0.101;port=10308;database=dbic_test;driver=FreeTDS;tds_version=8.0.
On Fri Nov 26 08:11:15 2010, RIBASUSHI wrote: Show quoted text
> As per #dbi: > > rabbit@Thesaurus:~$ perl -Mwarnings -MDBI -e 'my $x; my $y = "$x"; { > warn "this should be hidden"; my $sth = DBI->connect(@ENV{map { > "DBICTEST_MSSQL_ODBC_$_" } qw/DSN USER PASS/}, { AutoCommit => 0, > RaiseError => 1 })->do ("SELECT 1") }' > Use of uninitialized value $x in string at -e line 1. > this should be hidden at -e line 1. > Issuing rollback() due to DESTROY without explicit disconnect() of > DBD::ODBC::db handle >
server=192.168.0.101;port=10308;database=dbic_test;driver=FreeTDS;tds_ve rsion=8.0. So this one longs right, yes? Show quoted text
> rabbit@Thesaurus:~$ perl -Mwarnings -MDBI -e '$SIG{__WARN__} = sub {}; > my $x; my $y = "$x"; { warn "this should be hidden"; my $sth = > DBI->connect(@ENV{map { "DBICTEST_MSSQL_ODBC_$_" } qw/DSN USER PASS/}, > { > AutoCommit => 0, RaiseError => 1 })->do ("SELECT 1") }'
This one also looks right, yes? Show quoted text
> rabbit@Thesaurus:~$ perl -Mwarnings -MDBI -e 'local $SIG{__WARN__} = > sub > {}; my $x; my $y = "$x"; { warn "this should be hidden"; my $sth = > DBI->connect(@ENV{map { "DBICTEST_MSSQL_ODBC_$_" } qw/DSN USER PASS/}, > { > AutoCommit => 0, RaiseError => 1 })->do ("SELECT 1") }' > Issuing rollback() due to DESTROY without explicit disconnect() of > DBD::ODBC::db handle >
server=192.168.0.101;port=10308;database=dbic_test;driver=FreeTDS;tds_ve rsion=8.0. I imagine you find this one strange because no "Use of uninitialized value $x" and yet you do get "Issuing rollback" - yes? Martin -- Martin J. Evans Wetherby, UK
Apparently the DBD::ODBC connection was a red herring: rabbit@Thesaurus:~$ perl -MDBI -e '$SIG{__WARN__} = sub { print "warning\n" }; { my $sth = DBI->connect("dbi:SQLite::memory:", undef, undef, { AutoCommit => 0})->do ("SELECT 1") }' warning rabbit@Thesaurus:~$ perl -MDBI -e 'local $SIG{__WARN__} = sub { print "warning\n" }; { my $sth = DBI->connect("dbi:SQLite::memory:", undef, undef, { AutoCommit => 0})->do ("SELECT 1") }' Issuing rollback() due to DESTROY without explicit disconnect() of DBD::SQLite::db handle :memory:. rabbit@Thesaurus:~$ perl -MDBI -e 'local $SIG{__WARN__} = sub { print "warning\n" }; { my $sth = DBI->connect("dbi:SQLite::memory:", undef, undef, { AutoCommit => 0})->do ("SELECT 1") } delete $SIG{__WARN__}' warning
On Fri Nov 26 09:33:50 2010, RIBASUSHI wrote: Show quoted text
> rabbit@Thesaurus:~$ perl -MDBI -e 'local $SIG{__WARN__} = sub { print > "warning\n" }; { my $sth = DBI->connect("dbi:SQLite::memory:", undef, > undef, { AutoCommit => 0})->do ("SELECT 1") }' > Issuing rollback() due to DESTROY without explicit disconnect() of > DBD::SQLite::db handle :memory:.
My bad, the reason not everyone saw the problem was because of RT#62371. With that out of the way however the problem persists: rabbit@Imladris:~$ perl -MDBI -e '$SIG{__WARN__} = sub { print "warning\n" }; { my $sth = DBI->connect("dbi:SQLite::memory:", undef, undef, { AutoCommit => 0, PrintWarn => 1 })->do ("SELECT 1") }' warning rabbit@Imladris:~$ perl -MDBI -e 'local $SIG{__WARN__} = sub { print "warning\n" }; { my $sth = DBI->connect("dbi:SQLite::memory:", undef, undef, { AutoCommit => 0, PrintWarn => 1 })->do ("SELECT 1") }' Issuing rollback() for database handle being DESTROY'd without explicit disconnect(). rabbit@Imladris:~$ perl -MDBI -e 'local $SIG{__WARN__} = sub { print "warning\n" }; { my $sth = DBI->connect("dbi:SQLite::memory:", undef, undef, { AutoCommit => 0, PrintWarn => 1 })->do ("SELECT 1") } delete $SIG{__WARN__}' warning
This is not really a DBI problem, it is a perl idiosyncrasy. Closing this ticket, further explanation can be found here: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=dbsrgits/DBIx-Class.git;a=commitdiff;h=8e9b9ce5f997bb8f90a56ecfee9b96b0f5b6ff9d#patch2
CC: TIMB [...] cpan.org
Subject: Re: [rt.cpan.org #63349] Weird interaction with localized $SIG{__WARN__}
Date: Thu, 2 Dec 2010 17:21:55 +0000
To: Peter Rabbitson via RT <bug-DBI [...] rt.cpan.org>
From: Tim Bunce <Tim.Bunce [...] pobox.com>
On Thu, Dec 02, 2010 at 07:12:01AM -0500, Peter Rabbitson via RT wrote: Show quoted text
> This is not really a DBI problem, it is a perl idiosyncrasy. Closing > this ticket, further explanation can be found here: > http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=dbsrgits/DBIx-Class.git;a=commitdiff;h=8e9b9ce5f997bb8f90a56ecfee9b96b0f5b6ff9d#patch2
Interesting. Note that perl 5.13.<mumble> has a new optimization that'll remove the "1;" at compile time. So you may need a different dummy statement. Tim.
Re-closing. Got reopened accidentally.