~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/statement/create_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:
41
41
 
42
42
bool statement::CreateIndex::execute()
43
43
{
44
 
  TableList *first_table= (TableList *) session->lex->select_lex.table_list.first;
45
 
  TableList *all_tables= session->lex->query_tables;
 
44
  TableList *first_table= (TableList *) getSession()->lex->select_lex.table_list.first;
 
45
  TableList *all_tables= getSession()->lex->query_tables;
46
46
 
47
47
  /* Chicken/Egg... we need to search for the table, to know if the table exists, so we can build a full identifier from it */
48
48
  message::table::shared_ptr original_table_message;
49
49
  {
50
50
    identifier::Table identifier(first_table->getSchemaName(), first_table->getTableName());
51
 
    if (plugin::StorageEngine::getTableDefinition(*session, identifier, original_table_message) != EEXIST)
 
51
    if (plugin::StorageEngine::getTableDefinition(*getSession(), identifier, original_table_message) != EEXIST)
52
52
    {
53
53
      my_error(ER_BAD_TABLE_ERROR, identifier);
54
54
      return true;
65
65
  */
66
66
 
67
67
  assert(first_table == all_tables && first_table != 0);
68
 
  if (session->inTransaction())
 
68
  if (getSession()->inTransaction())
69
69
  {
70
70
    my_error(ER_TRANSACTIONAL_DDL_NOT_SUPPORTED, MYF(0));
71
71
    return true;
77
77
    identifier::Table identifier(first_table->getSchemaName(), first_table->getTableName());
78
78
    create_info().default_table_charset= plugin::StorageEngine::getSchemaCollation(identifier);
79
79
 
80
 
    res= alter_table(session, 
 
80
    res= alter_table(getSession(), 
81
81
                     identifier,
82
82
                     identifier,
83
83
                     &create_info(), 
90
90
  else
91
91
  {
92
92
    identifier::Table catch22(first_table->getSchemaName(), first_table->getTableName());
93
 
    Table *table= session->find_temporary_table(catch22);
 
93
    Table *table= getSession()->find_temporary_table(catch22);
94
94
    assert(table);
95
95
    {
96
96
      identifier::Table identifier(first_table->getSchemaName(), first_table->getTableName(), table->getMutableShare()->getPath());
97
97
      create_info().default_table_charset= plugin::StorageEngine::getSchemaCollation(identifier);
98
98
 
99
 
      res= alter_table(session, 
 
99
      res= alter_table(getSession(), 
100
100
                       identifier,
101
101
                       identifier,
102
102
                       &create_info(),