Subject: | statement handle is not closed after fetching all rows |
Hi,
statement handle is not closed after fetching all rows, e.g.:
#id is a primary key
my $sth = $dbh->prepare(q{SELECT * FROM table WHERE id = ?});
$sth->execute(52768);
$sth->fetchrow_arrayref;
$sth->fetchrow_arrayref;
$sth->fetchrow_arrayref;
# here $sth is stil active
this seems to be a bug in dbdimp.c, after patching it with:
@@ -2952,6 +2952,9 @@
do_error(sth, mysql_errno(&imp_dbh->mysql),
mysql_error(&imp_dbh->mysql));
+ if (!DBIc_COMPAT(imp_sth))
+ dbd_st_finish(sth, imp_sth);
+
return Nullav;
}
everything seems to be ok. These added lines were removed from version
3.0003.
Bug appears since version 3.0004, in 3.0003 it is ok.
I'm using DBD::mysql version 3.0006, DBI version 1.51, perl 5.8.8,
mysql-client 2.0.22.I have tried it on FreeBSD 5.4, 6.0, 6.1.
Radoslaw Pociecha