~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_table.cc

  • Committer: Mats Kindahl
  • Date: 2008-08-26 07:32:59 UTC
  • mto: (489.1.2 codestyle)
  • mto: This revision was merged to the branch mainline in revision 491.
  • Revision ID: mats@mysql.com-20080826073259-9k4evtajgldgolli
Replaced use of thd_proc_info() macro with calls to
set_proc_info() and get_proc_info() internally.  Introduced
functions set_thd_proc_info() and get_thd_proc_info() for
external users, i.e., plug-ins.

The set_thd_proc_info() accepted callers info that can be used to
print debug output, but the information was not used. The return
value was changed to void and the old value is not fetched any
more. To be able to get the value of proc_info for external
users, the function get_thd_proc_info() was introduced.

The thd_proc_info() macro called set_thd_proc_info() but almost
never used the return value of set_thd_proc_info() so the macro
was replaced with a call of THD::set_proc_info().

Show diffs side-by-side

added added

removed removed

Lines of Context:
1845
1845
    }
1846
1846
  }
1847
1847
 
1848
 
  thd_proc_info(thd, "creating table");
 
1848
  thd->set_proc_info("creating table");
1849
1849
  create_info->table_existed= 0;                // Mark that table is created
1850
1850
 
1851
1851
#ifdef HAVE_READLINK
1907
1907
  VOID(pthread_mutex_unlock(&LOCK_open));
1908
1908
 
1909
1909
err:
1910
 
  thd_proc_info(thd, "After create");
 
1910
  thd->set_proc_info("After create");
1911
1911
  delete file;
1912
1912
  return(error);
1913
1913
 
3142
3142
    ALTER Table
3143
3143
  */
3144
3144
 
3145
 
  thd_proc_info(thd, "discard_or_import_tablespace");
 
3145
  thd->set_proc_info("discard_or_import_tablespace");
3146
3146
 
3147
3147
  discard= test(tablespace_op == DISCARD_TABLESPACE);
3148
3148
 
3159
3159
 
3160
3160
  error= table->file->ha_discard_or_import_tablespace(discard);
3161
3161
 
3162
 
  thd_proc_info(thd, "end");
 
3162
  thd->set_proc_info("end");
3163
3163
 
3164
3164
  if (error)
3165
3165
    goto err;
4386
4386
    to simplify further comparisons: we want to see if it's a RENAME
4387
4387
    later just by comparing the pointers, avoiding the need for strcmp.
4388
4388
  */
4389
 
  thd_proc_info(thd, "init");
 
4389
  thd->set_proc_info("init");
4390
4390
  table_name=table_list->table_name;
4391
4391
  alias= (lower_case_table_names == 2) ? table_list->alias : table_name;
4392
4392
  db=table_list->db;
4511
4511
    goto err;
4512
4512
  }
4513
4513
 
4514
 
  thd_proc_info(thd, "setup");
 
4514
  thd->set_proc_info("setup");
4515
4515
  if (!(alter_info->flags & ~(ALTER_RENAME | ALTER_KEYS_ONOFF)) &&
4516
4516
      !table->s->tmp_table) // no need to touch frm
4517
4517
  {
4566
4566
 
4567
4567
    if (!error && (new_name != table_name || new_db != db))
4568
4568
    {
4569
 
      thd_proc_info(thd, "rename");
 
4569
      thd->set_proc_info("rename");
4570
4570
      /*
4571
4571
        Then do a 'simple' rename of the table. First we need to close all
4572
4572
        instances of 'source' table.
4815
4815
  /* Copy the data if necessary. */
4816
4816
  thd->count_cuted_fields= CHECK_FIELD_WARN;    // calc cuted fields
4817
4817
  thd->cuted_fields=0L;
4818
 
  thd_proc_info(thd, "copy to tmp table");
 
4818
  thd->set_proc_info("copy to tmp table");
4819
4819
  copied=deleted=0;
4820
4820
  /*
4821
4821
    We do not copy data for MERGE tables. Only the children have data.
4900
4900
       call to remove name-locks from table cache and list of open table.
4901
4901
  */
4902
4902
 
4903
 
  thd_proc_info(thd, "rename result table");
 
4903
  thd->set_proc_info("rename result table");
4904
4904
  snprintf(old_name, sizeof(old_name), "%s2-%lx-%lx", tmp_file_prefix,
4905
4905
           current_pid, thd->thread_id);
4906
4906
  if (lower_case_table_names)
4961
4961
  }
4962
4962
  VOID(pthread_mutex_unlock(&LOCK_open));
4963
4963
 
4964
 
  thd_proc_info(thd, "end");
 
4964
  thd->set_proc_info("end");
4965
4965
 
4966
4966
  ha_binlog_log_query(thd, create_info->db_type, LOGCOM_ALTER_TABLE,
4967
4967
                      thd->query, thd->query_length,