summaryrefslogtreecommitdiffstats
path: root/Bugzilla/DB
diff options
context:
space:
mode:
authorFrédéric Buclin <LpSolit@gmail.com>2011-12-05 17:14:29 +0100
committerFrédéric Buclin <LpSolit@gmail.com>2011-12-05 17:14:29 +0100
commitb40ecc2e16d7140f99062418a5fa70d70d1b10f0 (patch)
tree263c58d52c74e094049032dd3aaaf9d06ae6d5c5 /Bugzilla/DB
parent0d83c3302d91e47a7ca4ade028d844f0f5d50ee3 (diff)
downloadbugzilla-b40ecc2e16d7140f99062418a5fa70d70d1b10f0.tar.gz
bugzilla-b40ecc2e16d7140f99062418a5fa70d70d1b10f0.tar.xz
Bug 701350: Oracle crashes if the 'maxattachmentsize' parameter is set to a too small value
r/a=mkanat
Diffstat (limited to 'Bugzilla/DB')
-rw-r--r--Bugzilla/DB/Oracle.pm8
1 files changed, 6 insertions, 2 deletions
diff --git a/Bugzilla/DB/Oracle.pm b/Bugzilla/DB/Oracle.pm
index d91eb428e..208192292 100644
--- a/Bugzilla/DB/Oracle.pm
+++ b/Bugzilla/DB/Oracle.pm
@@ -40,6 +40,8 @@ use base qw(Bugzilla::DB);
use DBD::Oracle;
use DBD::Oracle qw(:ora_types);
+use List::Util qw(max);
+
use Bugzilla::Constants;
use Bugzilla::Error;
use Bugzilla::Util;
@@ -50,6 +52,8 @@ use Bugzilla::Util;
use constant EMPTY_STRING => '__BZ_EMPTY_STR__';
use constant ISOLATION_LEVEL => 'READ COMMITTED';
use constant BLOB_TYPE => { ora_type => ORA_BLOB };
+# The max size allowed for LOB fields, in kilobytes.
+use constant MIN_LONG_READ_LEN => 32 * 1024;
use constant FULLTEXT_OR => ' OR ';
sub new {
@@ -68,8 +72,8 @@ sub new {
my $dsn = "dbi:Oracle:host=$host;sid=$dbname";
$dsn .= ";port=$port" if $port;
my $attrs = { FetchHashKeyName => 'NAME_lc',
- LongReadLen => ( Bugzilla->params->{'maxattachmentsize'}
- || 1000 ) * 1024,
+ LongReadLen => max(Bugzilla->params->{'maxattachmentsize'},
+ MIN_LONG_READ_LEN) * 1024,
};
my $self = $class->db_new({ dsn => $dsn, user => $user,
pass => $pass, attrs => $attrs });