~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/db.cc

  • Committer: Stewart Smith
  • Date: 2009-12-04 08:13:31 UTC
  • mto: (1240.3.7 build)
  • mto: This revision was merged to the branch mainline in revision 1241.
  • Revision ID: stewart@flamingspork.com-20091204081331-ghrh8v99fm5dhon3
ALTER DATABASE using NormalisedDatabaseName

Show diffs side-by-side

added added

removed removed

Lines of Context:
270
270
 
271
271
/* db-name is already validated when we come here */
272
272
 
273
 
bool mysql_alter_db(Session *session, const char *db, HA_CREATE_INFO *create_info)
 
273
bool mysql_alter_db(Session *session, const NormalisedDatabaseName &database_name, HA_CREATE_INFO *create_info)
274
274
{
275
275
  ReplicationServices &replication_services= ReplicationServices::singleton();
276
276
  long result=1;
296
296
  pthread_mutex_lock(&LOCK_create_db);
297
297
 
298
298
  /* Change options if current database is being altered. */
299
 
  path_len= build_table_filename(path, sizeof(path), db, "", false);
 
299
  path_len= build_table_filename(path, sizeof(path), database_name.to_string().c_str(), "", false);
300
300
  path[path_len-1]= 0;                    // Remove last '/' from path
301
301
 
302
 
  error= write_schema_file(session, path, db, create_info);
 
302
  error= write_schema_file(session, path, database_name.to_string().c_str(), create_info);
303
303
  if (error && error != EEXIST)
304
304
  {
305
305
    /* TODO: find some witty way of getting back an error message */