code: func setFlenDecimal4RealOrDecimal(retTp, a, b *types.FieldType, isReal bool) {
  	if a.Decimal != types.UnspecifiedLength && b.Decimal != types.UnspecifiedLength {
  		retTp.Decimal = a.Decimal + b.Decimal
  		if !isReal && retTp.Decimal > mysql.MaxDecimalScale {
  			retTp.Decimal = mysql.MaxDecimalScale
  		}
  		if a.Flen == types.UnspecifiedLength || b.Flen == types.UnspecifiedLength {
  			retTp.Flen = types.UnspecifiedLength
  			return
  		}
  		digitsInt := mathutil.Max(a.Flen-a.Decimal, b.Flen-b.Decimal)
  		retTp.Flen = digitsInt + retTp.Decimal + 3
  		if isReal {
  			retTp.Flen = mathutil.Min(retTp.Flen, mysql.MaxRealWidth)
  			return
  		}
  		retTp.Flen = mathutil.Min(retTp.Flen, mysql.MaxDecimalWidth)
  		return
  	}
  	if isReal {
  		retTp.Flen, retTp.Decimal = types.UnspecifiedLength, types.UnspecifiedLength
  	} else {
  		retTp.Flen, retTp.Decimal = mysql.MaxDecimalWidth, mysql.MaxDecimalScale
  	}
  }
docs: // setFlenDecimal4RealOrDecimal is called to set proper `Flen` and `Decimal` of return
  // type according to the two input parameter's types.