[rt-devel] rt3 DSN options patch

Ian Grant Ian.Grant at cl.cam.ac.uk
Thu Apr 3 10:45:33 EST 2003


I couldn't find the patch Jesse referred me to yesterday so I'm using the 
following one. Ideally DBIx::SearchBuilder::Handle should be modified to allow 
arbitrary DSN attributes to be specified on the DBI->connect, but I wasn't up 
for that. If applying this to the rt3 distribution you must re-run autoconf.

diff -urN rt-3-0-0.orig/configure.ac rt-3-0-0.new/configure.ac
--- rt-3-0-0.orig/configure.ac	2003-03-24 16:38:40.000000000 +0000
+++ rt-3-0-0.new/configure.ac	2003-04-03 12:30:58.000000000 +0100
@@ -115,6 +115,14 @@
             DB_DATABASE=rt3)
 AC_SUBST(DB_DATABASE)
 
+dnl DB_DSN_ATTRS
+AC_ARG_WITH(db-dsn-attrs,
+	    AC_HELP_STRING([--with-db-dsn-attrs=DSNATTRS],
+	    		   [Additional DBI DSN attributes (default: none)]),
+            DB_DSN_ATTRS=$withval,
+            DB_DSN_ATTRS=)
+AC_SUBST(DB_DSN_ATTRS)
+
 dnl DB_RT_USER
 AC_ARG_WITH(db-rt-user,
 	    AC_HELP_STRING([--with-db-rt-user=DBUSER],
diff -urN rt-3-0-0.orig/etc/RT_Config.pm.in rt-3-0-0.new/etc/RT_Config.pm.in
--- rt-3-0-0.orig/etc/RT_Config.pm.in	2003-03-24 16:38:40.000000000 +0000
+++ rt-3-0-0.new/etc/RT_Config.pm.in	2003-04-03 12:08:15.000000000 +0100
@@ -74,6 +74,10 @@
 # set DatabaseRequireSSL to 1 to turn on SSL communication
 Set($DatabaseRequireSSL , undef);
 
+# You can set optional database-specific DSN attributes here
+# e.g. mysql_read_default_file=/etc/my.cnf
+Set($DatabaseDSNAttrs , '@DB_DSN_ATTRS@');
+
 # }}}
 
 # {{{ Incoming mail gateway configuration
diff -urN rt-3-0-0.orig/lib/RT/Handle.pm rt-3-0-0.new/lib/RT/Handle.pm
--- rt-3-0-0.orig/lib/RT/Handle.pm	2003-03-24 16:38:40.000000000 +0000
+++ rt-3-0-0.new/lib/RT/Handle.pm	2003-04-03 12:22:42.000000000 +0100
@@ -88,8 +88,9 @@
 			 Driver => $RT::DatabaseType,
 			 RequireSSL => $RT::DatabaseRequireSSL,
 			);
-   
-
+   if (defined $RT::DatabaseDSNAttrs &&  $RT::DatabaseDSNAttrs) {
+        $self->{'dsn'} .= ";$RT::DatabaseDSNAttrs";
+   } 
 }
 
 1;

-- 
Ian Grant, Computer Lab., William Gates Building, JJ Thomson Ave., Cambridge
Phone: +44 1223 334420





More information about the Rt-devel mailing list