Paul Silevitch | 6 Aug 2010 16:42

Re: selectrow_hashref() propagating wrong message (bug in DBD::mysql)

Hello All,

I have started to see random "fetch() without execute()" messages on a
production when mysql is under heavy load.  I believe the thread below
describes my problem (from dbi-dev mailing list circa 2007).  The production
system is currently using an older version of DBD::mysql and I wanted to
make sure this bug was fixed before scheduling an upgrade.  I looked through
changesets on github and couldn't pinpoint when it was fixed.  I tried to
compare the error handling between trunk and my version and couldn't see any
major difference (forgive me, it is my first time looking through dbd::mysql
source).  My question is was this fixed?  And if so, what was the fix?

Thanks,

Paul

===============

HTML version of the thread =>
http://www.nntp.perl.org/group/perl.dbi.dev/2007/03/msg4881.html

===============

From:
Patrick Galbraith
Date:
March 5, 2007 13:51
Subject:
Re: selectrow_hashref() propagating wrong message (bug in DBD::mysql)
Message ID:
(Continue reading)

Paul Silevitch | 27 Oct 2010 19:53

Re: selectrow_hashref() propagating wrong message (bug in DBD::mysql)

I finally figured out the problem.  The situation happens when an execute
has an error and row_num is -1 (unknown number of rows).  There are a bunch
of ways to solve the problem, I added the following block before the last
return in dbd_st_execute in dbdimp.c:

1712a1713,1716
> /* patch added to catch case where an error has occurred and
imp_sth->row_num = -1 (unknown number of rows) */
> if (mysql_errno(&imp_dbh->mysql) && imp_sth->row_num == -1) {
> return -2;
> }

I confirmed that this bug happens in the current version of DBD::mysql too.
 Please note the above diff is for my older version of the module and the
same fix will work but the line numbers in the above diff will probably be
off.

Thanks,

Paul

On Fri, Aug 6, 2010 at 10:42 AM, Paul Silevitch <paul <at> silevitch.com> wrote:

> Hello All,
>
> I have started to see random "fetch() without execute()" messages on a
> production when mysql is under heavy load.  I believe the thread below
> describes my problem (from dbi-dev mailing list circa 2007).  The production
> system is currently using an older version of DBD::mysql and I wanted to
> make sure this bug was fixed before scheduling an upgrade.  I looked through
(Continue reading)


Gmane