when a cursor is exhausted with while (sth->fetch) {...} there is no
problem. Single row fetches, however need an explicit sth->finish or
the cursor remains open. this is not a big problem, but it is annoying
to see the warnings when the statement is reused (due to caching) or the
connection is shut down
my $sth = $db->prepare_cached("select $name from options");
$sth->execute;
my @result = $sth->fetchrow_array;
+ $sth->finish;
+ undef $sth;
return $result[0];
}
push @result,
{ song => $row[0], artist => $row[1], album => $row[2] };
}
+ undef $sth;
return @result;
}