Hello all. I'm trying to fix a problem in DBIx::Timeout where a warning gets printed when the timeout kills a MySQL thread. This warning isn't affected by the DBI Warn or PrintWarn attributes. It looks like:

   DBD::mysql::db selectcol_arrayref failed: Unknown error at ...

I can catch it with $SIG{__WARN__} but I'm having a hard time figuring out where it's coming from. I tried sticking a call to Devel::StackTrace in a $SIG{__WARN__} handler, but that didn't show me a source. I also tried greping DBD::mysql and DBI for the warning text, without luck.

Any ideas about how I can find the source of this warning?

UPDATE: I found the source of the warning. The DBI PrintError attribute was set on, and amazingly can't be turned off after connect(). Trying to set this attribute to 0 turns it on as surely as 1. Remind me again why DBI had to reimplement hashes?

UPDATE 2: Ok, it seems you can turn PrintError off, but connect_cached() will turn it back on. Stills seems wrong, but less wrong than not being able to turn it off at all.

-sam


In reply to Tracing a warning by samtregar

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.