~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_table.cc

  • Committer: Brian Aker
  • Date: 2010-10-22 22:02:32 UTC
  • mfrom: (1864.3.17 catalogs)
  • Revision ID: brian@tangent.org-20101022220232-p4l1i9a3ud5asw0d
Merge in Brian. key creation should be improved after this (ie for share)

Show diffs side-by-side

added added

removed removed

Lines of Context:
160
160
 
161
161
  for (table= tables; table; table= table->next_local)
162
162
  {
163
 
    char *db=table->db;
 
163
    char *db= table->db;
 
164
    TableIdentifier tmp_identifier(table->db, table->table_name);
164
165
 
165
 
    error= session->drop_temporary_table(table);
 
166
    error= session->drop_temporary_table(tmp_identifier);
166
167
 
167
168
    switch (error) {
168
169
    case  0:
179
180
    if (drop_temporary == false)
180
181
    {
181
182
      Table *locked_table;
182
 
      TableIdentifier identifier(db, table->table_name);
183
 
      abort_locked_tables(session, identifier);
184
 
      remove_table_from_cache(session, identifier,
 
183
      abort_locked_tables(session, tmp_identifier);
 
184
      remove_table_from_cache(session, tmp_identifier,
185
185
                              RTFC_WAIT_OTHER_THREAD_FLAG |
186
186
                              RTFC_CHECK_KILLED_FLAG);
187
187
      /*
188
188
        If the table was used in lock tables, remember it so that
189
189
        unlock_table_names can free it
190
190
      */
191
 
      if ((locked_table= drop_locked_tables(session, identifier)))
 
191
      if ((locked_table= drop_locked_tables(session, tmp_identifier)))
192
192
        table->table= locked_table;
193
193
 
194
194
      if (session->killed)
2060
2060
                             bool is_if_not_exists,
2061
2061
                             bool is_engine_set)
2062
2062
{
2063
 
  char *db= table->db;
2064
2063
  char *table_name= table->table_name;
2065
2064
  bool res= true;
2066
2065
  uint32_t not_used;
2091
2090
  bool table_exists= false;
2092
2091
  if (destination_identifier.isTmp())
2093
2092
  {
2094
 
    if (session->find_temporary_table(db, table_name))
 
2093
    if (session->find_temporary_table(destination_identifier))
2095
2094
    {
2096
2095
      table_exists= true;
2097
2096
    }