~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/statement/alter_table.cc

Merged in latest plugin-slot-reorg.

Show diffs side-by-side

added added

removed removed

Lines of Context:
61
61
  Select_Lex *select_lex= &session->lex->select_lex;
62
62
  bool need_start_waiting= false;
63
63
 
64
 
  /*
65
 
     Code in mysql_alter_table() may modify its HA_CREATE_INFO argument,
66
 
     so we have to use a copy of this structure to make execution
67
 
     prepared statement- safe. A shallow copy is enough as no memory
68
 
     referenced from this structure will be modified.
69
 
   */
70
 
  HA_CREATE_INFO create_info(session->lex->create_info);
71
 
  AlterInfo alter_info(session->lex->alter_info, session->mem_root);
72
 
 
73
 
  if (session->is_fatal_error) /* out of memory creating a copy of alter_info */
74
 
  {
75
 
    return true;
76
 
  }
77
 
 
78
64
  /* Must be set in the parser */
79
65
  assert(select_lex->db);
80
66
 
93
79
                              select_lex->db, 
94
80
                              session->lex->name.str,
95
81
                              &create_info,
96
 
                              session->lex->create_table_proto,
 
82
                              &create_table_proto,
97
83
                              first_table,
98
84
                              &alter_info,
99
85
                              select_lex->order_list.elements,
769
755
 
770
756
        build_table_filename(new_name_buff, sizeof(new_name_buff), new_db, new_name_buff, false);
771
757
 
772
 
        plugin::Registry &plugins= plugin::Registry::singleton();
773
 
        if (plugins.storage_engine.getTableProto(new_name_buff, NULL) == EEXIST)
 
758
        if (plugin::StorageEngine::getTableProto(new_name_buff, NULL) == EEXIST)
774
759
        {
775
760
          /* Table will be closed by Session::executeCommand() */
776
761
          my_error(ER_TABLE_EXISTS_ERROR, MYF(0), new_alias);
897
882
        we don't take this name-lock and where this order really matters.
898
883
        TODO: Investigate if we need this access() check at all.
899
884
      */
900
 
      plugin::Registry &plugins= plugin::Registry::singleton();
901
 
      if (plugins.storage_engine.getTableProto(new_name, NULL) == EEXIST)
 
885
      if (plugin::StorageEngine::getTableProto(new_name, NULL) == EEXIST)
902
886
      {
903
887
        my_error(ER_TABLE_EXISTS_ERROR, MYF(0), new_name);
904
888
        error= -1;