From 9495a65bec714a18a6329b68b55567917bcc21f3 Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Thu, 11 Nov 2021 20:06:45 +0000 Subject: [PATCH] fix two instances of hanging open statements 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 --- bin/mpd-feeder | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bin/mpd-feeder b/bin/mpd-feeder index 4c2c537..a170816 100755 --- a/bin/mpd-feeder +++ b/bin/mpd-feeder @@ -215,6 +215,8 @@ use Net::Async::MPD; my $sth = $db->prepare_cached("select $name from options"); $sth->execute; my @result = $sth->fetchrow_array; + $sth->finish; + undef $sth; return $result[0]; } @@ -353,6 +355,7 @@ SQL push @result, { song => $row[0], artist => $row[1], album => $row[2] }; } + undef $sth; return @result; } -- 2.39.2