diff --git a/go/vt/vtgate/engine/fk_cascade.go b/go/vt/vtgate/engine/fk_cascade.go index 1912bd16ad8..e3da820c529 100644 --- a/go/vt/vtgate/engine/fk_cascade.go +++ b/go/vt/vtgate/engine/fk_cascade.go @@ -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 }