Skip to content

Commit

Permalink
feat: fix handling of nulls
Browse files Browse the repository at this point in the history
Signed-off-by: Manan Gupta <[email protected]>
  • Loading branch information
GuptaManan100 committed Nov 15, 2023
1 parent 4f581bf commit 07e090d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion go/vt/vtgate/engine/fk_cascade.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,11 @@ func (fkc *FkCascade) executeNonLiteralExprFkChild(ctx context.Context, vcursor
// This is required for example when we receive an updated float value of -0, but
// the column being updated is a varchar column, then if we don't coerce the value of -0 to
// varchar, MySQL ends up setting it to '0' instead of '-0'.
finalVal, err := evalengine.CoerceTo(row[info.UpdateExprCol], selectionRes.Fields[info.ExprCol].Type)
finalVal := row[info.UpdateExprCol]
var err error
if !finalVal.IsNull() {
finalVal, err = evalengine.CoerceTo(finalVal, selectionRes.Fields[info.ExprCol].Type)
}
if err != nil {
return err
}
Expand Down

0 comments on commit 07e090d

Please sign in to comment.