Skip to content

Commit

Permalink
Merge branch '4.2/oracle-fixes' into 4.2-trunk
Browse files Browse the repository at this point in the history
  • Loading branch information
jibsheet committed Nov 13, 2013
2 parents 579ea09 + a2314ce commit 915d5c2
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 12 deletions.
7 changes: 5 additions & 2 deletions etc/RT_Config.pm.in
Original file line number Diff line number Diff line change
Expand Up @@ -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<OR>
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>

Expand Down
10 changes: 5 additions & 5 deletions lib/RT/Handle.pm
Original file line number Diff line number Diff line change
Expand Up @@ -83,17 +83,17 @@ L<DBIx::SearchBuilder::Handle>, using the C<DatabaseType> 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
Expand Down
2 changes: 2 additions & 0 deletions lib/RT/Interface/Web/Session.pm
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ sub Attributes {
Transaction => 1,
};
}
$res->{LongReadLen} = RT->Config->Get('MaxAttachmentSize')
if $class->isa('Apache::Session::Oracle');
return $res;
}

Expand Down
6 changes: 1 addition & 5 deletions t/api/db_indexes.t
Original file line number Diff line number Diff line change
Expand Up @@ -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'} };
}

Expand Down
1 change: 1 addition & 0 deletions t/charts/basics.t
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ use_ok 'RT::Report::Tickets';
GroupBy => ['Status'],
Function => ['COUNT'],
);
$report->SortEntries;

my @colors = RT->Config->Get("ChartColors");
my $expected = {
Expand Down
1 change: 1 addition & 0 deletions t/charts/compound-sql-function.t
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
1 change: 1 addition & 0 deletions t/charts/group-by-cf.t
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
1 change: 1 addition & 0 deletions t/web/attachments.t
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions t/web/cf_groupings.t
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down

0 comments on commit 915d5c2

Please sign in to comment.