~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/statement/alter_table.cc

  • Committer: Stewart Smith
  • Date: 2010-07-29 16:44:36 UTC
  • mfrom: (1638.9.8)
  • mto: (1720.1.1 drizzle)
  • mto: This revision was merged to the branch mainline in revision 1721.
  • Revision ID: stewart@flamingspork.com-20100729164436-dsrth68ahiuutvpe
merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
871
871
                                 order_st *order,
872
872
                                 bool ignore)
873
873
{
874
 
  Table *new_table= NULL;
875
874
  int error= 0;
876
875
  char tmp_name[80];
877
876
  char old_name[32];
971
970
        error= 0;
972
971
        push_warning_printf(session, DRIZZLE_ERROR::WARN_LEVEL_NOTE,
973
972
                            ER_ILLEGAL_HA, ER(ER_ILLEGAL_HA),
974
 
                            table->alias);
 
973
                            table->getAlias());
975
974
      }
976
975
 
977
976
      pthread_mutex_lock(&LOCK_open); /* Lock to remove all instances of table from table cache before ALTER */
1019
1018
        error= 0;
1020
1019
        push_warning_printf(session, DRIZZLE_ERROR::WARN_LEVEL_NOTE,
1021
1020
                            ER_ILLEGAL_HA, ER(ER_ILLEGAL_HA),
1022
 
                            table->alias);
 
1021
                            table->getAlias());
1023
1022
      }
1024
1023
 
1025
1024
      if (error == 0)
1073
1072
  }
1074
1073
 
1075
1074
  /* Open the table so we need to copy the data to it. */
1076
 
  new_table= open_alter_table(session, table, new_table_as_temporary);
 
1075
  Table *new_table= open_alter_table(session, table, new_table_as_temporary);
 
1076
 
1077
1077
 
1078
1078
  if (not new_table)
1079
1079
  {
1171
1171
        new_table->intern_close_table();
1172
1172
        if (new_table->hasShare())
1173
1173
        {
1174
 
          assert(new_table->getShare()->newed);
1175
1174
          delete new_table->s;
1176
1175
          new_table->s= NULL;
1177
1176
        }
1178
1177
 
1179
 
        free(new_table);
 
1178
        delete new_table;
1180
1179
      }
1181
1180
 
1182
1181
      pthread_mutex_lock(&LOCK_open); /* ALTER TABLE */
1223
1222
 
1224
1223
      if (new_table->hasShare())
1225
1224
      {
1226
 
        assert(new_table->getShare()->newed);
1227
1225
        delete new_table->s;
1228
1226
        new_table->s= NULL;
1229
1227
      }
1230
1228
 
1231
 
      free(new_table);
 
1229
      delete new_table;
1232
1230
    }
1233
1231
 
1234
1232
    pthread_mutex_lock(&LOCK_open); /* ALTER TABLE */