Skip to content

Commit

Permalink
[CLIENT-3218] Fix FilterExpression encoding in Batch commands
Browse files Browse the repository at this point in the history
  • Loading branch information
khaf committed Dec 20, 2024
1 parent ad18d88 commit 51afa55
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions command.go
Original file line number Diff line number Diff line change
Expand Up @@ -2198,7 +2198,13 @@ func (cmd *baseCommand) writeBatchFieldsTxn(
}

if filter != nil {
filter.pack(cmd)
expSize, err := filter.size()
if err != nil {
return err
}
if err := cmd.writeFilterExpression(filter, expSize); err != nil {
return err
}
}

if attr.sendKey && key.hasValueToSend() {
Expand Down Expand Up @@ -2243,7 +2249,13 @@ func (cmd *baseCommand) writeBatchFieldsReg(
cmd.writeBatchFields(key, fieldCount, opCount)

if filter != nil {
filter.pack(cmd)
expSize, err := filter.size()
if err != nil {
return err
}
if err := cmd.writeFilterExpression(filter, expSize); err != nil {
return err
}
}

if attr.sendKey && key.hasValueToSend() {
Expand Down Expand Up @@ -3113,7 +3125,13 @@ func (cmd *baseCommand) writeKeyAttr(
cmd.writeKeyWithPolicy(policy.GetBasePolicy(), key, attr.hasWrite)

if filterExp != nil {
filterExp.pack(cmd)
expSize, err := filterExp.size()
if err != nil {
return err
}
if err := cmd.writeFilterExpression(filterExp, expSize); err != nil {
return err
}
}
return nil
}
Expand Down

0 comments on commit 51afa55

Please sign in to comment.