~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/db.cc

  • Committer: Brian Aker
  • Date: 2011-01-03 00:42:36 UTC
  • mto: (2054.1.1 clean)
  • mto: This revision was merged to the branch mainline in revision 2049.
  • Revision ID: brian@tangent.org-20110103004236-d2p1mhyp2bcdf1a0
Only change schemas if we DROP the schema.

Show diffs side-by-side

added added

removed removed

Lines of Context:
261
261
      error= plugin::StorageEngine::dropSchema(*session, schema_identifier);
262
262
    }
263
263
 
264
 
    /*
265
 
      If this database was the client's selected database, we silently
266
 
      change the client's selected database to nothing (to have an empty
267
 
      SELECT DATABASE() in the future). For this we free() session->db and set
268
 
      it to 0.
269
 
    */
270
 
    if (schema_identifier.compare(*session->schema()))
271
 
      change_db_impl(session);
272
264
  } while (0);
273
265
 
 
266
  /*
 
267
    If this database was the client's selected database, we silently
 
268
    change the client's selected database to nothing (to have an empty
 
269
    SELECT DATABASE() in the future). For this we free() session->db and set
 
270
    it to 0.
 
271
  */
 
272
  if (not error and schema_identifier.compare(*session->schema()))
 
273
    change_db_impl(session);
 
274
 
274
275
  session->startWaitingGlobalReadLock();
275
276
 
276
277
  return error;