Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
f5afeb38
Commit
f5afeb38
authored
Oct 28, 2008
by
mkanat%bugzilla.org
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 141951: Set the max_packet_size for attachments (and bugs_fulltext) when connecting to MySQL
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=mkanat
parent
7caa3a5c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
34 deletions
+22
-34
Bug.pm
Bugzilla/Bug.pm
+0
-3
Constants.pm
Bugzilla/Constants.pm
+3
-0
Mysql.pm
Bugzilla/DB/Mysql.pm
+18
-0
installation.xml
docs/en/xml/installation.xml
+1
-31
No files found.
Bugzilla/Bug.pm
View file @
f5afeb38
...
...
@@ -230,9 +230,6 @@ use constant UPDATE_COMMENT_COLUMNS => qw(
# activity table.
use
constant
MAX_LINE_LENGTH
=>
254
;
# Used in _check_comment(). Gives the max length allowed for a comment.
use
constant
MAX_COMMENT_LENGTH
=>
65535
;
#####################################################################
sub
new
{
...
...
Bugzilla/Constants.pm
View file @
f5afeb38
...
...
@@ -84,6 +84,7 @@ use File::Basename;
LIST_OF_BUGS
COMMENT_COLS
MAX_COMMENT_LENGTH
CMT_NORMAL
CMT_DUPE_OF
...
...
@@ -264,6 +265,8 @@ use constant LIST_OF_BUGS => 1;
# The column length for displayed (and wrapped) bug comments.
use
constant
COMMENT_COLS
=>
80
;
# Used in _check_comment(). Gives the max length allowed for a comment.
use
constant
MAX_COMMENT_LENGTH
=>
65535
;
# The type of bug comments.
use
constant
CMT_NORMAL
=>
0
;
...
...
Bugzilla/DB/Mysql.pm
View file @
f5afeb38
...
...
@@ -51,6 +51,11 @@ use Bugzilla::DB::Schema::Mysql;
use
List::
Util
qw(max)
;
use
Text::
ParseWords
;
# This is how many comments of MAX_COMMENT_LENGTH we expect on a single bug.
# In reality, you could have a LOT more comments than this, because
# MAX_COMMENT_LENGTH is big.
use
constant
MAX_COMMENTS
=>
50
;
# This module extends the DB interface via inheritance
use
base
qw(Bugzilla::DB)
;
...
...
@@ -93,6 +98,19 @@ sub new {
}
}
# The "comments" field of the bugs_fulltext table could easily exceed
# MySQL's default max_allowed_packet. Also, MySQL should never have
# a max_allowed_packet smaller than our max_attachment_size. However,
# if we've already set a max_allowed_packet in MySQL bigger than all
# of those, we should keep it.
my
(
undef
,
$current_max_allowed
)
=
$self
->
selectrow_array
(
q{SHOW VARIABLES LIKE 'max\_allowed\_packet'}
);
my
$min_max_allowed_packet
=
MAX_COMMENTS
*
MAX_COMMENT_LENGTH
;
my
$max_allowed_packet
=
max
(
$min_max_allowed_packet
,
$current_max_allowed
,
Bugzilla
->
params
->
{
'maxattachmentsize'
});
$self
->
do
(
"SET SESSION max_allowed_packet = $max_allowed_packet"
);
return
$self
;
}
...
...
docs/en/xml/installation.xml
View file @
f5afeb38
<!-- <!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"> -->
<!-- $Id: installation.xml,v 1.16
1 2008/09/18 22:31:55 lpsolit%gmail.com
Exp $ -->
<!-- $Id: installation.xml,v 1.16
2 2008/10/28 00:59:02 mkanat%bugzilla.org
Exp $ -->
<chapter
id=
"installing-bugzilla"
>
<title>
Installing Bugzilla
</title>
...
...
@@ -787,36 +787,6 @@
</para>
</caution>
<section
id=
"install-setupdatabase"
>
<title>
Allow large attachments
</title>
<para>
By default, MySQL will only accept packets up to 64Kb in size.
If you want to have attachments larger than this, you will need
to modify your
<filename>
/etc/my.cnf
</filename>
as below.
</para>
<screen>
[mysqld]
# Allow packets up to 1M
max_allowed_packet=1M
</screen>
<para>
There is also a parameter in Bugzilla called 'maxattachmentsize'
(default = 1000 Kb) that controls the maximum allowable attachment
size. Attachments larger than
<emphasis>
either
</emphasis>
the
'max_allowed_packet' or 'maxattachmentsize' value will not be
accepted by Bugzilla.
</para>
<note>
<para>
This does not affect Big Files, attachments that are stored directly
on disk instead of in the database. Their maximum size is
controlled using the 'maxlocalattachment' parameter.
</para>
</note>
</section>
<section>
<title>
Allow small words in full-text indexes
</title>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment