~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to sql/log_event.cc

Removed my_vsnprintf and my_snprintf.

Show diffs side-by-side

added added

removed removed

Lines of Context:
139
139
  for (err= it++, slider= buff; err && slider < buff_end - 1;
140
140
       slider += len, err= it++)
141
141
  {
142
 
    len= my_snprintf(slider, buff_end - slider,
143
 
                     " %s, Error_code: %d;", err->msg, err->code);
 
142
    len= snprintf(slider, buff_end - slider,
 
143
                  " %s, Error_code: %d;", err->msg, err->code);
144
144
  }
145
145
  
146
146
  rli->report(level, thd->is_error()? thd->main_da.sql_errno() : 0,
1256
1256
      my_b_printf(file, "# Position  Timestamp   Type   Master ID        "
1257
1257
                  "Size      Master Pos    Flags \n");
1258
1258
      int const bytes_written=
1259
 
        my_snprintf(emit_buf, sizeof(emit_buf),
1260
 
                    "# %8.8lx %02x %02x %02x %02x   %02x   "
1261
 
                    "%02x %02x %02x %02x   %02x %02x %02x %02x   "
1262
 
                    "%02x %02x %02x %02x   %02x %02x\n",
1263
 
                    (unsigned long) hexdump_from,
1264
 
                    ptr[0], ptr[1], ptr[2], ptr[3], ptr[4], ptr[5], ptr[6],
1265
 
                    ptr[7], ptr[8], ptr[9], ptr[10], ptr[11], ptr[12], ptr[13],
1266
 
                    ptr[14], ptr[15], ptr[16], ptr[17], ptr[18]);
 
1259
        snprintf(emit_buf, sizeof(emit_buf),
 
1260
                 "# %8.8lx %02x %02x %02x %02x   %02x   "
 
1261
                 "%02x %02x %02x %02x   %02x %02x %02x %02x   "
 
1262
                 "%02x %02x %02x %02x   %02x %02x\n",
 
1263
                 (unsigned long) hexdump_from,
 
1264
                 ptr[0], ptr[1], ptr[2], ptr[3], ptr[4], ptr[5], ptr[6],
 
1265
                 ptr[7], ptr[8], ptr[9], ptr[10], ptr[11], ptr[12], ptr[13],
 
1266
                 ptr[14], ptr[15], ptr[16], ptr[17], ptr[18]);
1267
1267
      DBUG_ASSERT(bytes_written >= 0);
1268
1268
      DBUG_ASSERT(static_cast<size_t>(bytes_written) < sizeof(emit_buf));
1269
1269
      my_b_write(file, (uchar*) emit_buf, bytes_written);
1276
1276
         i < size;
1277
1277
         i++, ptr++)
1278
1278
    {
1279
 
      my_snprintf(h, 4, "%02x ", *ptr);
 
1279
      snprintf(h, 4, "%02x ", *ptr);
1280
1280
      h += 3;
1281
1281
 
1282
1282
      *c++= my_isalnum(&my_charset_bin, *ptr) ? *ptr : '.';
1291
1291
         */
1292
1292
        char emit_buf[256];
1293
1293
        int const bytes_written=
1294
 
          my_snprintf(emit_buf, sizeof(emit_buf),
1295
 
                      "# %8.8lx %-48.48s |%16s|\n",
1296
 
                      (unsigned long) (hexdump_from + (i & 0xfffffff0)),
1297
 
                      hex_string, char_string);
 
1294
          snprintf(emit_buf, sizeof(emit_buf),
 
1295
                   "# %8.8lx %-48.48s |%16s|\n",
 
1296
                   (unsigned long) (hexdump_from + (i & 0xfffffff0)),
 
1297
                   hex_string, char_string);
1298
1298
        DBUG_ASSERT(bytes_written >= 0);
1299
1299
        DBUG_ASSERT(static_cast<size_t>(bytes_written) < sizeof(emit_buf));
1300
1300
        my_b_write(file, (uchar*) emit_buf, bytes_written);
1311
1311
    {
1312
1312
      char emit_buf[256];
1313
1313
      int const bytes_written=
1314
 
        my_snprintf(emit_buf, sizeof(emit_buf),
 
1314
        snprintf(emit_buf, sizeof(emit_buf),
1315
1315
                    "# %8.8lx %-48.48s |%s|\n",
1316
1316
                    (unsigned long) (hexdump_from + (i & 0xfffffff0)),
1317
1317
                    hex_string, char_string);
3905
3905
  if (thd->is_fatal_error)
3906
3906
  {
3907
3907
    char buf[256];
3908
 
    my_snprintf(buf, sizeof(buf),
3909
 
                "Running LOAD DATA INFILE on table '%-.64s'."
3910
 
                " Default database: '%-.64s'",
3911
 
                (char*)table_name,
3912
 
                print_slave_db_safe(remember_db));
 
3908
    snprintf(buf, sizeof(buf),
 
3909
             "Running LOAD DATA INFILE on table '%-.64s'."
 
3910
             " Default database: '%-.64s'",
 
3911
             (char*)table_name,
 
3912
             print_slave_db_safe(remember_db));
3913
3913
 
3914
3914
    rli->report(ERROR_LEVEL, ER_SLAVE_FATAL_ERROR,
3915
3915
                ER(ER_SLAVE_FATAL_ERROR), buf);
6910
6910
  char buf[256];
6911
6911
  char const *const flagstr=
6912
6912
    get_flags(STMT_END_F) ? " flags: STMT_END_F" : "";
6913
 
  size_t bytes= my_snprintf(buf, sizeof(buf),
6914
 
                               "table_id: %lu%s", m_table_id, flagstr);
 
6913
  size_t bytes= snprintf(buf, sizeof(buf),
 
6914
                         "table_id: %lu%s", m_table_id, flagstr);
6915
6915
  protocol->store(buf, bytes, &my_charset_bin);
6916
6916
}
6917
6917
#endif
7444
7444
void Table_map_log_event::pack_info(Protocol *protocol)
7445
7445
{
7446
7446
    char buf[256];
7447
 
    size_t bytes= my_snprintf(buf, sizeof(buf),
7448
 
                                 "table_id: %lu (%s.%s)",
7449
 
                              m_table_id, m_dbnam, m_tblnam);
 
7447
    size_t bytes= snprintf(buf, sizeof(buf),
 
7448
                           "table_id: %lu (%s.%s)",
 
7449
                           m_table_id, m_dbnam, m_tblnam);
7450
7450
    protocol->store(buf, bytes, &my_charset_bin);
7451
7451
}
7452
7452
#endif
8536
8536
  char buf[256];
8537
8537
  size_t bytes;
8538
8538
  if (m_message.length > 0)
8539
 
    bytes= my_snprintf(buf, sizeof(buf), "#%d (%s)",
8540
 
                       m_incident, description());
 
8539
    bytes= snprintf(buf, sizeof(buf), "#%d (%s)",
 
8540
                    m_incident, description());
8541
8541
  else
8542
 
    bytes= my_snprintf(buf, sizeof(buf), "#%d (%s): %s",
8543
 
                       m_incident, description(), m_message.str);
 
8542
    bytes= snprintf(buf, sizeof(buf), "#%d (%s): %s",
 
8543
                    m_incident, description(), m_message.str);
8544
8544
  protocol->store(buf, bytes, &my_charset_bin);
8545
8545
}
8546
8546
#endif