code: func recordExists(ctx sessionctx.Context, sql string) (bool, error) {
  	rows, _, err := ctx.(sqlexec.RestrictedSQLExecutor).ExecRestrictedSQL(ctx, sql)
  	if err != nil {
  		return false, err
  	}
  	return len(rows) > 0, nil
  }
docs: // recordExists is a helper function to check if the sql returns any row.