[rt-devel] SearchBuilder/Oracle Insert 'id' Patch (Was: Oracle install procedure for RT-3.0.2pre1)

Brook Schofield brooksch at mac.com
Tue May 6 08:21:55 EDT 2003


Steen,
     I have modified your code to create the following patch to 
SearchBuilder/Handle/Oracle.pm (against SB-0.81_04). This improves the 
Oracle support even further and now 'make initialize-database' runs 
through to completion.

Now creating a database for RT.
Now populating database schema.
Creating database schema.
schema sucessfully inserted
Now inserting database ACLs
Now inserting RT core system objects
unix passed to setlogsock, but path not available at 
/usr/local/lib/perl5/site_perl/5.8.0/Log/Dispatch/Syslog.pm line 66
Checking for existing system user...not found.  This appears to be a 
new installation.
Creating system user...done.
Now inserting RT data
Creating Superuser  ACL...Creating groups...3.4.5.6.7.8.9.done.
Creating users...[Tue May  6 12:18:44 2003] [crit]: Attempting to add a 
member to a group which wasn't loaded. 'oops' 
(/opt/rt3/lib/RT/Group_Overlay.pm:943)
[Tue May  6 12:18:44 2003] [crit]: Attempting to add a member to a 
group which wasn't loaded. 'oops' (/opt/rt3/lib/RT/Group_Overlay.pm:943)
10.[Tue May  6 12:18:44 2003] [crit]: Attempting to add a member to a 
group which wasn't loaded. 'oops' (/opt/rt3/lib/RT/Group_Overlay.pm:943)
[Tue May  6 12:18:44 2003] [crit]: Attempting to add a member to a 
group which wasn't loaded. 'oops' (/opt/rt3/lib/RT/Group_Overlay.pm:943)
12.done.
Creating ACL...2.3.done.
Creating queues...1.2.done.
Creating ScripActions...1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.done.
Creating ScripConditions...1.2.3.4.5.6.7.8.9.done.
Creating templates...1.2.3.4.5.6.7.8.9.done.
Creating scrips...1.2.3.4.5.6.7.8.9.10.11.12.13.done.

Hopefully this will result in SB-0.82 coming out in the not too distant 
future and make it much easier for people to support/test Oracle 
installations.

-Brook
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dbi_sb_ora_id.patch
Type: application/octet-stream
Size: 2115 bytes
Desc: not available
Url : http://pallas.eruditorum.org/pipermail/rt-devel/attachments/20030506/b8432af6/dbi_sb_ora_id.obj
-------------- next part --------------

On Tuesday, April 29, 2003, at 11:54  PM, Steen Olesen - Tiscali A/S 
wrote:
> I haven't posted this, since it is probably not very nice Perl coding 
> (I'm definetely not an expert here :))
>
> ---------- CUT ----------
> sub Insert  {
>     my $self = shift;
>     my $table = shift;
>     my ($sth);
>
>     #TODO: don't hardcode this to id pull it from somewhere else
>     #call super::Insert with the new column id.
>
>     my %attribs = @_;
>         my $unique_id;
>
>         if ($attribs{'Id'} || $attribs{'id'})
>         {
>                 $unique_id = ($attribs{'Id'} ? $attribs{'Id'} : 
> $attribs{'id'} );
>                 delete $attribs{'Id'};
>         } else {
>                 # Not stated - get from global sequence...
>                 # Oracle Hack to replace non-supported mysql_rowid call
>                 my $QueryString = "SELECT GLOBAL_SEQUENCE.nextval FROM 
> DUAL";
>                 $sth = $self->SimpleQuery($QueryString);
>                 if (!$sth) {
>                         if ($main::debug) {
>                                 die "Error with $QueryString";
>                         }
>                         else {
>                                 return (undef);
>                         }
>                 }
>                 #needs error checking
>                 my @row = $sth->fetchrow_array;
>                 $unique_id = $row[0];
>         }
>     $attribs{'id'} = $unique_id;
>
>     $sth =  $self->SUPER::Insert( $table, %attribs);
>     $self->{'id'} = $unique_id;
>     return( $self->{'id'}); #Add Succeded. return the id
>   }
>
> ---------- CUT ----------


More information about the Rt-devel mailing list