Skip to content

Commit

Permalink
Fix when KeyFieldName and ValueFieldName are not specified
Browse files Browse the repository at this point in the history
  • Loading branch information
yo000 committed Aug 25, 2024
1 parent 38b8963 commit d445c18
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions binary/v1/client-cache-configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -818,11 +818,23 @@ func (c *client) cacheCreateWithConfiguration(code int16, cc *CacheConfiguration
if err := WriteOString(req, v.TableName); err != nil {
return errors.Wrapf(err, "failed to write QueryEntity.TableName with index %d", i)
}
if err := WriteOString(req, v.KeyFieldName); err != nil {
return errors.Wrapf(err, "failed to write QueryEntity.KeyFieldName with index %d", i)
if len(v.KeyFieldName) == 0 {
if err := WriteNull(req); err != nil {
return errors.Wrapf(err, "failed to write Null value for QueryEntity.KeyFieldName with index %d", i)
}
} else {
if err := WriteOString(req, v.KeyFieldName); err != nil {
return errors.Wrapf(err, "failed to write QueryEntity.KeyFieldName with index %d", i)
}
}
if err := WriteOString(req, v.ValueFieldName); err != nil {
return errors.Wrapf(err, "failed to write QueryEntity.ValueFieldName with index %d", i)
if len(v.ValueFieldName) == 0 {
if err := WriteNull(req); err != nil {
return errors.Wrapf(err, "failed to write Null value for QueryEntity.ValueFieldName with index %d", i)
}
} else {
if err := WriteOString(req, v.ValueFieldName); err != nil {
return errors.Wrapf(err, "failed to write QueryEntity.ValueFieldName with index %d", i)
}
}
var l int32
if v.QueryFields != nil {
Expand Down

0 comments on commit d445c18

Please sign in to comment.