~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/log.cc

  • Committer: brian
  • Date: 2008-08-01 17:27:37 UTC
  • mfrom: (261.1.6 drizzle)
  • Revision ID: brian@localhost.localdomain-20080801172737-v6f9pau23un0bwfl
Merge from Monty

Show diffs side-by-side

added added

removed removed

Lines of Context:
1152
1152
  file_info= dir_info->dir_entry;
1153
1153
  for (i=dir_info->number_off_files ; i-- ; file_info++)
1154
1154
  {
1155
 
    if (memcmp((uchar*) file_info->name, (uchar*) start, length) == 0 &&
 
1155
    if (memcmp(file_info->name, start, length) == 0 &&
1156
1156
        test_if_number(file_info->name+length, &number,0))
1157
1157
    {
1158
1158
      set_if_bigger(max_found,(ulong) number);
1274
1274
    called only in main(). Doing initialization here would make it happen
1275
1275
    before main().
1276
1276
  */
1277
 
  memset((char*) &log_file, 0, sizeof(log_file));
 
1277
  memset(&log_file, 0, sizeof(log_file));
1278
1278
}
1279
1279
 
1280
1280
void MYSQL_LOG::init_pthread_objects()
1688
1688
    before main().
1689
1689
  */
1690
1690
  index_file_name[0] = 0;
1691
 
  memset((char*) &index_file, 0, sizeof(index_file));
 
1691
  memset(&index_file, 0, sizeof(index_file));
1692
1692
}
1693
1693
 
1694
1694
/* this is called only once */
2164
2164
    {
2165
2165
      if (my_errno == ENOENT) 
2166
2166
      {
2167
 
        push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
 
2167
        push_warning_printf(current_thd, DRIZZLE_ERROR::WARN_LEVEL_WARN,
2168
2168
                            ER_LOG_PURGE_NO_FILE, ER(ER_LOG_PURGE_NO_FILE),
2169
2169
                            linfo.log_file_name);
2170
2170
        sql_print_information("Failed to delete file '%s'",
2174
2174
      }
2175
2175
      else
2176
2176
      {
2177
 
        push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
 
2177
        push_warning_printf(current_thd, DRIZZLE_ERROR::WARN_LEVEL_ERROR,
2178
2178
                            ER_BINLOG_PURGE_FATAL_ERR,
2179
2179
                            "a problem with deleting %s; "
2180
2180
                            "consider examining correspondence "
2195
2195
  {
2196
2196
    if (my_errno == ENOENT) 
2197
2197
    {
2198
 
      push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
 
2198
      push_warning_printf(current_thd, DRIZZLE_ERROR::WARN_LEVEL_WARN,
2199
2199
                          ER_LOG_PURGE_NO_FILE, ER(ER_LOG_PURGE_NO_FILE),
2200
2200
                          index_file_name);
2201
2201
      sql_print_information("Failed to delete file '%s'",
2205
2205
    }
2206
2206
    else
2207
2207
    {
2208
 
      push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
 
2208
      push_warning_printf(current_thd, DRIZZLE_ERROR::WARN_LEVEL_ERROR,
2209
2209
                          ER_BINLOG_PURGE_FATAL_ERR,
2210
2210
                          "a problem with deleting %s; "
2211
2211
                          "consider examining correspondence "
2413
2413
          It's not fatal if we can't stat a log file that does not exist;
2414
2414
          If we could not stat, we won't delete.
2415
2415
        */     
2416
 
        push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
 
2416
        push_warning_printf(current_thd, DRIZZLE_ERROR::WARN_LEVEL_WARN,
2417
2417
                            ER_LOG_PURGE_NO_FILE, ER(ER_LOG_PURGE_NO_FILE),
2418
2418
                            log_info.log_file_name);
2419
2419
        sql_print_information("Failed to execute stat on file '%s'",
2425
2425
        /*
2426
2426
          Other than ENOENT are fatal
2427
2427
        */
2428
 
        push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
 
2428
        push_warning_printf(current_thd, DRIZZLE_ERROR::WARN_LEVEL_ERROR,
2429
2429
                            ER_BINLOG_PURGE_FATAL_ERR,
2430
2430
                            "a problem with getting info on being purged %s; "
2431
2431
                            "consider examining correspondence "
2447
2447
      {
2448
2448
        if (my_errno == ENOENT) 
2449
2449
        {
2450
 
          push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
 
2450
          push_warning_printf(current_thd, DRIZZLE_ERROR::WARN_LEVEL_WARN,
2451
2451
                              ER_LOG_PURGE_NO_FILE, ER(ER_LOG_PURGE_NO_FILE),
2452
2452
                              log_info.log_file_name);
2453
2453
          sql_print_information("Failed to delete file '%s'",
2456
2456
        }
2457
2457
        else
2458
2458
        {
2459
 
          push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
 
2459
          push_warning_printf(current_thd, DRIZZLE_ERROR::WARN_LEVEL_ERROR,
2460
2460
                              ER_BINLOG_PURGE_FATAL_ERR,
2461
2461
                              "a problem with deleting %s; "
2462
2462
                              "consider examining correspondence "
2539
2539
        /*
2540
2540
          It's not fatal if we can't stat a log file that does not exist.
2541
2541
        */     
2542
 
        push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
 
2542
        push_warning_printf(current_thd, DRIZZLE_ERROR::WARN_LEVEL_WARN,
2543
2543
                            ER_LOG_PURGE_NO_FILE, ER(ER_LOG_PURGE_NO_FILE),
2544
2544
                            log_info.log_file_name);
2545
2545
        sql_print_information("Failed to execute stat on file '%s'",
2551
2551
        /*
2552
2552
          Other than ENOENT are fatal
2553
2553
        */
2554
 
        push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
 
2554
        push_warning_printf(current_thd, DRIZZLE_ERROR::WARN_LEVEL_ERROR,
2555
2555
                            ER_BINLOG_PURGE_FATAL_ERR,
2556
2556
                            "a problem with getting info on being purged %s; "
2557
2557
                            "consider examining correspondence "
2571
2571
        if (my_errno == ENOENT) 
2572
2572
        {
2573
2573
          /* It's not fatal even if we can't delete a log file */
2574
 
          push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
 
2574
          push_warning_printf(current_thd, DRIZZLE_ERROR::WARN_LEVEL_WARN,
2575
2575
                              ER_LOG_PURGE_NO_FILE, ER(ER_LOG_PURGE_NO_FILE),
2576
2576
                              log_info.log_file_name);
2577
2577
          sql_print_information("Failed to delete file '%s'",
2580
2580
        }
2581
2581
        else
2582
2582
        {
2583
 
          push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
 
2583
          push_warning_printf(current_thd, DRIZZLE_ERROR::WARN_LEVEL_ERROR,
2584
2584
                              ER_BINLOG_PURGE_FATAL_ERR,
2585
2585
                              "a problem with deleting %s; "
2586
2586
                              "consider examining correspondence "
3427
3427
      assert(carry < LOG_EVENT_HEADER_LEN);
3428
3428
 
3429
3429
      /* assemble both halves */
3430
 
      memcpy(&header[carry], (char *)cache->read_pos, LOG_EVENT_HEADER_LEN - carry);
 
3430
      memcpy(&header[carry], cache->read_pos, LOG_EVENT_HEADER_LEN - carry);
3431
3431
 
3432
3432
      /* fix end_log_pos */
3433
3433
      val= uint4korr(&header[LOG_POS_OFFSET]) + group;
3441
3441
        copy fixed second half of header to cache so the correct
3442
3442
        version will be written later.
3443
3443
      */
3444
 
      memcpy((char *)cache->read_pos, &header[carry], LOG_EVENT_HEADER_LEN - carry);
 
3444
      memcpy(cache->read_pos, &header[carry], LOG_EVENT_HEADER_LEN - carry);
3445
3445
 
3446
3446
      /* next event header at ... */
3447
3447
      hdr_offs = uint4korr(&header[EVENT_LEN_OFFSET]) - carry;
3470
3470
        if (hdr_offs + LOG_EVENT_HEADER_LEN > length)
3471
3471
        {
3472
3472
          carry= length - hdr_offs;
3473
 
          memcpy(header, (char *)cache->read_pos + hdr_offs, carry);
 
3473
          memcpy(header, cache->read_pos + hdr_offs, carry);
3474
3474
          length= hdr_offs;
3475
3475
        }
3476
3476
        else