~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/parser.cc

  • Committer: Stewart Smith
  • Date: 2011-03-02 06:59:30 UTC
  • mto: (2241.1.2 build)
  • mto: This revision was merged to the branch mainline in revision 2242.
  • Revision ID: stewart@flamingspork.com-20110302065930-9gu2sy41w0omasfl
add fields, indexes and foreign keys to drop in ALTER TABLE DROP and DROP INDEX to the AlterTable protobuf message in parser

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
#include <drizzled/parser.h>
23
23
#include <drizzled/alter_info.h>
24
24
#include <drizzled/alter_drop.h>
 
25
#include <drizzled/message/alter_table.pb.h>
25
26
 
26
27
namespace drizzled {
27
28
namespace parser {
654
655
{
655
656
  statement::AlterTable *statement= (statement::AlterTable *)lex->statement;
656
657
 
 
658
  message::AlterTable::AlterTableOperation *operation;
 
659
  operation= lex->alter_table()->add_operations();
 
660
  operation->set_drop_name(name);
 
661
 
657
662
  statement->alter_info.flags.set(ALTER_DROP_INDEX);
658
663
  if (is_foreign_key)
659
664
  {
660
665
    statement->alter_info.flags.set(ALTER_FOREIGN_KEY);
661
666
    statement->alter_info.drop_list.push_back(new AlterDrop(AlterDrop::FOREIGN_KEY, name));
 
667
    operation->set_operation(message::AlterTable::AlterTableOperation::DROP_FOREIGN_KEY);
662
668
  }
663
669
  else
664
670
  {
665
671
    statement->alter_info.drop_list.push_back(new AlterDrop(AlterDrop::KEY, name));
 
672
    operation->set_operation(message::AlterTable::AlterTableOperation::DROP_KEY);
666
673
  }
667
674
}
668
675