[Rt-commit] r15394 - in rt/3.8/trunk: .

ruz at bestpractical.com ruz at bestpractical.com
Fri Aug 22 20:21:58 EDT 2008


Author: ruz
Date: Fri Aug 22 20:21:49 2008
New Revision: 15394

Modified:
   rt/3.8/trunk/   (props changed)
   rt/3.8/trunk/lib/RT/Handle.pm

Log:
 r15437 at cubic-pc (orig r15385):  cubic | 2008-08-23 02:41:00 +0400
 * adjust Oracle connect a little. DatabaseName is oracle SID
   as it always have been, but now if you define database host
   as well then you can connect without TWO_TASK, ORACLE_SID
   and all other stuff you usually had to use


Modified: rt/3.8/trunk/lib/RT/Handle.pm
==============================================================================
--- rt/3.8/trunk/lib/RT/Handle.pm	(original)
+++ rt/3.8/trunk/lib/RT/Handle.pm	Fri Aug 22 20:21:49 2008
@@ -143,16 +143,18 @@
     $db_name = File::Spec->catfile($RT::VarPath, $db_name)
         if $db_type eq 'SQLite' && !File::Spec->file_name_is_absolute($db_name);
 
-
-    $self->SUPER::BuildDSN( Host       => $db_host,
-                                        Database   => $db_name,
-                            Port       => $db_port,
-                            Driver     => $db_type,
-                            RequireSSL => RT->Config->Get('DatabaseRequireSSL'),
-                            DisconnectHandleOnDestroy => 1,
-                          );
-   
-
+    my %args = (
+        Host       => $db_host,
+        Database   => $db_name,
+        Port       => $db_port,
+        Driver     => $db_type,
+        RequireSSL => RT->Config->Get('DatabaseRequireSSL'),
+        DisconnectHandleOnDestroy => 1,
+    );
+    if ( $db_type eq 'Oracle' && $db_host ) {
+        $args{'SID'} = delete $args{'Database'};
+    }
+    $self->SUPER::BuildDSN( %args );
 }
 
 =head2 DSN


More information about the Rt-commit mailing list