diff options
author | Dave Lawrence <dlawrence@mozilla.com> | 2011-12-08 21:01:57 +0100 |
---|---|---|
committer | Dave Lawrence <dlawrence@mozilla.com> | 2011-12-08 21:01:57 +0100 |
commit | 60fb0c9b84f771a16a8abed0e1847b409b197217 (patch) | |
tree | 91630354cc75f081c38a95a30907e9aa2647bc13 /Bugzilla/DB/Oracle.pm | |
parent | 720db163b9814b294b163347d994e513b8771ae7 (diff) | |
parent | 62410084926e1473c903c43b53d09c99311746c2 (diff) | |
download | bugzilla-60fb0c9b84f771a16a8abed0e1847b409b197217.tar.gz bugzilla-60fb0c9b84f771a16a8abed0e1847b409b197217.tar.xz |
merged with bugzilla/4.2
Diffstat (limited to 'Bugzilla/DB/Oracle.pm')
-rw-r--r-- | Bugzilla/DB/Oracle.pm | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/Bugzilla/DB/Oracle.pm b/Bugzilla/DB/Oracle.pm index d91eb428e..711b84141 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 }); @@ -156,13 +160,6 @@ sub sql_string_concat { return 'CONCAT(' . join(', ', @params) . ')'; } -sub sql_string_until { - my ($self, $string, $substring) = @_; - return "SUBSTR($string, 1, " - . $self->sql_position($substring, $string) - . " - 1)"; -} - sub sql_to_days { my ($self, $date) = @_; |