~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/log_event.cc

  • Committer: Toru Maesaka
  • Date: 2008-12-10 18:33:08 UTC
  • mto: (670.1.11 devel)
  • mto: This revision was merged to the branch mainline in revision 672.
  • Revision ID: dev@torum.net-20081210183308-mb6a5x0sbl1dhc5c
Replaced MySQL's my_stpncpy() with libc and c++ calls

Show diffs side-by-side

added added

removed removed

Lines of Context:
3065
3065
 
3066
3066
void Slave_log_event::pack_info(Protocol *protocol)
3067
3067
{
3068
 
  char buf[256+HOSTNAME_LENGTH], *pos;
3069
 
  pos= strcpy(buf, "host=")+5;
3070
 
  pos= my_stpncpy(pos, master_host.c_str(), HOSTNAME_LENGTH);
3071
 
  pos= strcpy(pos, ",port=")+6;
3072
 
  pos= int10_to_str((long) master_port, pos, 10);
3073
 
  pos= strcpy(pos, ",log=")+5;
3074
 
  pos= strcpy(pos, master_log.c_str())+master_log.length();
3075
 
  pos= strcpy(pos, ",pos=")+5;
3076
 
  pos= int64_t10_to_str(master_pos, pos, 10);
3077
 
  protocol->store(buf, pos-buf, &my_charset_bin);
 
3068
  std::ostringstream stream;
 
3069
  stream << "host=" << master_host << ",port=" << master_port;
 
3070
  stream << ",log=" << master_log << ",pos=" << master_pos;
 
3071
 
 
3072
  protocol->store(stream.str().c_str(), stream.str().length(),
 
3073
                  &my_charset_bin);
3078
3074
}
3079
3075
 
3080
3076