code: func SetBinFlagOrBinStr(argTp *types.FieldType, resTp *types.FieldType) {
  	if types.IsBinaryStr(argTp) {
  		types.SetBinChsClnFlag(resTp)
  	} else if mysql.HasBinaryFlag(argTp.Flag) || !types.IsNonBinaryStr(argTp) {
  		resTp.Flag |= mysql.BinaryFlag
  	}
  }
docs: // SetBinFlagOrBinStr sets resTp to binary string if argTp is a binary string,
  // if not, sets the binary flag of resTp to true if argTp has binary flag.