Commit d2a91bad authored by Leigh Stoller's avatar Leigh Stoller

Fix bug in the architecture handling code; deal with virtual types

properly.
parent f2b8de83
......@@ -301,13 +301,14 @@ sub Stringify($)
#
# Is the argument a class instead of a type.
#
sub IsClass($$)
sub IsClass($)
{
my (undef, $class) = @_;
my ($self) = @_;
my $type = $self->type();
my $query_result =
DBQueryWarn("select type from node_types ".
"where class='$class' and class!=type limit 1");
"where class='$type' and class!=type limit 1");
return $query_result->numrows;
}
......
......@@ -1293,7 +1293,7 @@ sub LoadVirtNodes($)
#
# Record the type selections for the mapper.
#
if (!NodeType->IsClass($type)) {
if (!$vnode->_typeinfo()->IsClass()) {
if (!defined($self->types()->{$type})) {
$self->types()->{$type} = 0;
}
......
......@@ -1291,9 +1291,11 @@ sub LoadVirtNodes($)
}
#
# Record the type selections for the mapper.
# Record the type selections for the mapper. If this was a vtype,
# then we selected the first real type from the list. Might not be
# what we want to do.
#
if (!NodeType->IsClass($type)) {
if (!$vnode->_typeinfo()->IsClass()) {
if (!defined($self->types()->{$type})) {
$self->types()->{$type} = 0;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment