Merge remote-tracking branch 'origin/topic/jsiwek/path-func-record-demote'

* origin/topic/jsiwek/path-func-record-demote:
  Fix filter path_func to allow record argument as a subset of stream's columns.

Conflicts:
	src/LogMgr.cc

Closes #600.
This commit is contained in:
Robin Sommer 2011-09-15 16:45:41 -07:00
commit c2e432c5fa
6 changed files with 87 additions and 6 deletions

View file

@ -2863,7 +2863,7 @@ Val* RecordVal::LookupWithDefault(int field) const
return record_type->FieldDefault(field);
}
RecordVal* RecordVal::CoerceTo(const RecordType* t, Val* aggr) const
RecordVal* RecordVal::CoerceTo(const RecordType* t, Val* aggr, bool allow_orphaning) const
{
if ( ! record_promotion_compatible(t->AsRecordType(), Type()->AsRecordType()) )
return 0;
@ -2883,6 +2883,9 @@ RecordVal* RecordVal::CoerceTo(const RecordType* t, Val* aggr) const
if ( t_i < 0 )
{
if ( allow_orphaning )
continue;
char buf[512];
safe_snprintf(buf, sizeof(buf),
"orphan field \"%s\" in initialization",
@ -2916,7 +2919,7 @@ RecordVal* RecordVal::CoerceTo(const RecordType* t, Val* aggr) const
return ar;
}
RecordVal* RecordVal::CoerceTo(RecordType* t)
RecordVal* RecordVal::CoerceTo(RecordType* t, bool allow_orphaning)
{
if ( same_type(Type(), t) )
{
@ -2924,7 +2927,7 @@ RecordVal* RecordVal::CoerceTo(RecordType* t)
return this;
}
return CoerceTo(t, 0);
return CoerceTo(t, 0, allow_orphaning);
}
void RecordVal::Describe(ODesc* d) const