~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_yacc.yy

  • Committer: Brian Aker
  • Date: 2009-09-22 23:50:38 UTC
  • mto: This revision was merged to the branch mainline in revision 1135.
  • Revision ID: brian@gaz-20090922235038-qvval31jbygum3nb
Remove KEY_CREATE_INFO from global lex.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1174
1174
            lex->current_select= &lex->select_lex; 
1175
1175
            assert(statement->create_info.db_type);
1176
1176
          }
1177
 
        | CREATE build_method opt_unique INDEX_SYM ident key_alg 
1178
 
          ON table_ident
 
1177
        | CREATE build_method
1179
1178
          {
1180
1179
            LEX *lex=Lex;
1181
1180
            lex->sql_command= SQLCOM_CREATE_INDEX;
1183
1182
            lex->statement= statement;
1184
1183
            if (lex->statement == NULL)
1185
1184
              DRIZZLE_YYABORT;
1186
 
            if (!lex->current_select->add_table_to_list(lex->session, $8,
 
1185
            statement->alter_info.flags.set(ALTER_ADD_INDEX);
 
1186
            statement->alter_info.build_method= $2;
 
1187
            lex->col_list.empty();
 
1188
            lex->change=NULL;
 
1189
          }
 
1190
          opt_unique INDEX_SYM ident key_alg ON table_ident '(' key_list ')' key_options
 
1191
          {
 
1192
            LEX *lex=Lex;
 
1193
            statement::CreateIndex *statement= (statement::CreateIndex *)Lex->statement;
 
1194
 
 
1195
            if (!lex->current_select->add_table_to_list(lex->session, $9,
1187
1196
                                                        NULL,
1188
1197
                                                        TL_OPTION_UPDATING))
1189
1198
              DRIZZLE_YYABORT;
1190
 
            statement->alter_info.flags.set(ALTER_ADD_INDEX);
1191
 
            statement->alter_info.build_method= $2;
1192
 
            lex->col_list.empty();
1193
 
            lex->change=NULL;
1194
 
          }
1195
 
          '(' key_list ')' key_options
1196
 
          {
1197
 
            LEX *lex=Lex;
1198
 
            statement::CreateIndex *statement= (statement::CreateIndex *)Lex->statement;
1199
1199
            Key *key;
1200
 
            key= new Key($3, $5, &lex->key_create_info, 0,
1201
 
                         lex->col_list);
 
1200
            key= new Key($4, $6, &statement->key_create_info, 0, lex->col_list);
1202
1201
            statement->alter_info.key_list.push_back(key);
1203
1202
            lex->col_list.empty();
1204
1203
          }
1510
1509
          {
1511
1510
            LEX *lex=Lex;
1512
1511
            statement::AlterTable *statement= (statement::AlterTable *)Lex->statement;
1513
 
            Key *key= new Key($1, $2, &lex->key_create_info, 0,
 
1512
            Key *key= new Key($1, $2, &statement->key_create_info, 0,
1514
1513
                              lex->col_list);
1515
1514
            statement->alter_info.key_list.push_back(key);
1516
1515
            lex->col_list.empty(); /* Alloced by sql_alloc */
1520
1519
          {
1521
1520
            LEX *lex=Lex;
1522
1521
            statement::AlterTable *statement= (statement::AlterTable *)Lex->statement;
1523
 
            Key *key= new Key($2, $3.str ? $3 : $1, &lex->key_create_info, 0,
 
1522
            Key *key= new Key($2, $3.str ? $3 : $1, &statement->key_create_info, 0,
1524
1523
                              lex->col_list);
1525
1524
            statement->alter_info.key_list.push_back(key);
1526
1525
            lex->col_list.empty(); /* Alloced by sql_alloc */
2013
2012
 
2014
2013
init_key_options:
2015
2014
          {
2016
 
            Lex->key_create_info= default_key_create_info;
 
2015
            ((statement::CreateTable *)Lex->statement)->key_create_info= default_key_create_info;
2017
2016
          }
2018
2017
        ;
2019
2018
 
2039
2038
        ;
2040
2039
 
2041
2040
key_using_alg:
2042
 
          USING btree_or_rtree     { Lex->key_create_info.algorithm= $2; }
2043
 
        | TYPE_SYM btree_or_rtree  { Lex->key_create_info.algorithm= $2; }
 
2041
          USING btree_or_rtree     { ((statement::CreateTable *)Lex->statement)->key_create_info.algorithm= $2; }
 
2042
        | TYPE_SYM btree_or_rtree  { ((statement::CreateTable *)Lex->statement)->key_create_info.algorithm= $2; }
2044
2043
        ;
2045
2044
 
2046
2045
key_opt:
2047
2046
          key_using_alg
2048
2047
        | KEY_BLOCK_SIZE opt_equal ulong_num
2049
 
          { Lex->key_create_info.block_size= $3; }
 
2048
          { ((statement::CreateTable *)Lex->statement)->key_create_info.block_size= $3; }
2050
2049
        | COMMENT_SYM TEXT_STRING_sys
2051
 
          { Lex->key_create_info.comment= $2; }
 
2050
          { ((statement::CreateTable *)Lex->statement)->key_create_info.comment= $2; }
2052
2051
        ;
2053
2052
 
2054
2053
btree_or_rtree: