~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_base.cc

  • Committer: Brian Aker
  • Date: 2008-08-09 21:43:24 UTC
  • mfrom: (279.1.4 codestyle)
  • Revision ID: brian@tangent.org-20080809214324-jy2c15bx49naddsf
Merge from Monty

Show diffs side-by-side

added added

removed removed

Lines of Context:
102
102
uint create_table_def_key(THD *thd, char *key, TABLE_LIST *table_list,
103
103
                          bool tmp_table)
104
104
{
105
 
  uint key_length= (uint) (strmov(strmov(key, table_list->db)+1,
 
105
  uint key_length= (uint) (stpcpy(stpcpy(key, table_list->db)+1,
106
106
                                  table_list->table_name)-key)+1;
107
107
  if (tmp_table)
108
108
  {
574
574
      open_list=0;                              // Out of memory
575
575
      break;
576
576
    }
577
 
    strmov((*start_list)->table=
578
 
           strmov(((*start_list)->db= (char*) ((*start_list)+1)),
 
577
    stpcpy((*start_list)->table=
 
578
           stpcpy(((*start_list)->db= (char*) ((*start_list)+1)),
579
579
                  share->db.str)+1,
580
580
           share->table_name.str);
581
581
    (*start_list)->in_use= entry->in_use ? 1 : 0;
1957
1957
  char key[MAX_DBKEY_LENGTH];
1958
1958
  uint key_length;
1959
1959
 
1960
 
  key_length= (uint)(strmov(strmov(key, db) + 1, table_name) - key) + 1;
 
1960
  key_length= (uint)(stpcpy(stpcpy(key, db) + 1, table_name) - key) + 1;
1961
1961
  VOID(pthread_mutex_lock(&LOCK_open));
1962
1962
 
1963
1963
  if (hash_search(&open_cache, (uchar *)key, key_length))
2498
2498
TABLE *find_locked_table(THD *thd, const char *db,const char *table_name)
2499
2499
{
2500
2500
  char  key[MAX_DBKEY_LENGTH];
2501
 
  uint key_length=(uint) (strmov(strmov(key,db)+1,table_name)-key)+1;
 
2501
  uint key_length=(uint) (stpcpy(stpcpy(key,db)+1,table_name)-key)+1;
2502
2502
 
2503
2503
  for (TABLE *table=thd->open_tables; table ; table=table->next)
2504
2504
  {
3229
3229
      if ((query= (char*) my_malloc(query_buf_size,MYF(MY_WME))))
3230
3230
      {
3231
3231
        /* this DELETE FROM is needed even with row-based binlogging */
3232
 
        end = strxmov(strmov(query, "DELETE FROM `"),
 
3232
        end = strxmov(stpcpy(query, "DELETE FROM `"),
3233
3233
                      share->db.str,"`.`",share->table_name.str,"`", NullS);
3234
3234
        thd->binlog_query(THD::STMT_QUERY_TYPE,
3235
3235
                          query, (ulong)(end-query), false, false);
3912
3912
 
3913
3913
  share= (TABLE_SHARE*) (tmp_table+1);
3914
3914
  tmp_path= (char*) (share+1);
3915
 
  saved_cache_key= strmov(tmp_path, path)+1;
 
3915
  saved_cache_key= stpcpy(tmp_path, path)+1;
3916
3916
  memcpy(saved_cache_key, cache_key, key_length);
3917
3917
 
3918
3918
  init_tmp_table_share(thd, share, saved_cache_key, key_length,
3971
3971
  handler *file;
3972
3972
  char *ext;
3973
3973
 
3974
 
  strmov(ext= strend(path), reg_ext);
 
3974
  stpcpy(ext= strend(path), reg_ext);
3975
3975
  if (my_delete(path,MYF(0)))
3976
3976
    error=1; /* purecov: inspected */
3977
3977
  *ext= 0;                              // remove extension
6482
6482
  TABLE_SHARE *share;
6483
6483
  bool result= 0, signalled= 0;
6484
6484
 
6485
 
  key_length=(uint) (strmov(strmov(key,db)+1,table_name)-key)+1;
 
6485
  key_length=(uint) (stpcpy(stpcpy(key,db)+1,table_name)-key)+1;
6486
6486
  for (;;)
6487
6487
  {
6488
6488
    HASH_SEARCH_STATE state;