code: func ConvertJSONToFloat(sc *stmtctx.StatementContext, j json.BinaryJSON) (float64, error) {
  	switch j.TypeCode {
  	case json.TypeCodeObject, json.TypeCodeArray:
  		return 0, nil
  	case json.TypeCodeLiteral:
  		switch j.Value[0] {
  		case json.LiteralNil, json.LiteralFalse:
  			return 0, nil
  		default:
  			return 1, nil
  		}
  	case json.TypeCodeInt64:
  		return float64(j.GetInt64()), nil
  	case json.TypeCodeUint64:
  		u, err := ConvertIntToUint(sc, j.GetInt64(), IntergerUnsignedUpperBound(mysql.TypeLonglong), mysql.TypeLonglong)
  		return float64(u), errors.Trace(err)
  	case json.TypeCodeFloat64:
  		return j.GetFloat64(), nil
  	case json.TypeCodeString:
  		str := string(hack.String(j.GetString()))
  		return StrToFloat(sc, str)
  	}
  	return 0, errors.New("Unknown type code in JSON")
  }
docs: // ConvertJSONToFloat casts JSON into float64.