~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/db.cc

  • Committer: Toru Maesaka
  • Date: 2008-12-03 07:42:39 UTC
  • mto: (656.1.5 devel)
  • mto: This revision was merged to the branch mainline in revision 665.
  • Revision ID: dev@torum.net-20081203074239-4qwr4u7prq7uqxet
First pass of replacing MySQL's my_stpcpy() with appropriate libc calls

Show diffs side-by-side

added added

removed removed

Lines of Context:
293
293
    }
294
294
    
295
295
    opt->name= tmp_name;
296
 
    my_stpcpy(opt->name, dbname);
 
296
    strcpy(opt->name, dbname);
297
297
    opt->name_length= length;
298
298
    
299
299
    if ((error= my_hash_insert(&dboptions, (unsigned char*) opt)))
800
800
  pthread_mutex_lock(&LOCK_drizzle_create_db);
801
801
 
802
802
  length= build_table_filename(path, sizeof(path), db, "", "", 0);
803
 
  my_stpcpy(path+length, MY_DB_OPT_FILE);               // Append db option file name
 
803
  strcpy(path+length, MY_DB_OPT_FILE);          // Append db option file name
804
804
  del_dbopt(path);                              // Remove dboption hash entry
805
805
  path[length]= '\0';                           // Remove file name
806
806
 
877
877
 
878
878
    if (!(query= (char*) session->alloc(MAX_DROP_TABLE_Q_LEN)))
879
879
      goto exit; /* not much else we can do */
880
 
    query_pos= query_data_start= my_stpcpy(query,"drop table ");
 
880
    query_pos= query_data_start= strcpy(query,"drop table ")+11;
881
881
    query_end= query + MAX_DROP_TABLE_Q_LEN;
882
882
    db_len= strlen(db);
883
883
 
895
895
      }
896
896
 
897
897
      *query_pos++ = '`';
898
 
      query_pos= my_stpcpy(query_pos,tbl->table_name);
 
898
      query_pos= strcpy(query_pos,tbl->table_name) + (tbl_name_len-3);
899
899
      *query_pos++ = '`';
900
900
      *query_pos++ = ',';
901
901
    }
973
973
    if (db && !my_strcasecmp(files_charset_info,
974
974
                             extension, reg_ext))
975
975
    {
 
976
      uint32_t db_len= strlen(db);
 
977
 
976
978
      /* Drop the table nicely */
977
979
      *extension= 0;                    // Remove extension
978
980
      TableList *table_list=(TableList*)
979
981
                              session->calloc(sizeof(*table_list) + 
980
 
                                          strlen(db) + 1 +
 
982
                                          db_len + 1 +
981
983
                                          MYSQL50_TABLE_NAME_PREFIX_LENGTH + 
982
984
                                          strlen(file->name) + 1);
983
985
 
984
986
      if (!table_list)
985
987
        goto err;
986
988
      table_list->db= (char*) (table_list+1);
987
 
      table_list->table_name= my_stpcpy(table_list->db, db) + 1;
 
989
      table_list->table_name= strcpy(table_list->db, db) + db_len + 1;
988
990
      filename_to_tablename(file->name, table_list->table_name,
989
991
                            MYSQL50_TABLE_NAME_PREFIX_LENGTH +
990
992
                            strlen(file->name) + 1);