Skip to content

Commit

Permalink
RT#22696: fix (probably harmless) warning
Browse files Browse the repository at this point in the history
Regression from 36e28bf.  The cursors
generated internally by the collection loaders don't go through the
front door, so we don't know that they are selecting extra columns and
hence have to go through ->read_object().
  • Loading branch information
Sam Vilain committed Jan 11, 2007
1 parent 7692b02 commit d5fa585
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
13 changes: 10 additions & 3 deletions lib/Tangram/Cursor.pm
Original file line number Diff line number Diff line change
Expand Up @@ -288,11 +288,18 @@ sub _next

my $obj = $storage->{objects}{$id};

# even if object is already loaded we must read it so
# that @row only contains residue, with -retrieve
if ( !defined($obj) or $self->{-retrieve} ) {
# even if object is already loaded we must read it so that
# @row only contains residue, with -retrieve, and so that
# any foreign/intrusive collections can get the
# information they need.
if ( !defined($obj) or $self->{-retrieve} or
$self->{-no_skip_read} ) {
print $Tangram::TRACE __PACKAGE__.": reading object $id\n"
if $Tangram::TRACE and $Tangram::DEBUG_LEVEL > 0;
$obj = $storage->read_object($id, $class, $state);
} else {
print $Tangram::TRACE __PACKAGE__.": not reading object $id\n"
if $Tangram::TRACE and $Tangram::DEBUG_LEVEL > 0;
# just pretend we did it.
@row = ();
}
Expand Down
1 change: 1 addition & 0 deletions lib/Tangram/Type/Array/FromMany.pm
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ sub cursor
$cursor->{-coll_cols} = "t$coll_tid.$slot_col";
$cursor->{-coll_from} = "$table t$coll_tid";
$cursor->{-coll_where} = "t$coll_tid.$coll_col = $coll_id AND t$coll_tid.$item_col = t$item_tid.$storage->{schema}{sql}{id_col}";
$cursor->{-no_skip_read} = 1;

return $cursor;
}
Expand Down
1 change: 1 addition & 0 deletions lib/Tangram/Type/Hash/FromMany.pm
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ sub cursor # ?? factorize ??
$cursor->{-coll_cols} = "t$coll_tid.$slot_col";
$cursor->{-coll_from} = "$table t$coll_tid";
$cursor->{-coll_where} = "t$coll_tid.$coll_col = $coll_id AND t$coll_tid.$item_col = t$item_tid.$storage->{schema}{sql}{id_col}";
$cursor->{-no_skip_read} = 1;

return $cursor;
}
Expand Down
1 change: 1 addition & 0 deletions lib/Tangram/Type/Set/FromMany.pm
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ sub demand
$cursor->{-coll_tid} = $coll_tid;
$cursor->{-coll_from} = "$table t$coll_tid";
$cursor->{-coll_where} = "t$coll_tid.$coll_col = $coll_id AND t$coll_tid.$item_col = t$item_tid.$storage->{schema}{sql}{id_col}";
$cursor->{-no_skip_read} = 1;

$set->insert($cursor->select);
}
Expand Down

0 comments on commit d5fa585

Please sign in to comment.