~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/statement/drop_index.cc

  • Committer: Brian Aker
  • Date: 2011-01-22 18:52:16 UTC
  • mfrom: (2098.4.1 catalogs)
  • Revision ID: brian@tangent.org-20110122185216-18and6vncipd7x72
Session encapsulation.

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
 
31
31
bool statement::DropIndex::execute()
32
32
{
33
 
  TableList *first_table= (TableList *) session->lex->select_lex.table_list.first;
34
 
  TableList *all_tables= session->lex->query_tables;
 
33
  TableList *first_table= (TableList *) getSession()->lex->select_lex.table_list.first;
 
34
  TableList *all_tables= getSession()->lex->query_tables;
35
35
 
36
36
  /* Chicken/Egg... we need to search for the table, to know if the table exists, so we can build a full identifier from it */
37
37
  message::table::shared_ptr original_table_message;
38
38
  {
39
39
    identifier::Table identifier(first_table->getSchemaName(), first_table->getTableName());
40
 
    if (plugin::StorageEngine::getTableDefinition(*session, identifier, original_table_message) != EEXIST)
 
40
    if (plugin::StorageEngine::getTableDefinition(*getSession(), identifier, original_table_message) != EEXIST)
41
41
    {
42
42
      my_error(ER_BAD_TABLE_ERROR, identifier);
43
43
      return true;
56
56
  HA_CREATE_INFO create_info;
57
57
 
58
58
  assert(first_table == all_tables && first_table != 0);
59
 
  if (session->inTransaction())
 
59
  if (getSession()->inTransaction())
60
60
  {
61
61
    my_error(ER_TRANSACTIONAL_DDL_NOT_SUPPORTED, MYF(0));
62
62
    return true;
63
63
  }
64
64
 
65
 
  memset(&create_info, 0, sizeof(create_info));
66
65
  create_info.db_type= 0;
67
66
 
68
67
  bool res;
72
71
 
73
72
    create_info.default_table_charset= plugin::StorageEngine::getSchemaCollation(identifier);
74
73
 
75
 
    res= alter_table(session, 
 
74
    res= alter_table(getSession(), 
76
75
                     identifier,
77
76
                     identifier,
78
77
                     &create_info, 
85
84
  else
86
85
  {
87
86
    identifier::Table catch22(first_table->getSchemaName(), first_table->getTableName());
88
 
    Table *table= session->find_temporary_table(catch22);
 
87
    Table *table= getSession()->find_temporary_table(catch22);
89
88
    assert(table);
90
89
    {
91
90
      identifier::Table identifier(first_table->getSchemaName(), first_table->getTableName(), table->getShare()->getPath());
92
91
      create_info.default_table_charset= plugin::StorageEngine::getSchemaCollation(identifier);
93
92
 
94
 
      res= alter_table(session, 
 
93
      res= alter_table(getSession(), 
95
94
                       identifier,
96
95
                       identifier,
97
96
                       &create_info,