~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/db.cc

  • Committer: Brian Aker
  • Date: 2010-02-20 01:08:20 UTC
  • mto: (1273.13.97 build)
  • mto: This revision was merged to the branch mainline in revision 1309.
  • Revision ID: brian@gaz-20100220010820-3wq3nlq0h70j8xd3
More removal.

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
#include <drizzled/replication_services.h>
39
39
#include <drizzled/message/schema.pb.h>
40
40
#include "drizzled/sql_table.h"
41
 
#include "drizzled/plugin/info_schema_table.h"
42
41
#include "drizzled/global_charset_info.h"
43
42
#include "drizzled/pthread_globals.h"
44
43
#include "drizzled/charset.h"
218
217
  int error_erno;
219
218
  bool error= false;
220
219
 
221
 
  /* do not create 'information_schema' db */
222
 
  if (!my_strcasecmp(system_charset_info, db, INFORMATION_SCHEMA_NAME.c_str()))
223
 
  {
224
 
    my_error(ER_DB_CREATE_EXISTS, MYF(0), db);
225
 
    return(-1);
226
 
  }
227
 
 
228
220
  schema_message->set_name(db);
229
221
 
230
222
  /*
377
369
  uint32_t length;
378
370
  TableList *dropped_tables= NULL;
379
371
 
380
 
  if (db && (strcmp(db, "information_schema") == 0))
381
 
  {
382
 
    my_error(ER_DBACCESS_DENIED_ERROR, MYF(0), "", "", INFORMATION_SCHEMA_NAME.c_str());
383
 
    return true;
384
 
  }
385
 
 
386
372
  /*
387
373
    Do not drop database if another thread is holding read lock.
388
374
    Wait for global read lock before acquiring LOCK_create_db.
828
814
  assert(new_db_name);
829
815
  assert(new_db_name->length);
830
816
 
831
 
  if (my_strcasecmp(system_charset_info, new_db_name->str,
832
 
                    INFORMATION_SCHEMA_NAME.c_str()) == 0)
833
 
  {
834
 
    /* Switch the current database to INFORMATION_SCHEMA. */
835
 
    /* const_cast<> is safe here: mysql_change_db_impl does a copy */
836
 
    LEX_STRING is_name= { const_cast<char *>(INFORMATION_SCHEMA_NAME.c_str()),
837
 
                          INFORMATION_SCHEMA_NAME.length() };
838
 
    mysql_change_db_impl(session, &is_name);
839
 
 
840
 
    return false;
841
 
  }
842
817
  /*
843
818
    Now we need to make a copy because check_db_name requires a
844
819
    non-constant argument. Actually, it takes database file name.