dcunningham has asked for the wisdom of the Perl Monks concerning the following question:
UPDATE: The problem was found - that $sth->execute() returns -1 on a deadlock, which is boolean true and so the fetchrow_hashref() runs. We need to check for a return code less than zero.my $sth = $db->{ 'dbh' }->prepare( $sql ); if ( $sth->execute() ) { my @rows = (); while ( my $ref = $sth->fetchrow_hashref() ) { push @rows, $ref; } return @rows; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: fetchrow_hashref failed problem
by mje (Curate) on Jul 21, 2015 at 07:57 UTC | |
|
Re: fetchrow_hashref failed problem
by 1nickt (Canon) on Jul 21, 2015 at 01:17 UTC | |
by dcunningham (Sexton) on Jul 21, 2015 at 01:34 UTC | |
by 1nickt (Canon) on Jul 21, 2015 at 02:23 UTC | |
by runrig (Abbot) on Jul 21, 2015 at 17:13 UTC | |
|
Re: fetchrow_hashref failed problem
by vinoth.ree (Monsignor) on Jul 21, 2015 at 05:46 UTC | |
by dcunningham (Sexton) on Jul 21, 2015 at 07:07 UTC |