~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_string.cc

  • Committer: Mark Atwood
  • Date: 2008-10-16 11:33:16 UTC
  • mto: (520.1.13 drizzle)
  • mto: This revision was merged to the branch mainline in revision 530.
  • Revision ID: mark@fallenpegasus.com-20081016113316-ff6jdt31ck90sjdh
an implemention of the errmsg plugin

Show diffs side-by-side

added added

removed removed

Lines of Context:
1040
1040
    switch (c)
1041
1041
    {
1042
1042
    case '\\':
1043
 
      str->append("\\\\", sizeof("\\\\")-1);
 
1043
      str->append(STRING_WITH_LEN("\\\\"));
1044
1044
      break;
1045
1045
    case '\0':
1046
 
      str->append("\\0", sizeof("\\0")-1);
 
1046
      str->append(STRING_WITH_LEN("\\0"));
1047
1047
      break;
1048
1048
    case '\'':
1049
 
      str->append("\\'", sizeof("\\'")-1);
 
1049
      str->append(STRING_WITH_LEN("\\'"));
1050
1050
      break;
1051
1051
    case '\n':
1052
 
      str->append("\\n", sizeof("\\n")-1);
 
1052
      str->append(STRING_WITH_LEN("\\n"));
1053
1053
      break;
1054
1054
    case '\r':
1055
 
      str->append("\\r", sizeof("\\r")-1);
 
1055
      str->append(STRING_WITH_LEN("\\r"));
1056
1056
      break;
1057
1057
    case '\032': // Ctrl-Z
1058
 
      str->append("\\Z", sizeof("\\Z")-1);
 
1058
      str->append(STRING_WITH_LEN("\\Z"));
1059
1059
      break;
1060
1060
    default:
1061
1061
      str->append(c);
1082
1082
  std::swap(alloced, s.alloced);
1083
1083
  std::swap(str_charset, s.str_charset);
1084
1084
}
1085
 
 
1086
 
 
1087
 
bool operator==(const String &s1, const String &s2)
1088
 
{
1089
 
  return stringcmp(&s1,&s2) == 0;
1090
 
}
1091
 
 
1092
 
bool operator!=(const String &s1, const String &s2)
1093
 
{
1094
 
  return !(s1 == s2);
1095
 
}
1096