~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/statement/rename_table.cc

  • Committer: Brian Aker
  • Date: 2010-10-08 16:11:47 UTC
  • mto: This revision was merged to the branch mainline in revision 1834.
  • Revision ID: brian@tangent.org-20101008161147-o3us2a8itszsaycx
Typdef our lock type.

Show diffs side-by-side

added added

removed removed

Lines of Context:
71
71
  if (wait_if_global_read_lock(session, 0, 1))
72
72
    return true;
73
73
 
74
 
  pthread_mutex_lock(&LOCK_open); /* Rename table lock for exclusive access */
 
74
  LOCK_open.lock(); /* Rename table lock for exclusive access */
75
75
  if (lock_table_names_exclusively(session, table_list))
76
76
  {
77
 
    pthread_mutex_unlock(&LOCK_open);
 
77
    LOCK_open.unlock();
78
78
    goto err;
79
79
  }
80
80
 
105
105
    higher concurrency - query_cache_invalidate can take minutes to
106
106
    complete.
107
107
  */
108
 
  pthread_mutex_unlock(&LOCK_open);
 
108
  LOCK_open.unlock();
109
109
 
110
110
  /* Lets hope this doesn't fail as the result will be messy */
111
111
  if (! error)
114
114
    session->my_ok();
115
115
  }
116
116
 
117
 
  pthread_mutex_lock(&LOCK_open); /* unlock all tables held */
 
117
  LOCK_open.lock(); /* unlock all tables held */
118
118
  unlock_table_names(table_list, NULL);
119
 
  pthread_mutex_unlock(&LOCK_open);
 
119
  LOCK_open.unlock();
120
120
 
121
121
err:
122
122
  start_waiting_global_read_lock(session);
171
171
    return 1; // This can't be skipped
172
172
  }
173
173
 
174
 
  rc= mysql_rename_table(engine, old_identifier, new_identifier, 0);
 
174
  rc= mysql_rename_table(*session, engine, old_identifier, new_identifier);
175
175
  if (rc && ! skip_error)
176
176
    return true;
177
177