~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/parser.cc

  • Committer: Brian Aker
  • Date: 2011-02-09 21:10:41 UTC
  • mto: (2152.2.1 alter-table)
  • mto: This revision was merged to the branch mainline in revision 2154.
  • Revision ID: brian@tangent.org-20110209211041-27m3bizfynts4nf5
Merge up parser work for additional column builds.

Show diffs side-by-side

added added

removed removed

Lines of Context:
624
624
  }
625
625
}
626
626
 
 
627
void buildAutoOnColumn(LEX *lex)
 
628
{
 
629
  lex->type|= AUTO_INCREMENT_FLAG | NOT_NULL_FLAG;
 
630
 
 
631
  if (lex->field())
 
632
  {
 
633
    lex->field()->mutable_constraints()->set_is_notnull(true);
 
634
  }
 
635
}
 
636
 
 
637
void buildPrimaryOnColumn(LEX *lex)
 
638
{
 
639
  statement::AlterTable *statement= (statement::AlterTable *)lex->statement;
 
640
 
 
641
  lex->type|= PRI_KEY_FLAG | NOT_NULL_FLAG;
 
642
  statement->alter_info.flags.set(ALTER_ADD_INDEX);
 
643
 
 
644
  if (lex->field())
 
645
  {
 
646
    lex->field()->mutable_constraints()->set_is_notnull(true);
 
647
  }
 
648
}
 
649
 
627
650
} // namespace parser
628
651
} // namespace drizzled