~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/parser.cc

  • Committer: Lee Bieber
  • Date: 2011-03-18 04:10:25 UTC
  • mfrom: (2241.1.2 build)
  • Revision ID: kalebral@gmail.com-20110318041025-1xoj1azy6zobhnbm
Merge Stewart - refactoring of default values
Merge Olaf - more refactoring

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
#include <drizzled/session.h>
23
23
#include <drizzled/parser.h>
24
24
#include <drizzled/alter_info.h>
25
 
#include <drizzled/alter_drop.h>
 
25
 
 
26
#include <drizzled/message/alter_table.pb.h>
26
27
#include <drizzled/item/subselect.h>
27
28
#include <drizzled/sql_lex.h>
28
29
 
392
393
  lex->charset= NULL;
393
394
  statement->column_format= COLUMN_FORMAT_TYPE_DEFAULT;
394
395
 
395
 
  message::AlterTable &alter_proto= ((statement::CreateTable *)lex->statement)->alter_info.alter_proto;
396
 
  lex->setField(alter_proto.add_added_field());
 
396
  message::AddedFields &added_fields_proto= ((statement::CreateTable *)lex->statement)->alter_info.added_fields_proto;
 
397
  lex->setField(added_fields_proto.add_added_field());
397
398
}
398
399
 
399
400
void storeAlterColumnPosition(LEX *lex, const char *position)
656
657
{
657
658
  statement::AlterTable *statement= (statement::AlterTable *)lex->statement;
658
659
 
 
660
  message::AlterTable::AlterTableOperation *operation;
 
661
  operation= lex->alter_table()->add_operations();
 
662
  operation->set_drop_name(name);
 
663
 
659
664
  statement->alter_info.flags.set(ALTER_DROP_INDEX);
660
665
  if (is_foreign_key)
661
666
  {
662
667
    statement->alter_info.flags.set(ALTER_FOREIGN_KEY);
663
 
    statement->alter_info.drop_list.push_back(AlterDrop(AlterDrop::FOREIGN_KEY, name));
 
668
    operation->set_operation(message::AlterTable::AlterTableOperation::DROP_FOREIGN_KEY);
664
669
  }
665
670
  else
666
671
  {
667
 
    statement->alter_info.drop_list.push_back(AlterDrop(AlterDrop::KEY, name));
 
672
    operation->set_operation(message::AlterTable::AlterTableOperation::DROP_KEY);
668
673
  }
669
674
}
670
675