~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/statement/alter_table.cc

  • Committer: Olaf van der Spek
  • Date: 2011-10-14 10:07:18 UTC
  • mto: This revision was merged to the branch mainline in revision 2438.
  • Revision ID: olafvdspek@gmail.com-20111014100718-n1i5vtysh1gajn70
Use assign(), data() and size()

Show diffs side-by-side

added added

removed removed

Lines of Context:
165
165
  {
166
166
    identifier::Table identifier(first_table->getSchemaName(), first_table->getTableName());
167
167
    identifier::Table new_identifier(select_lex->db ? select_lex->db : first_table->getSchemaName(),
168
 
                                   lex().name.str ? lex().name.str : first_table->getTableName());
 
168
                                   lex().name.data() ? lex().name.data() : first_table->getTableName());
169
169
 
170
170
    res= alter_table(&session(),
171
171
                     identifier,
187
187
    {
188
188
      identifier::Table identifier(first_table->getSchemaName(), first_table->getTableName(), table->getMutableShare()->getPath());
189
189
      identifier::Table new_identifier(select_lex->db ? select_lex->db : first_table->getSchemaName(),
190
 
                                       lex().name.str ? lex().name.str : first_table->getTableName(),
 
190
                                       lex().name.data() ? lex().name.data() : first_table->getTableName(),
191
191
                                       table->getMutableShare()->getPath());
192
192
 
193
193
      res= alter_table(&session(),
592
592
 
593
593
        Foreign_key *fkey= (Foreign_key*)key;
594
594
        add_foreign_key_to_table_message(&table_message,
595
 
                                         fkey->name.str,
 
595
                                         fkey->name.data(),
596
596
                                         fkey->columns,
597
597
                                         fkey->ref_table,
598
598
                                         fkey->ref_columns,
604
604
      if (key->type != Key::FOREIGN_KEY)
605
605
        new_key_list.push_back(key);
606
606
 
607
 
      if (key->name.str && is_primary_key(key->name.str))
 
607
      if (key->name.data() && is_primary_key(key->name.data()))
608
608
      {
609
 
        my_error(ER_WRONG_NAME_FOR_INDEX, MYF(0), key->name.str);
 
609
        my_error(ER_WRONG_NAME_FOR_INDEX, MYF(0), key->name.data());
610
610
        return true;
611
611
      }
612
612
    }