~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/session.cc

  • Committer: Olaf van der Spek
  • Date: 2011-10-06 18:18:31 UTC
  • mto: This revision was merged to the branch mainline in revision 2433.
  • Revision ID: olafvdspek@gmail.com-20111006181831-1ix5b80ry7iifbjf
Use lex_string assign(), data() and size()

Show diffs side-by-side

added added

removed removed

Lines of Context:
103
103
bool Key_part_spec::operator==(const Key_part_spec& other) const
104
104
{
105
105
  return length == other.length &&
106
 
         field_name.length == other.field_name.length &&
107
 
    !my_strcasecmp(system_charset_info, field_name.str, other.field_name.str);
 
106
         field_name.size() == other.field_name.size() &&
 
107
    !my_strcasecmp(system_charset_info, field_name.data(), other.field_name.data());
108
108
}
109
109
 
110
110
Open_tables_state::Open_tables_state(Session& session, uint64_t version_arg) :
862
862
{
863
863
  if (not lex_str)
864
864
    lex_str= new (mem) lex_string_t;
865
 
  lex_str->str= mem_root->strdup(str);
866
 
  lex_str->length= str.size();
 
865
  lex_str->assign(mem_root->strdup(str), str.size());
867
866
  return lex_str;
868
867
}
869
868
 
1693
1692
 
1694
1693
user_var_entry *Session::getVariable(lex_string_t &name, bool create_if_not_exists)
1695
1694
{
1696
 
  return getVariable(std::string(name.str, name.length), create_if_not_exists);
 
1695
  return getVariable(std::string(name.data(), name.size()), create_if_not_exists);
1697
1696
}
1698
1697
 
1699
1698
user_var_entry *Session::getVariable(const std::string  &name, bool create_if_not_exists)