record_fields: Include information about optionality of fields

This was reported as a wish for log schema generation, so add it...
This commit is contained in:
Arne Welzel 2023-04-27 21:10:24 +02:00
parent 0374d0fe42
commit f4bb8fae33
6 changed files with 61 additions and 52 deletions

View file

@ -1348,6 +1348,7 @@ TableValPtr RecordType::GetRecordFieldsVal(const RecordVal* rv) const
nr->Assign(1, logged);
nr->Assign(2, std::move(fv));
nr->Assign(3, FieldDefault(i));
nr->Assign(4, fd->GetAttr(detail::ATTR_OPTIONAL) != detail::Attr::nil);
auto field_name = make_intrusive<StringVal>(FieldName(i));
rval->Assign(std::move(field_name), std::move(nr));
}