diff --git a/etc/RT_Config.pm.in b/etc/RT_Config.pm.in index 5ec562cdece..22d6ddf5fec 100755 --- a/etc/RT_Config.pm.in +++ b/etc/RT_Config.pm.in @@ -370,11 +370,14 @@ Set($StoreLoops, undef); C<$MaxAttachmentSize> sets the maximum size (in bytes) of attachments stored in the database. This setting is irrelevant unless one of -$TruncateLongAttachments or $DropLongAttachments (below) are set. +$TruncateLongAttachments or $DropLongAttachments (below) are set, B +the database is stored in Oracle. On Oracle, attachments larger than +this can be fully stored, but will be truncated to this length when +read. =cut -Set($MaxAttachmentSize, 10_000_000); +Set($MaxAttachmentSize, 10_000_000); # 10M =item C<$TruncateLongAttachments> diff --git a/lib/RT/Handle.pm b/lib/RT/Handle.pm index 4b3e5dcb614..9a481a97e4d 100644 --- a/lib/RT/Handle.pm +++ b/lib/RT/Handle.pm @@ -83,17 +83,17 @@ L, using the C configuration. =cut sub FinalizeDatabaseType { - eval { - use base "DBIx::SearchBuilder::Handle::". RT->Config->Get('DatabaseType'); - }; - my $db_type = RT->Config->Get('DatabaseType'); - if ($@) { + my $package = "DBIx::SearchBuilder::Handle::$db_type"; + + unless (eval "require $package; 1;") { die "Unable to load DBIx::SearchBuilder database handle for '$db_type'.\n". "Perhaps you've picked an invalid database type or spelled it incorrectly.\n". $@; } + @RT::Handle::ISA = ($package); + # We use COLLATE NOCASE to enforce case insensitivity on the normally # case-sensitive SQLite, LOWER() approach works, but lucks performance # due to absence of functional indexes diff --git a/lib/RT/Interface/Web/Session.pm b/lib/RT/Interface/Web/Session.pm index f2dd603fa32..ee685ace226 100644 --- a/lib/RT/Interface/Web/Session.pm +++ b/lib/RT/Interface/Web/Session.pm @@ -131,6 +131,8 @@ sub Attributes { Transaction => 1, }; } + $res->{LongReadLen} = RT->Config->Get('MaxAttachmentSize') + if $class->isa('Apache::Session::Oracle'); return $res; } diff --git a/t/api/db_indexes.t b/t/api/db_indexes.t index 947a59cf49a..3c305d84d9f 100644 --- a/t/api/db_indexes.t +++ b/t/api/db_indexes.t @@ -17,11 +17,7 @@ note "test handle->Indexes method"; my %indexes = $handle->Indexes; ok grep $_ eq 'tickets1', @{ $indexes{'tickets'} }; ok grep $_ eq 'tickets2', @{ $indexes{'tickets'} }; - if ($db_type eq 'Oracle') { - ok grep $_ eq 'users2', @{ $indexes{'users'} }; - } else { - ok grep $_ eq 'users1', @{ $indexes{'users'} }; - } + ok grep $_ eq 'users1', @{ $indexes{'users'} }; ok grep $_ eq 'users4', @{ $indexes{'users'} }; } diff --git a/t/charts/basics.t b/t/charts/basics.t index 306eaa5003a..0f93e5a2433 100644 --- a/t/charts/basics.t +++ b/t/charts/basics.t @@ -26,6 +26,7 @@ use_ok 'RT::Report::Tickets'; GroupBy => ['Status'], Function => ['COUNT'], ); + $report->SortEntries; my @colors = RT->Config->Get("ChartColors"); my $expected = { diff --git a/t/charts/compound-sql-function.t b/t/charts/compound-sql-function.t index 96000fa6a57..3e6a3fdfe72 100644 --- a/t/charts/compound-sql-function.t +++ b/t/charts/compound-sql-function.t @@ -33,6 +33,7 @@ use_ok 'RT::Report::Tickets'; GroupBy => ['Queue'], Function => ['ALL(Created-Resolved)'], ); + $report->SortEntries; my @colors = RT->Config->Get("ChartColors"); my $expected = { diff --git a/t/charts/group-by-cf.t b/t/charts/group-by-cf.t index 12296b89a41..f6bfb35e4c3 100644 --- a/t/charts/group-by-cf.t +++ b/t/charts/group-by-cf.t @@ -29,6 +29,7 @@ use_ok 'RT::Report::Tickets'; GroupBy => ["CF.{$cfid}"], # TODO: CF.{Name} is not supported at the moment Function => ['COUNT'], ); + $report->SortEntries; my @colors = RT->Config->Get("ChartColors"); my $expected = { diff --git a/t/web/attachments.t b/t/web/attachments.t index 0b8a5ead7fa..0ae407d7ff9 100644 --- a/t/web/attachments.t +++ b/t/web/attachments.t @@ -369,6 +369,7 @@ diag "create with attachment"; $m->form_name('TicketCreate'); $m->field('Attach', FaviconFile); + $m->field('Subject', 'Subject'); $m->field('Content', 'Message'); ok($m->current_form->find_input('AddMoreAttach'), "more than one attachment"); $m->submit; diff --git a/t/web/cf_groupings.t b/t/web/cf_groupings.t index a59cd995945..0a40f71af14 100644 --- a/t/web/cf_groupings.t +++ b/t/web/cf_groupings.t @@ -44,6 +44,7 @@ my %location = ( my $prefix = 'Object-RT::Ticket--CustomField:'; my $dom = $m->dom; $m->form_name('TicketCreate'); + $m->field("Subject", "CF grouping test"); for my $grouping (@groupings) { my $input_name = $prefix . "$grouping-$CF{$grouping}-Value";