~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_yacc.yy

  • Committer: Stewart Smith
  • Date: 2010-07-13 01:12:39 UTC
  • mto: (1638.10.46)
  • mto: This revision was merged to the branch mainline in revision 1701.
  • Revision ID: stewart@flamingspork.com-20100713011239-nwgjq3r0oxtaax0w
use the ENUM in the table proto instead of duplicating it for Foreign key options and match option. A move in the direction of just having foreign keys in the proto

Show diffs side-by-side

added added

removed removed

Lines of Context:
372
372
  enum drizzled::index_hint_type index_hint;
373
373
  enum drizzled::enum_filetype filetype;
374
374
  enum drizzled::ha_build_method build_method;
375
 
  enum drizzled::Foreign_key::fk_option m_fk_option;
 
375
  drizzled::message::Table::ForeignKeyConstraint::ForeignKeyOption m_fk_option;
376
376
}
377
377
 
378
378
%{
1945
1945
 
1946
1946
opt_match_clause:
1947
1947
          /* empty */
1948
 
          { ((statement::CreateTable *)Lex->statement)->fk_match_option= Foreign_key::FK_MATCH_UNDEF; }
 
1948
          { ((statement::CreateTable *)Lex->statement)->fk_match_option= drizzled::message::Table::ForeignKeyConstraint::MATCH_UNDEFINED; }
1949
1949
        | MATCH FULL
1950
 
          { ((statement::CreateTable *)Lex->statement)->fk_match_option= Foreign_key::FK_MATCH_FULL; }
 
1950
          { ((statement::CreateTable *)Lex->statement)->fk_match_option= drizzled::message::Table::ForeignKeyConstraint::MATCH_FULL; }
1951
1951
        | MATCH PARTIAL
1952
 
          { ((statement::CreateTable *)Lex->statement)->fk_match_option= Foreign_key::FK_MATCH_PARTIAL; }
 
1952
          { ((statement::CreateTable *)Lex->statement)->fk_match_option= drizzled::message::Table::ForeignKeyConstraint::MATCH_PARTIAL; }
1953
1953
        | MATCH SIMPLE_SYM
1954
 
          { ((statement::CreateTable *)Lex->statement)->fk_match_option= Foreign_key::FK_MATCH_SIMPLE; }
 
1954
          { ((statement::CreateTable *)Lex->statement)->fk_match_option= drizzled::message::Table::ForeignKeyConstraint::MATCH_SIMPLE; }
1955
1955
        ;
1956
1956
 
1957
1957
opt_on_update_delete:
1958
1958
          /* empty */
1959
1959
          {
1960
 
            ((statement::CreateTable *)Lex->statement)->fk_update_opt= Foreign_key::FK_OPTION_UNDEF;
1961
 
            ((statement::CreateTable *)Lex->statement)->fk_delete_opt= Foreign_key::FK_OPTION_UNDEF;
 
1960
            ((statement::CreateTable *)Lex->statement)->fk_update_opt= drizzled::message::Table::ForeignKeyConstraint::OPTION_UNDEF;
 
1961
            ((statement::CreateTable *)Lex->statement)->fk_delete_opt= drizzled::message::Table::ForeignKeyConstraint::OPTION_UNDEF;
1962
1962
          }
1963
1963
        | ON UPDATE_SYM delete_option
1964
1964
          {
1965
1965
            ((statement::CreateTable *)Lex->statement)->fk_update_opt= $3;
1966
 
            ((statement::CreateTable *)Lex->statement)->fk_delete_opt= Foreign_key::FK_OPTION_UNDEF;
 
1966
            ((statement::CreateTable *)Lex->statement)->fk_delete_opt= drizzled::message::Table::ForeignKeyConstraint::OPTION_UNDEF;
1967
1967
          }
1968
1968
        | ON DELETE_SYM delete_option
1969
1969
          {
1970
 
            ((statement::CreateTable *)Lex->statement)->fk_update_opt= Foreign_key::FK_OPTION_UNDEF;
 
1970
            ((statement::CreateTable *)Lex->statement)->fk_update_opt= drizzled::message::Table::ForeignKeyConstraint::OPTION_UNDEF;
1971
1971
            ((statement::CreateTable *)Lex->statement)->fk_delete_opt= $3;
1972
1972
          }
1973
1973
        | ON UPDATE_SYM delete_option
1985
1985
        ;
1986
1986
 
1987
1987
delete_option:
1988
 
          RESTRICT      { $$= Foreign_key::FK_OPTION_RESTRICT; }
1989
 
        | CASCADE       { $$= Foreign_key::FK_OPTION_CASCADE; }
1990
 
        | SET NULL_SYM  { $$= Foreign_key::FK_OPTION_SET_NULL; }
1991
 
        | NO_SYM ACTION { $$= Foreign_key::FK_OPTION_NO_ACTION; }
1992
 
        | SET DEFAULT   { $$= Foreign_key::FK_OPTION_DEFAULT;  }
 
1988
          RESTRICT      { $$= drizzled::message::Table::ForeignKeyConstraint::OPTION_RESTRICT; }
 
1989
        | CASCADE       { $$= drizzled::message::Table::ForeignKeyConstraint::OPTION_CASCADE; }
 
1990
        | SET NULL_SYM  { $$= drizzled::message::Table::ForeignKeyConstraint::OPTION_SET_NULL; }
 
1991
        | NO_SYM ACTION { $$= drizzled::message::Table::ForeignKeyConstraint::OPTION_NO_ACTION; }
 
1992
        | SET DEFAULT   { $$= drizzled::message::Table::ForeignKeyConstraint::OPTION_DEFAULT;  }
1993
1993
        ;
1994
1994
 
1995
1995
key_type: