Last Comment Bug 224815 - fix for bug 212095 breaks with older DBD::mysql
: fix for bug 212095 breaks with older DBD::mysql
[fixed in 2.16.5] [does not affect tr...
Product: Bugzilla
Classification: Server Software
Component: Installation & Upgrading (show other bugs)
: 2.16.4
: All All
P1 major with 1 vote (vote)
: Bugzilla 2.16
Assigned To: Bradley Baetz (:bbaetz)
: default-qa
Depends on:
  Show dependency treegraph
Reported: 2003-11-05 11:37 PST by Christopher Wong
Modified: 2012-12-18 20:46 PST (History)
3 users (show)
justdave: approval+
See Also:
QA Whiteboard:
Iteration: ---
Points: ---

Patch for 2.16 branch (989 bytes, patch)
2004-01-17 22:03 PST, Dave Miller [:justdave] (
bbaetz: review+
myk: review+
Details | Diff | Splinter Review

Description User image Christopher Wong 2003-11-05 11:37:31 PST
User-Agent:       Opera/7.21 (X11; Linux i686; U)  [en]
Build Identifier: 

The fix for bug 212095 breaks earlier versions of DBD::mysql. I am using 
perl-DBD-MySQL-1.2216-4.i386.rpm from Red Hat 7.2, and now fails. 
The from version 2.16.3 works fine.

... has version 2.0416
... has version 1.2216

DBI is version 1.18

Please see the output below for other version numbers.

Reproducible: Always

Steps to Reproduce:

Actual Results:  
Output when running

Checking perl modules ...
Checking for       AppConfig (v1.52)   ok: found v1.55
Checking for       CGI::Carp (any)     ok: found v1.20
Checking for    Data::Dumper (any)     ok: found v2.102
Checking for     Date::Parse (any)     ok: found v2.20
Checking for             DBI (v1.13)   ok: found v1.18
Checking for      DBD::mysql (v1.2209) ok: found v2.0416
Checking for      File::Spec (v0.82)   ok: found v0.82
Checking for      File::Temp (any)     ok: found v0.12
Checking for        Template (v2.07)   ok: found v2.10
Checking for      Text::Wrap (v2001.0131) ok: found v2001.0131
Checking for       CGI::Carp (any)     ok: found v1.20

The following Perl modules are optional:
Checking for              GD (v1.19)   ok: found v1.33
Checking for     Chart::Base (v0.99)   ok: found v0.99
Checking for     XML::Parser (any)     ok: found v2.30

Checking user setup ...
Precompiling templates ...
Checking for    MySQL Server (v3.22.5) ok: found v3.23.58

Content-type: text/html

<H1>Software error:</H1>
<PRE>DBI table_info: invalid number of parameters: handle + 4
Usage: $h-&gt;table_info([ \%attr ]) at ./ line 1613.
For help, please send mail to this site's webmaster, giving this error message
and the time and date of the error.
Comment 1 User image Bradley Baetz (:bbaetz) 2003-11-05 22:52:44 PST
Try upgrading DBI to v1.19. If that fails, try the latest release.
Comment 2 User image Christopher Wong 2003-11-14 11:47:22 PST
I installed perl-DBI-1.21-1.i386.rpm from Red Hat 7.3, and now 
works fine.
Comment 3 User image Bradley Baetz (:bbaetz) 2003-11-14 15:21:06 PST
Did 1.19 not work, or was 1.21 ust hte first version you tried.? If you tried it
because it came with a redhat release, which one?
Comment 4 User image Christopher Wong 2003-11-14 18:49:10 PST
I did not find a 1.19 RPM. The 1.21 RPM came from the Red Hat 7.3 release, and 
was the first one I tried. I think the 1.18 RPM came from Red Hat 7.2, which is 
what I am running.
Comment 5 User image Bradley Baetz (:bbaetz) 2003-11-15 04:41:11 PST
Someone want to test for the lowest supported version? justdave, myk?
Comment 6 User image Dave Miller [:justdave] ( 2004-01-17 19:02:45 PST
OK, we need to do one of two things here...

1) up our minimum DBI version to the lowest one supported by the new syntax
2) special-case our table lookup to use the appropriate syntax for the version
that's installed.

The second would probably be preferable unless we can come up with some other
good excuse why we need a newer version of DBI.  The second will be the only
acceptible option on the 2.16 branch.

I'm testing now to determine the minimum version that supports this syntax.
Comment 7 User image Dave Miller [:justdave] ( 2004-01-17 20:50:44 PST
OK, minimum DBI for the syntax we're using is 1.20.

However....  any DBI < 1.25 will segfault the current 2.16 branch
on Perl 5.6.0.  DBI 1.20 and up work fine on Perl 5.6.1 and up though.
Comment 8 User image Dave Miller [:justdave] ( 2004-01-17 21:39:13 PST
Trunk (2.17.x) is immune from this, because we already require DBI 1.32.

The segfault in Perl 5.6.0 was a mismatch between DBD::mysql 2.9003 and DBI <
1.25 :)  Obviously the newer versions of DBD::mysql require newer DBIs. :)  If I
downgraded DBD::mysql to a 1.x version, the segfaults went away.
Comment 9 User image Dave Miller [:justdave] ( 2004-01-17 22:03:47 PST
Created attachment 139321 [details] [diff] [review]
Patch for 2.16 branch

If we're using DBI < 1.20 use the old syntax, otherwise use the new syntax.
Comment 10 User image Bradley Baetz (:bbaetz) 2004-01-18 04:49:24 PST
Recompling DBI means that you need to recompile DBD::*

Will that code work if DBI isn't installed? It will on trunk because thats all
in BEGIN, but I'm not sure about branch.

Also did we ever test if its < or <= that we need?
Comment 11 User image Dave Miller [:justdave] ( 2004-01-18 04:55:56 PST
checksetup will bail after the version checks long before that code is reached
if DBI isn't installed.

And yes, I tested.  1.19 errors out, 1.20 works.
Comment 12 User image Dave Miller [:justdave] ( 2004-01-19 15:46:13 PST
Anyone have any additional review comments?  Was hoping to release 2.16.5
tonight, and this would need to be in it.  It's the last one left...
Comment 13 User image Bradley Baetz (:bbaetz) 2004-01-19 16:37:51 PST
Comment on attachment 139321 [details] [diff] [review]
Patch for 2.16 branch

Does 'Eww' count as a review comment?

I guess this is OK, assuming testing and all that.
Comment 14 User image Myk Melez [:myk] [@mykmelez] 2004-01-19 18:01:25 PST
Comment on attachment 139321 [details] [diff] [review]
Patch for 2.16 branch

Nit: the global $sth declaration here is obtuse since its only obvious use at
this point in the code is for use in the else{} clause.  I suggest declaring it
within the else{} clause here and then declaring it globally farther down the
script where it actually gets used repeatedly in a global context.

Other than that, it works and looks good.

Comment 15 User image Dave Miller [:justdave] ( 2004-01-19 19:28:54 PST
Checking in;
/cvsroot/mozilla/webtools/bugzilla/,v  <--
new revision:; previous revision:

I did end up making the change Myk suggested before checking in.  I did test it
with that change, and it still works.

Note You need to log in before you can comment on or make changes to this bug.