Subject: | $sth->rows doesn't work |
#!/usr/bin/perl
# $sth->rows does not work accorrding to teh DBI spec.
# Here's a test program to reproduce this bug.
use DBI;
my $dbh = DBI->connect('dbi:SQLite:dbname=test.db');
$dbh->do('CREATE TABLE test (id int)');
$dbh->do('INSERT INTO test (id) VALUES (1)');
$dbh->do('INSERT INTO test (id) VALUES (2)');
my $sth = $dbh->prepare('DELETE FROM test');
$sth->execute;
my $rows = $sth->rows;
# $rows should be 2, but is 0 instead
print "Rows affected: $rows\n";
$dbh->disconnect;