Skip Menu |

This queue is for tickets about the DBD-mysql CPAN distribution.

Report information
The Basics
Id: 29363
Status: resolved
Priority: 0/
Queue: DBD-mysql

People
Owner: Nobody in particular
Requestors: p.b.van.den.berg [...] rug.nl
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



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;
From: CAPTTOFU [...] cpan.org
Thank you for your bug report! I will investigate this. On Fri Sep 14 08:26:17 2007, p.b.van.den.berg@rug.nl wrote: Show quoted text
> 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;
Hi, I've created a test case for this bug report I could not longer reproduce this with the given code sample -- so we fixed the issue in the mean time. I added the code snipped from the RT ticket to t/29warnings.t to extend the test suite. https://github.com/perl5-dbi/DBD-mysql/commit/e1514f6072825c4c7c7763dba8973cc2343c9c62 -- Michiel