~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/db.cc

  • Committer: Brian Aker
  • Date: 2010-07-20 01:23:40 UTC
  • mto: This revision was merged to the branch mainline in revision 1665.
  • Revision ID: brian@gaz-20100720012340-unsredwj0ubf69k5
Remove table names options.

Show diffs side-by-side

added added

removed removed

Lines of Context:
55
55
 
56
56
static long drop_tables_via_filenames(Session *session,
57
57
                                 SchemaIdentifier &schema_identifier,
58
 
                                 plugin::TableNameList &dropped_tables);
 
58
                                 TableIdentifiers &dropped_tables);
59
59
static void mysql_change_db_impl(Session *session);
60
60
static void mysql_change_db_impl(Session *session, SchemaIdentifier &schema_identifier);
61
61
 
214
214
{
215
215
  long deleted=0;
216
216
  int error= false;
217
 
  plugin::TableNameList dropped_tables;
 
217
  TableIdentifiers dropped_tables;
218
218
  message::Schema schema_proto;
219
219
 
220
220
  /*
299
299
    query_end= query + MAX_DROP_TABLE_Q_LEN;
300
300
 
301
301
    TransactionServices &transaction_services= TransactionServices::singleton();
302
 
    for (plugin::TableNameList::iterator it= dropped_tables.begin();
 
302
    for (TableIdentifiers::iterator it= dropped_tables.begin();
303
303
         it != dropped_tables.end();
304
304
         it++)
305
305
    {
306
306
      uint32_t tbl_name_len;
307
307
 
308
308
      /* 3 for the quotes and the comma*/
309
 
      tbl_name_len= (*it).length() + 3;
 
309
      tbl_name_len= (*it).getTableName().length() + 3;
310
310
      if (query_pos + tbl_name_len + 1 >= query_end)
311
311
      {
312
312
        /* These DDL methods and logging protected with LOCK_create_db */
315
315
      }
316
316
 
317
317
      *query_pos++ = '`';
318
 
      query_pos= strcpy(query_pos, (*it).c_str()) + (tbl_name_len-3);
 
318
      query_pos= strcpy(query_pos, (*it).getTableName().c_str()) + (tbl_name_len-3);
319
319
      *query_pos++ = '`';
320
320
      *query_pos++ = ',';
321
321
    }
490
490
 
491
491
static long drop_tables_via_filenames(Session *session,
492
492
                                      SchemaIdentifier &schema_identifier,
493
 
                                      plugin::TableNameList &dropped_tables)
 
493
                                      TableIdentifiers &dropped_tables)
494
494
{
495
495
  long deleted= 0;
496
496
  TableList *tot_list= NULL, **tot_list_next;
497
497
 
498
498
  tot_list_next= &tot_list;
499
499
 
500
 
  plugin::StorageEngine::getTableNames(*session, schema_identifier, dropped_tables);
 
500
  plugin::StorageEngine::getTableIdentifiers(*session, schema_identifier, dropped_tables);
501
501
 
502
 
  for (plugin::TableNameList::iterator it= dropped_tables.begin();
 
502
  for (TableIdentifiers::iterator it= dropped_tables.begin();
503
503
       it != dropped_tables.end();
504
504
       it++)
505
505
  {
509
509
    TableList *table_list=(TableList*)
510
510
      session->calloc(sizeof(*table_list) +
511
511
                      db_len + 1 +
512
 
                      (*it).length() + 1);
 
512
                      (*it).getTableName().length() + 1);
513
513
 
514
514
    if (not table_list)
515
515
      return -1;
516
516
 
517
517
    table_list->db= (char*) (table_list+1);
518
518
    table_list->table_name= strcpy(table_list->db, schema_identifier.getSchemaName().c_str()) + db_len + 1;
519
 
    TableIdentifier::filename_to_tablename((*it).c_str(), table_list->table_name, (*it).size() + 1);
 
519
    TableIdentifier::filename_to_tablename((*it).getTableName().c_str(), table_list->table_name, (*it).getTableName().size() + 1);
520
520
    table_list->alias= table_list->table_name;  // If lower_case_table_names=2
521
 
    table_list->setInternalTmpTable((strncmp((*it).c_str(),
 
521
    table_list->setInternalTmpTable((strncmp((*it).getTableName().c_str(),
522
522
                                             TMP_FILE_PREFIX,
523
523
                                             strlen(TMP_FILE_PREFIX)) == 0));
524
524
    /* Link into list */