Subject: | different warning counts in $sth->{'mysql_warning_count'} and $dbh->{'info'} |
Date: | Fri, 14 Sep 2007 14:20:43 +0200 |
To: | bug-DBD-mysql [...] rt.cpan.org |
From: | Paul B van den Berg <p.b.van.den.berg [...] rug.nl> |
Output from the program at the bottom of this message:
warning count: 2
info: Records: 3 Duplicates: 0 Warnings: 1
So it seems that $dbh->{'info'} does not always return the correct number of warnings.
Regards, Paul
My system:
perl -MDBI -e 'DBI->installed_versions'
Perl : 5.008008 (i486-linux-gnu-thread-multi)
OS : linux (2.6.18.3)
DBI : 1.53
DBD::mysql : 4.005
mysql -e "select version()"
| 5.0.32-Debian_7etch1-log |
#!/usr/bin/perl -w
use DBI;
use strict;
my $dbh = DBI->connect("DBI:mysql:database=test","root","")
or die $DBI::errstr;
$dbh->do( q{ create table if not exists t (i tinyint not null) } );
my $q = "insert into t values (333),('as'),(3)";
my $sth = $dbh->prepare($q);
$sth->execute() or die "query error\n";
print "warning count: $sth->{'mysql_warning_count'}\n";
#$sth = $dbh->do($q) or die "query error\n";
print "info: $dbh->{'info'}\n";
$dbh->disconnect;