code: func WrapWithCastAsJSON(ctx sessionctx.Context, expr Expression) Expression {
  	if expr.GetType().Tp == mysql.TypeJSON && !mysql.HasParseToJSONFlag(expr.GetType().Flag) {
  		return expr
  	}
  	tp := &types.FieldType{
  		Tp:      mysql.TypeJSON,
  		Flen:    12582912, // FIXME: Here the Flen is not trusted.
  		Decimal: 0,
  		Charset: mysql.DefaultCharset,
  		Collate: mysql.DefaultCollationName,
  		Flag:    mysql.BinaryFlag,
  	}
  	return BuildCastFunction(ctx, expr, tp)
  }
docs: // WrapWithCastAsJSON wraps `expr` with `cast` if the return type of expr is not
  // type json, otherwise, returns `expr` directly.