DBI::DBD informs us that
The DBI Driver.xst code will call dbd_st_finish for you, if the sth has the ACTIVE flag set, before calling dbd_st_destroy.
However, a pure perl DBD doesn't operate in such a luxurious environment, e.g.
use DBI(); $sql = 'select * from .'; $dbh = DBI->connect('dbi:ExampleP:'); $sth = $dbh->prepare($sql); $sth->execute; $sth = $dbh->prepare($sql); $sth->execute;
shows
DBI handle 0x17faf40 cleared whilst still active at active_kids.pl line 5. dbih_clearcom (sth 0x17faf40, com 0x1750b60, imp DBD::ExampleP::st): FLAGS 0x80115: COMSET Active Warn PrintError PARENT DBI::db=HASH(0x17fb620) KIDS 0 (0 Active) IMP_DATA ARRAY(0x17fb048) NUM_OF_FIELDS 14 NUM_OF_PARAMS 0 panic: DBI active kids (2) > kids (1) at DBD/ExampleP.pm line 403.
How about adding a note similar to the one in DBI's execute() doc:
If DESTROY() is called on a statement handle that's still active ($sth->{Active} is true) then it should effectively call finish().
Steffen