That’s great, but I still see some “[crit]:”-lines.
I do not know what they do, but they do not appear in the mysql
version
Well - I now know why the [crit] lines appear in the Oracle
initialize-database output. This is because the SQL SELECT to load
columns from the Groups table doesn’t work.
MySQL SQL:
SimpleQuery: SELECT * FROM Groups WHERE Type = ? AND Instance = ? AND
Domain = ? AND Name = ?^M
Everyone^M
^M
SystemInternal^M
^M
which is equivalent to:
mysql> SELECT * FROM Groups WHERE Type = ‘Everyone’ AND Instance = ‘’
AND Domain = ‘SystemInternal’ AND Name = ‘’;
| id | Name | Description | Domain | Type
| Instance |
| 3 | | Pseudogroup for internal use | SystemInternal | Everyone
| |
Oracle SQL:
SimpleQuery: SELECT * FROM Groups WHERE lower(Domain) = ? AND
lower(Name) = ? AND lower(Type) = ? AND lower(Instance) = ?^M
systeminternal^M
^M
everyone^M
^M
if the query was modified to:
SimpleQuery: SELECT * FROM Groups WHERE lower(Domain) =
‘systeminternal’ AND lower(Type) = ‘everyone’ AND Instance IS NULL AND
Name IS NULL;
then the correct results would be returned, or was simplified to:
SimpleQuery: SELECT * FROM Groups WHERE lower(Domain) = ? AND
lower(Type) = ?^M
systeminternal^M
everyone^M
then it would actually work for Oracle. I don’t know to what extent
this should be based in SB simplifying a query to remove these
NULL/undef values - or whether it should be something in the
RT/Group.pm code.
The offending code from RT/Group_Overlay.pm:
sub LoadSystemInternalGroup {
my $self = shift;
my $identifier = shift;
$self->LoadByCols( "Domain" => 'SystemInternal',
"Instance" => '',
"Name" => '',
"Type" => $identifier );
}
And the offending code in DBIx::SearchBuilder::Record.pm:
sub LoadByCols {
my $self = shift;
my %hash = (@_);
my (@bind, @phrases);
foreach my $key (keys %hash) {
if (defined $hash{$key}) {
push @phrases, “$key = ?”;
push @bind, $hash{$key};
}
else {
push @phrases, “$key is null”;
}
}
my $QueryString = "SELECT * FROM ".$self->Table." WHERE ".
join(' AND ', @phrases) ;
return ($self->_LoadFromSQL($QueryString, @bind));
}
basically the values should be undefined and thus “$key is null” would
be used - but the value in Oracle is actually NULL rather than nothing.
So what process should we follow:
a) get Oracle to insert NOTHING rather than a NULL (I don’t know how to
do this)
b) get LoadByCols to do an Oracle special thingy and force the “$key is
null” syntax
The easier of the two is forcing “IS NULL” - but what does anyone else
think?
This seems to be the only thing holding up the Oracle support for RT.
Ideas?
-Brook