~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to sql/sql_table.cc

Removed my_vsnprintf and my_snprintf.

Show diffs side-by-side

added added

removed removed

Lines of Context:
236
236
  DBUG_ENTER("build_tmptable_filename");
237
237
 
238
238
  char *p= strnmov(buff, mysql_tmpdir, bufflen);
239
 
  my_snprintf(p, bufflen - (p - buff), "/%s%lx_%lx_%x%s",
 
239
  snprintf(p, bufflen - (p - buff), "/%s%lx_%lx_%x%s",
240
240
              tmp_file_prefix, current_pid,
241
241
              thd->thread_id, thd->tmp_table++, reg_ext);
242
242
 
2461
2461
            {
2462
2462
              /* not a critical problem */
2463
2463
              char warn_buff[MYSQL_ERRMSG_SIZE];
2464
 
              my_snprintf(warn_buff, sizeof(warn_buff), ER(ER_TOO_LONG_KEY),
2465
 
                          length);
 
2464
              snprintf(warn_buff, sizeof(warn_buff), ER(ER_TOO_LONG_KEY),
 
2465
                       length);
2466
2466
              push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
2467
2467
                           ER_TOO_LONG_KEY, warn_buff);
2468
2468
              /* Align key length to multibyte char boundary */
2500
2500
        {
2501
2501
          /* not a critical problem */
2502
2502
          char warn_buff[MYSQL_ERRMSG_SIZE];
2503
 
          my_snprintf(warn_buff, sizeof(warn_buff), ER(ER_TOO_LONG_KEY),
2504
 
                      length);
 
2503
          snprintf(warn_buff, sizeof(warn_buff), ER(ER_TOO_LONG_KEY),
 
2504
                   length);
2505
2505
          push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
2506
2506
                       ER_TOO_LONG_KEY, warn_buff);
2507
2507
          /* Align key length to multibyte char boundary */
3366
3366
  if (stat(from, &stat_info))
3367
3367
    goto end;                           // Can't use USE_FRM flag
3368
3368
 
3369
 
  my_snprintf(tmp, sizeof(tmp), "%s-%lx_%lx",
3370
 
              from, current_pid, thd->thread_id);
 
3369
  snprintf(tmp, sizeof(tmp), "%s-%lx_%lx",
 
3370
           from, current_pid, thd->thread_id);
3371
3371
 
3372
3372
  /* If we could open the table, close it */
3373
3373
  if (table_list->table)
3569
3569
      protocol->store(table_name, system_charset_info);
3570
3570
      protocol->store(operator_name, system_charset_info);
3571
3571
      protocol->store(STRING_WITH_LEN("error"), system_charset_info);
3572
 
      length= my_snprintf(buff, sizeof(buff), ER(ER_OPEN_AS_READONLY),
3573
 
                          table_name);
 
3572
      length= snprintf(buff, sizeof(buff), ER(ER_OPEN_AS_READONLY),
 
3573
                       table_name);
3574
3574
      protocol->store(buff, length, system_charset_info);
3575
3575
      ha_autocommit_or_rollback(thd, 0);
3576
3576
      end_trans(thd, COMMIT);
3678
3678
    case HA_ADMIN_NOT_IMPLEMENTED:
3679
3679
      {
3680
3680
        char buf[ERRMSGSIZE+20];
3681
 
        uint length=my_snprintf(buf, ERRMSGSIZE,
3682
 
                                ER(ER_CHECK_NOT_IMPLEMENTED), operator_name);
 
3681
        uint length=snprintf(buf, ERRMSGSIZE,
 
3682
                             ER(ER_CHECK_NOT_IMPLEMENTED), operator_name);
3683
3683
        protocol->store(STRING_WITH_LEN("note"), system_charset_info);
3684
3684
        protocol->store(buf, length, system_charset_info);
3685
3685
      }
3688
3688
    case HA_ADMIN_NOT_BASE_TABLE:
3689
3689
      {
3690
3690
        char buf[ERRMSGSIZE+20];
3691
 
        uint length= my_snprintf(buf, ERRMSGSIZE,
3692
 
                                 ER(ER_BAD_TABLE_ERROR), table_name);
 
3691
        uint length= snprintf(buf, ERRMSGSIZE,
 
3692
                              ER(ER_BAD_TABLE_ERROR), table_name);
3693
3693
        protocol->store(STRING_WITH_LEN("note"), system_charset_info);
3694
3694
        protocol->store(buf, length, system_charset_info);
3695
3695
      }
3806
3806
      uint length;
3807
3807
 
3808
3808
      protocol->store(STRING_WITH_LEN("error"), system_charset_info);
3809
 
      length=my_snprintf(buf, ERRMSGSIZE, ER(ER_TABLE_NEEDS_UPGRADE), table->table_name);
 
3809
      length=snprintf(buf, ERRMSGSIZE, ER(ER_TABLE_NEEDS_UPGRADE), table->table_name);
3810
3810
      protocol->store(buf, length, system_charset_info);
3811
3811
      fatal_error=1;
3812
3812
      break;
3815
3815
    default:                            // Probably HA_ADMIN_INTERNAL_ERROR
3816
3816
      {
3817
3817
        char buf[ERRMSGSIZE+20];
3818
 
        uint length=my_snprintf(buf, ERRMSGSIZE,
3819
 
                                "Unknown - internal error %d during operation",
3820
 
                                result_code);
 
3818
        uint length=snprintf(buf, ERRMSGSIZE,
 
3819
                             "Unknown - internal error %d during operation",
 
3820
                             result_code);
3821
3821
        protocol->store(STRING_WITH_LEN("error"), system_charset_info);
3822
3822
        protocol->store(buf, length, system_charset_info);
3823
3823
        fatal_error=1;
4211
4211
  if (create_info->options & HA_LEX_CREATE_IF_NOT_EXISTS)
4212
4212
  {
4213
4213
    char warn_buff[MYSQL_ERRMSG_SIZE];
4214
 
    my_snprintf(warn_buff, sizeof(warn_buff),
4215
 
                ER(ER_TABLE_EXISTS_ERROR), table_name);
 
4214
    snprintf(warn_buff, sizeof(warn_buff),
 
4215
             ER(ER_TABLE_EXISTS_ERROR), table_name);
4216
4216
    push_warning(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
4217
4217
                 ER_TABLE_EXISTS_ERROR,warn_buff);
4218
4218
    res= false;
4920
4920
  char path[FN_REFLEN];
4921
4921
  DBUG_ENTER("create_altered_table");
4922
4922
 
4923
 
  my_snprintf(tmp_name, sizeof(tmp_name), "%s-%lx_%lx",
4924
 
              tmp_file_prefix, current_pid, thd->thread_id);
 
4923
  snprintf(tmp_name, sizeof(tmp_name), "%s-%lx_%lx",
 
4924
           tmp_file_prefix, current_pid, thd->thread_id);
4925
4925
  /* Safety fix for InnoDB */
4926
4926
  if (lower_case_table_names)
4927
4927
    my_casedn_str(files_charset_info, tmp_name);
5987
5987
      close_temporary_table(thd, altered_table, 1, 1);
5988
5988
  }
5989
5989
 
5990
 
  my_snprintf(tmp_name, sizeof(tmp_name), "%s-%lx_%lx", tmp_file_prefix,
5991
 
              current_pid, thd->thread_id);
 
5990
  snprintf(tmp_name, sizeof(tmp_name), "%s-%lx_%lx", tmp_file_prefix,
 
5991
           current_pid, thd->thread_id);
5992
5992
  /* Safety fix for innodb */
5993
5993
  if (lower_case_table_names)
5994
5994
    my_casedn_str(files_charset_info, tmp_name);
6114
6114
  */
6115
6115
 
6116
6116
  thd_proc_info(thd, "rename result table");
6117
 
  my_snprintf(old_name, sizeof(old_name), "%s2-%lx-%lx", tmp_file_prefix,
6118
 
              current_pid, thd->thread_id);
 
6117
  snprintf(old_name, sizeof(old_name), "%s2-%lx-%lx", tmp_file_prefix,
 
6118
           current_pid, thd->thread_id);
6119
6119
  if (lower_case_table_names)
6120
6120
    my_casedn_str(files_charset_info, old_name);
6121
6121
 
6225
6225
  }
6226
6226
 
6227
6227
end_temporary:
6228
 
  my_snprintf(tmp_name, sizeof(tmp_name), ER(ER_INSERT_INFO),
6229
 
              (ulong) (copied + deleted), (ulong) deleted,
6230
 
              (ulong) thd->cuted_fields);
 
6228
  snprintf(tmp_name, sizeof(tmp_name), ER(ER_INSERT_INFO),
 
6229
           (ulong) (copied + deleted), (ulong) deleted,
 
6230
           (ulong) thd->cuted_fields);
6231
6231
  my_ok(thd, copied + deleted, 0L, tmp_name);
6232
6232
  thd->some_tables_deleted=0;
6233
6233
  DBUG_RETURN(false);
6381
6381
    if (to->s->primary_key != MAX_KEY && to->file->primary_key_is_clustered())
6382
6382
    {
6383
6383
      char warn_buff[MYSQL_ERRMSG_SIZE];
6384
 
      my_snprintf(warn_buff, sizeof(warn_buff), 
6385
 
                  "ORDER BY ignored as there is a user-defined clustered index"
6386
 
                  " in the table '%-.192s'", from->s->table_name.str);
 
6384
      snprintf(warn_buff, sizeof(warn_buff), 
 
6385
               "ORDER BY ignored as there is a user-defined clustered index"
 
6386
               " in the table '%-.192s'", from->s->table_name.str);
6387
6387
      push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, ER_UNKNOWN_ERROR,
6388
6388
                   warn_buff);
6389
6389
    }