[interchange-cvs] interchange - racke modified 2 files

interchange-cvs at icdevgroup.org interchange-cvs at icdevgroup.org
Tue Oct 4 07:11:33 EDT 2005


User:      racke
Date:      2005-10-04 11:11:32 GMT
Modified:  lib/Vend Interpolate.pm
Modified:  lib/Vend/Table Shadow.pm
Log:
workaround for shadow tables and dbh method

Revision  Changes    Path
2.252     +10 -4     interchange/lib/Vend/Interpolate.pm


rev 2.252, prev_rev 2.251
Index: Interpolate.pm
===================================================================
RCS file: /anon_cvs/repository/interchange/lib/Vend/Interpolate.pm,v
retrieving revision 2.251
retrieving revision 2.252
diff -u -r2.251 -r2.252
--- Interpolate.pm	20 Aug 2005 02:54:54 -0000	2.251
+++ Interpolate.pm	4 Oct 2005 11:11:32 -0000	2.252
@@ -1,6 +1,6 @@
 # Vend::Interpolate - Interpret Interchange tags
 # 
-# $Id: Interpolate.pm,v 2.251 2005/08/20 02:54:54 jon Exp $
+# $Id: Interpolate.pm,v 2.252 2005/10/04 11:11:32 racke Exp $
 #
 # Copyright (C) 2002-2005 Interchange Development Group
 # Copyright (C) 1996-2002 Red Hat, Inc.
@@ -28,7 +28,7 @@
 require Exporter;
 @ISA = qw(Exporter);
 
-$VERSION = substr(q$Revision: 2.251 $, 10);
+$VERSION = substr(q$Revision: 2.252 $, 10);
 
 @EXPORT = qw (
 
@@ -1578,14 +1578,20 @@
 			next if $Db{$tab};
 			my $db = database_exists_ref($tab);
 			next unless $db;
+			my $dbh;
 			$db = $db->ref();
 			if($db->config('type') == 10) {
 				my @extra_tabs = $db->_shared_databases();
 				push (@tab, @extra_tabs);
+				$dbh = $db->dbh();
+			} elsif ($db->can('dbh')) {
+				$dbh = $db->dbh();
 			}
+
 			if($hole) {
-				$Sql{$tab} = $hole->wrap($db->dbh())
-					if $db->can('dbh');
+				if ($dbh) {
+					$Sql{$tab} = $hole->wrap($dbh);
+				}
 				$Db{$tab} = $hole->wrap($db);
 				if($db->config('name') ne $tab) {
 					$Db{$db->config('name')} = $Db{$tab};



1.51      +5 -3      interchange/lib/Vend/Table/Shadow.pm


rev 1.51, prev_rev 1.50
Index: Shadow.pm
===================================================================
RCS file: /anon_cvs/repository/interchange/lib/Vend/Table/Shadow.pm,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -r1.50 -r1.51
--- Shadow.pm	15 Aug 2005 14:12:01 -0000	1.50
+++ Shadow.pm	4 Oct 2005 11:11:32 -0000	1.51
@@ -1,6 +1,6 @@
 # Vend::Table::Shadow - Access a virtual "Shadow" table
 #
-# $Id: Shadow.pm,v 1.50 2005/08/15 14:12:01 racke Exp $
+# $Id: Shadow.pm,v 1.51 2005/10/04 11:11:32 racke Exp $
 #
 # Copyright (C) 2002-2005 Stefan Hornburg (Racke) <racke at linuxia.de>
 #
@@ -20,7 +20,7 @@
 # MA  02111-1307  USA.
 
 package Vend::Table::Shadow;
-$VERSION = substr(q$Revision: 1.50 $, 10);
+$VERSION = substr(q$Revision: 1.51 $, 10);
 
 # CREDITS
 #
@@ -99,7 +99,9 @@
 sub dbh {
 	my ($s) = shift;
 	$s = $s->import_db() unless defined $s->[$OBJ];
-	return $s->[$OBJ]->dbh();
+	if ($s->[$OBJ]->can('dbh')) {
+		return $s->[$OBJ]->dbh();
+	}
 }
 
 sub name {








More information about the interchange-cvs mailing list