Last Comment Bug 480001 - [MYSQL] max_allowed_packet is no longer allowed to be modified in session scope, and throws an error if you try in 5.1.31 and newer
: [MYSQL] max_allowed_packet is no longer allowed to be modified in session sco...
Status: RESOLVED FIXED
:
Product: Bugzilla
Classification: Server Software
Component: Database (show other bugs)
: 3.2.1
: All All
: -- major with 2 votes (vote)
: Bugzilla 3.2
Assigned To: Max Kanat-Alexander
: default-qa
Mentors:
http://bugs.mysql.com/bug.php?id=22891
: 478698 (view as bug list)
Depends on: 141951 442882
Blocks:
  Show dependency treegraph
 
Reported: 2009-02-24 10:54 PST by Dave Miller [:justdave] (justdave@bugzilla.org)
Modified: 2010-04-23 04:37 PDT (History)
11 users (show)
mkanat: approval+
LpSolit: blocking3.4+
mkanat: approval3.2+
LpSolit: blocking3.2.3+
See Also:
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
v1 (6.40 KB, patch)
2009-02-25 16:51 PST, Max Kanat-Alexander
no flags Details | Diff | Review
v2 (8.38 KB, patch)
2009-02-25 17:28 PST, Max Kanat-Alexander
LpSolit: review+
Details | Diff | Review
v2 - 3.2 (8.47 KB, patch)
2009-03-01 16:05 PST, Max Kanat-Alexander
LpSolit: review+
Details | Diff | Review

Description Dave Miller [:justdave] (justdave@bugzilla.org) 2009-02-24 10:54:36 PST
See the attached bug report.  The SQL "SET SESSION max_allowed_packet = xxxx" causes MySQL 5.1.31 and newer to throw an error.  Apparently it never worked, and rather than mislead people into thinking it did, they decided to make it throw an error so you'd know it didn't work.
Comment 1 Dave Miller [:justdave] (justdave@bugzilla.org) 2009-02-24 10:56:20 PST
Bugzilla/DB/Mysql.pm:113:    $self->do("SET SESSION max_allowed_packet = $max_allowed_packet");

Bugzilla/Install/DB.pm:3015:                $dbh->do('SET SESSION max_allowed_packet =   128000000');
Comment 2 Frédéric Buclin 2009-02-24 10:58:52 PST
Yeah, this variable is now read-only, unless set globally. Bugzilla 3.0 and older are not affected, but Bugzilla 3.2 is and cannot work with MySQL 5.1.31 and newer anymore.
Comment 3 Max Kanat-Alexander 2009-02-24 19:44:06 PST
Wow, way to go MySQL. For reference, the docs say that this variable CAN be set:

  http://dev.mysql.com/doc/refman/5.1/en/dynamic-system-variables.html

But the bug linked does indeed say that it can't.

This is a major issue because it means that bugs_fulltext may contain truncated data without MySQL having ever thrown a warning about it. We'll probably have to include a contrib/rebuild-fulltext.pl script for people now if they ever ran 3.2.(0,1,2).
Comment 4 obrand 2009-02-25 11:31:19 PST
Is there any workaround for this?  I'm doing a new installation and I'm running into this.
Comment 5 glandon 2009-02-25 11:54:52 PST
The workaround i'm using right now is to comment the 2 lines that Dave Miller point out : 

Bugzilla/DB/Mysql.pm:113:    $self->do("SET SESSION max_allowed_packet =
$max_allowed_packet");
Bugzilla/Install/DB.pm:3015:                $dbh->do('SET SESSION 
max_allowed_packet =   128000000');

and then re-run chek_setup.pl.

It's working for me, but there might be some unpredictible side effects!
Comment 6 Max Kanat-Alexander 2009-02-25 16:51:31 PST
Created attachment 364215 [details] [diff] [review]
v1

Okay, as suggested by LpSolit on IRC, I warn in checksetup now about what size max_allowed_packet needs to be. I also added back some docs about it.
Comment 7 Max Kanat-Alexander 2009-02-25 17:28:12 PST
Created attachment 364226 [details] [diff] [review]
v2

Okay, we also check the setting when people try to set maxattachmentsize now, too.
Comment 8 Frédéric Buclin 2009-02-26 13:22:44 PST
Comment on attachment 364226 [details] [diff] [review]
v2

Looks good, works fine. But your patch doesn't apply cleanly on the 3.2 branch. r=LpSolit for tip.
Comment 9 Frédéric Buclin 2009-02-26 13:23:23 PST
Holding approval till the backport is ready for checkin.
Comment 10 Max Kanat-Alexander 2009-03-01 16:05:42 PST
Created attachment 364818 [details] [diff] [review]
v2 - 3.2

Here's the 3.2 backport. Same code, just the patch didn't apply to 3.2 because the surrounding code was different.
Comment 11 Frédéric Buclin 2009-03-01 16:09:16 PST
Comment on attachment 364818 [details] [diff] [review]
v2 - 3.2

Looks good. r=LpSolit
Comment 12 Max Kanat-Alexander 2009-03-01 17:23:40 PST
tip:

Checking in Bugzilla/Config/Attachment.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Config/Attachment.pm,v  <--  Attachment.pm
new revision: 1.7; previous revision: 1.6
done
Checking in Bugzilla/Config/Common.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Config/Common.pm,v  <--  Common.pm
new revision: 1.25; previous revision: 1.24
done
Checking in Bugzilla/DB/Mysql.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/DB/Mysql.pm,v  <--  Mysql.pm
new revision: 1.72; previous revision: 1.71
done
Checking in Bugzilla/Install/DB.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Install/DB.pm,v  <--  DB.pm
new revision: 1.60; previous revision: 1.59
done
Checking in docs/en/xml/installation.xml;
/cvsroot/mozilla/webtools/bugzilla/docs/en/xml/installation.xml,v  <--  installation.xml
new revision: 1.165; previous revision: 1.164
done
Checking in template/en/default/setup/strings.txt.pl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/setup/strings.txt.pl,v  <--  strings.txt.pl
new revision: 1.11; previous revision: 1.10
done

3.2:

Checking in Bugzilla/Config/Attachment.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Config/Attachment.pm,v  <--  Attachment.pm
new revision: 1.3.4.3; previous revision: 1.3.4.2
done
Checking in Bugzilla/Config/Common.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Config/Common.pm,v  <--  Common.pm
new revision: 1.21.2.1; previous revision: 1.21
done
Checking in Bugzilla/DB/Mysql.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/DB/Mysql.pm,v  <--  Mysql.pm
new revision: 1.60.2.8; previous revision: 1.60.2.7
done
Checking in Bugzilla/Install/DB.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Install/DB.pm,v  <--  DB.pm
new revision: 1.51.2.3; previous revision: 1.51.2.2
done
Checking in docs/en/xml/installation.xml;
/cvsroot/mozilla/webtools/bugzilla/docs/en/xml/installation.xml,v  <--  installation.xml
new revision: 1.157.2.7; previous revision: 1.157.2.6
done
Checking in template/en/default/setup/strings.txt.pl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/setup/strings.txt.pl,v  <--  strings.txt.pl
new revision: 1.8.2.1; previous revision: 1.8
done
Comment 13 Marc Schumann [:Wurblzap] 2009-03-02 05:22:40 PST
*** Bug 478698 has been marked as a duplicate of this bug. ***
Comment 14 Yann 2009-08-13 04:18:47 PDT
FYI, I got the same issue on windows with Mysql 5.0.84, so it looks like they back-ported this "feature".
Comment 15 Frédéric Buclin 2010-04-23 04:37:29 PDT
*** Bug 561322 has been marked as a duplicate of this bug. ***

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