~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/statement/drop_index.cc

  • Committer: patrick crews
  • Date: 2011-03-15 12:12:09 UTC
  • mfrom: (1099.4.216 drizzle)
  • Revision ID: gleebix@gmail.com-20110315121209-8g2tkf31w0rx9ter
Tags: 2011.03.12
Updated translations

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
#include <drizzled/statement/alter_table.h>
27
27
#include <drizzled/plugin/storage_engine.h>
28
28
 
29
 
namespace drizzled
30
 
{
 
29
namespace drizzled {
31
30
 
32
31
bool statement::DropIndex::execute()
33
32
{
34
 
  TableList *first_table= (TableList *) getSession()->getLex()->select_lex.table_list.first;
35
 
  TableList *all_tables= getSession()->getLex()->query_tables;
 
33
  TableList *first_table= (TableList *) lex().select_lex.table_list.first;
 
34
  TableList *all_tables= lex().query_tables;
36
35
 
37
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 */
38
37
  message::table::shared_ptr original_table_message;
39
38
  {
40
39
    identifier::Table identifier(first_table->getSchemaName(), first_table->getTableName());
41
 
    if (not (original_table_message= plugin::StorageEngine::getTableMessage(*getSession(), identifier)))
 
40
    if (not (original_table_message= plugin::StorageEngine::getTableMessage(session(), identifier)))
42
41
    {
43
42
      my_error(ER_BAD_TABLE_ERROR, identifier);
44
43
      return true;
57
56
  HA_CREATE_INFO create_info;
58
57
 
59
58
  assert(first_table == all_tables && first_table != 0);
60
 
  if (getSession()->inTransaction())
 
59
  if (session().inTransaction())
61
60
  {
62
61
    my_error(ER_TRANSACTIONAL_DDL_NOT_SUPPORTED, MYF(0));
63
62
    return true;
72
71
 
73
72
    create_info.default_table_charset= plugin::StorageEngine::getSchemaCollation(identifier);
74
73
 
75
 
    res= alter_table(getSession(), 
 
74
    res= alter_table(&session(), 
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= getSession()->find_temporary_table(catch22);
 
87
    Table *table= session().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(getSession(), 
 
93
      res= alter_table(&session(), 
95
94
                       identifier,
96
95
                       identifier,
97
96
                       &create_info,