func composeGlobalPrivUpdate(priv mysql.PrivilegeType) (string, error) {
	if priv == mysql.AllPriv {
		strs := make([]string, 0, len(mysql.Priv2UserCol))
		for _, v := range mysql.Priv2UserCol {
			strs = append(strs, fmt.Sprintf(`%s="Y"`, v))
		}
		return strings.Join(strs, ", "), nil
	}
	col, ok := mysql.Priv2UserCol[priv]
	if !ok {
		return "", errors.Errorf("Unknown priv: %v", priv)
	}
	return fmt.Sprintf(`%s="Y"`, col), nil
}
// Compose update stmt assignment list string for global scope privilege update.
Compose update stmt assignment list string for global scope privilege update.
// Compose update stmt assignment list string for global scope privilege update .
func composeGlobalPrivUpdate(priv mysql.PrivilegeType) (string, error) {
	if priv == mysql.AllPriv {
		strs := make([]string, 0, len(mysql.Priv2UserCol))
		for _, v := range mysql.Priv2UserCol {
			strs = append(strs, fmt.Sprintf(`%s="Y"`, v))
		}
		return strings.Join(strs, ", "), nil
	}
	col, ok := mysql.Priv2UserCol[priv]
	if !ok {
		return "", errors.Errorf("Unknown priv: %v", priv)
	}
	return fmt.Sprintf(`%s="Y"`, col), nil
}
func composeGlobalPrivUpdate ( priv mysql . PrivilegeType ) ( string , error ) { if priv == mysql . AllPriv { strs := make ( [ ] string , 0 , len ( mysql . Priv2UserCol ) ) for _ , v := range mysql . Priv2UserCol { strs = append ( strs , fmt . Sprintf ( `%s="Y"` , v ) ) } return strings . Join ( strs , " " ) , nil } col , ok := mysql . Priv2UserCol [ priv ] if ! ok { return " " , errors . Errorf ( " " , priv ) } return fmt . Sprintf ( `%s="Y"` , col ) , nil }
Compose update stmt assignment list string for global scope privilege update.
Compose update stmt assignment list string for global scope privilege update .