[ic] Shared Tables Not Always in %Sql

John Young john_young at sonic.net
Wed Jan 14 06:24:34 EST 2004


I'm chasing down an intermittent problem accessing database handles
using %Sql (sometimes the table is shared, and sometimes it isn't),
and am wondering if the following would be desirable:

(I lengthened the diff in order to show the entire block)


--- Interpolate.pm.2.201	Wed Jan 14 03:05:29 2004
+++ Interpolate.pm	Wed Jan 14 03:11:07 2004
@@ -1842,26 +1842,26 @@
  	if($tables) {
  		my (@tab) = grep /\S/, split /\s+/, $tables;
  		foreach my $tab (@tab) {
-			next if $Db{$tab};
+			next if $Sql{$tab} && $Db{$tab};
  			my $db = database_exists_ref($tab);
  			next unless $db;
  			$db = $db->ref();
			if($db->config('type') == 10) {
				my @extra_tabs = $db->_shared_databases();
				push (@tab, @extra_tabs);
			}
			if($hole) {
				$Sql{$tab} = $hole->wrap($db->dbh())
					if $db->can('dbh');
				$Db{$tab} = $hole->wrap($db);
				if($db->config('name') ne $tab) {
					$Db{$db->config('name')} = $Db{$tab};
				}
			}
			else {
				$Sql{$tab} = $db->[$Vend::Table::DBI::DBI]
					if $db =~ /::DBI/;
				$Db{$tab} = $db;
			}
		}
	}



Thanks,
John Young



More information about the interchange-users mailing list