mirror of
https://github.com/zeek/zeek.git
synced 2025-10-14 12:38:20 +00:00
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:
commit
c2e432c5fa
6 changed files with 87 additions and 6 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue