Skip Menu |
 

This queue is for tickets about the DBD-mysql CPAN distribution.

Report information
The Basics
Id: 63700
Status: resolved
Priority: 0/
Queue: DBD-mysql

People
Owner: Nobody in particular
Requestors: JHTHORSEN [...] cpan.org
Cc:
AdminCc:

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



Subject: select GET_LOCK(?, ?) block signal handling
Download (untitled) / with headers
text/plain 170b
The attached script cannot be ended with SIGINT when $SIG{INT} is set up. The issue appears when a "SELECT GET_LOCK(?, ?)" statement waits for the lock from the database.
Subject: select-getlock.pl
Download select-getlock.pl
text/x-perl 587b
use strict; use DBI; use DBD::mysql 4.018; if($ENV{'BLOCK_SIGNAL'}) { $SIG{'INT'} = sub { die "INT!" }; } my $dbh1 = DBI->connect('DBI:mysql:database=foo', @ENV{qw/ user pw /}); my $dbh2 = DBI->connect('DBI:mysql:database=foo', @ENV{qw/ user pw /}); my $sth1 = $dbh1->prepare('SELECT GET_LOCK(?, ?)'); my $sth2 = $dbh2->prepare('SELECT GET_LOCK(?, ?)'); warn "select sth1->GET_LOCK(...)"; $sth1->execute(foo => 10); # this last will block for ten seconds, and i cannot kill it with # SIGINT/TERM when BLOCK_SIGNAL=1 warn "select sth2->GET_LOCK(...)"; $sth2->execute(foo => 10);
Download (untitled) / with headers
text/plain 237b
(I'm not sure why the body was not displayed in the first report) The attached script cannot be ended with SIGINT when $SIG{INT} is set up. The issue appears when a "SELECT GET_LOCK(?, ?)" statement waits for the lock from the database.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.