~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_yacc.yy

  • Committer: Padraig O'Sullivan
  • Date: 2009-07-08 05:17:48 UTC
  • mto: (1089.3.4 merge)
  • mto: This revision was merged to the branch mainline in revision 1092.
  • Revision ID: osullivan.padraig@gmail.com-20090708051748-divjj0ls5islzb7b
Modified the flags member of the Alter_info class to be std::bitset instead
of uint32_t

Show diffs side-by-side

added added

removed removed

Lines of Context:
1158
1158
                                                        TL_OPTION_UPDATING))
1159
1159
              DRIZZLE_YYABORT;
1160
1160
            lex->alter_info.reset();
1161
 
            lex->alter_info.flags= ALTER_ADD_INDEX;
 
1161
            lex->alter_info.flags.set(ALTER_ADD_INDEX);
1162
1162
            lex->alter_info.build_method= $2;
1163
1163
            lex->col_list.empty();
1164
1164
            lex->change=NULL;
1401
1401
          {
1402
1402
            Lex->create_info.row_type= $3;
1403
1403
            Lex->create_info.used_fields|= HA_CREATE_USED_ROW_FORMAT;
1404
 
            Lex->alter_info.flags|= ALTER_ROW_FORMAT;
 
1404
            Lex->alter_info.flags.set(ALTER_ROW_FORMAT);
1405
1405
          }
1406
1406
        | default_collation
1407
1407
        | DATA_SYM DIRECTORY_SYM opt_equal TEXT_STRING_sys
1545
1545
            lex->alter_info.key_list.push_back(key);
1546
1546
            lex->col_list.empty(); /* Alloced by sql_alloc */
1547
1547
            /* Only used for ALTER TABLE. Ignored otherwise. */
1548
 
            lex->alter_info.flags|= ALTER_FOREIGN_KEY;
 
1548
            lex->alter_info.flags.set(ALTER_FOREIGN_KEY);
1549
1549
          }
1550
1550
        | constraint opt_check_constraint
1551
1551
          {
1732
1732
        | COLUMN_FORMAT_SYM column_format_types
1733
1733
          {
1734
1734
            Lex->column_format= $2;
1735
 
            Lex->alter_info.flags|= ALTER_COLUMN_FORMAT;
 
1735
            Lex->alter_info.flags.set(ALTER_COLUMN_FORMAT);
1736
1736
          }
1737
1737
        | not NULL_SYM { Lex->type|= NOT_NULL_FLAG; }
1738
1738
        | DEFAULT now_or_signed_literal 
1739
1739
          { 
1740
1740
            Lex->default_value=$2; 
1741
 
            Lex->alter_info.flags|= ALTER_COLUMN_DEFAULT;
 
1741
            Lex->alter_info.flags.set(ALTER_COLUMN_DEFAULT);
1742
1742
          }
1743
1743
        | ON UPDATE_SYM NOW_SYM optional_braces 
1744
1744
          { Lex->on_update_value= new Item_func_now_local(); }
1747
1747
          { 
1748
1748
            LEX *lex=Lex;
1749
1749
            lex->type|= AUTO_INCREMENT_FLAG | NOT_NULL_FLAG | UNIQUE_FLAG;
1750
 
            lex->alter_info.flags|= ALTER_ADD_INDEX;
 
1750
            lex->alter_info.flags.set(ALTER_ADD_INDEX);
1751
1751
          }
1752
1752
        | opt_primary KEY_SYM
1753
1753
          {
1754
1754
            LEX *lex=Lex;
1755
1755
            lex->type|= PRI_KEY_FLAG | NOT_NULL_FLAG;
1756
 
            lex->alter_info.flags|= ALTER_ADD_INDEX;
 
1756
            lex->alter_info.flags.set(ALTER_ADD_INDEX);
1757
1757
          }
1758
1758
        | UNIQUE_SYM
1759
1759
          {
1760
1760
            LEX *lex=Lex;
1761
1761
            lex->type|= UNIQUE_FLAG; 
1762
 
            lex->alter_info.flags|= ALTER_ADD_INDEX;
 
1762
            lex->alter_info.flags.set(ALTER_ADD_INDEX);
1763
1763
          }
1764
1764
        | UNIQUE_SYM KEY_SYM
1765
1765
          {
1766
1766
            LEX *lex=Lex;
1767
1767
            lex->type|= UNIQUE_KEY_FLAG; 
1768
 
            lex->alter_info.flags|= ALTER_ADD_INDEX; 
 
1768
            lex->alter_info.flags.set(ALTER_ADD_INDEX);
1769
1769
          }
1770
1770
        | COMMENT_SYM TEXT_STRING_sys { Lex->comment= $2; }
1771
1771
        | COLLATE_SYM collation_name
2164
2164
          {
2165
2165
            LEX *lex=Lex;
2166
2166
            lex->change=0;
2167
 
            lex->alter_info.flags|= ALTER_ADD_COLUMN;
 
2167
            lex->alter_info.flags.set(ALTER_ADD_COLUMN);
2168
2168
          }
2169
2169
        ;
2170
2170
 
2172
2172
          add_column column_def opt_place { }
2173
2173
        | ADD key_def
2174
2174
          {
2175
 
            Lex->alter_info.flags|= ALTER_ADD_INDEX;
 
2175
            Lex->alter_info.flags.set(ALTER_ADD_INDEX);
2176
2176
          }
2177
2177
        | add_column '(' field_list ')'
2178
2178
          {
2179
 
            Lex->alter_info.flags|= ALTER_ADD_COLUMN | ALTER_ADD_INDEX;
 
2179
            Lex->alter_info.flags.set(ALTER_ADD_COLUMN);
 
2180
            Lex->alter_info.flags.set(ALTER_ADD_INDEX);
2180
2181
          }
2181
2182
        | CHANGE opt_column field_ident
2182
2183
          {
2183
2184
            LEX *lex=Lex;
2184
2185
            lex->change= $3.str;
2185
 
            lex->alter_info.flags|= ALTER_CHANGE_COLUMN;
 
2186
            lex->alter_info.flags.set(ALTER_CHANGE_COLUMN);
2186
2187
          }
2187
2188
          field_spec opt_place
2188
2189
        | MODIFY_SYM opt_column field_ident
2192
2193
            lex->default_value= lex->on_update_value= 0;
2193
2194
            lex->comment=null_lex_str;
2194
2195
            lex->charset= NULL;
2195
 
            lex->alter_info.flags|= ALTER_CHANGE_COLUMN;
 
2196
            lex->alter_info.flags.set(ALTER_CHANGE_COLUMN);
2196
2197
            lex->column_format= COLUMN_FORMAT_TYPE_DEFAULT;
2197
2198
          }
2198
2199
          field_def
2213
2214
            LEX *lex=Lex;
2214
2215
            lex->alter_info.drop_list.push_back(new Alter_drop(Alter_drop::COLUMN,
2215
2216
                                                               $3.str));
2216
 
            lex->alter_info.flags|= ALTER_DROP_COLUMN;
 
2217
            lex->alter_info.flags.set(ALTER_DROP_COLUMN);
2217
2218
          }
2218
2219
        | DROP FOREIGN KEY_SYM opt_ident
2219
2220
          {
2220
 
            Lex->alter_info.flags|= ALTER_DROP_INDEX | ALTER_FOREIGN_KEY;
 
2221
            Lex->alter_info.flags.set(ALTER_DROP_INDEX);
 
2222
            Lex->alter_info.flags.set(ALTER_FOREIGN_KEY);
2221
2223
          }
2222
2224
        | DROP PRIMARY_SYM KEY_SYM
2223
2225
          {
2224
2226
            LEX *lex=Lex;
2225
2227
            lex->alter_info.drop_list.push_back(new Alter_drop(Alter_drop::KEY,
2226
2228
                                                               "PRIMARY"));
2227
 
            lex->alter_info.flags|= ALTER_DROP_INDEX;
 
2229
            lex->alter_info.flags.set(ALTER_DROP_INDEX);
2228
2230
          }
2229
2231
        | DROP key_or_index field_ident
2230
2232
          {
2231
2233
            LEX *lex=Lex;
2232
2234
            lex->alter_info.drop_list.push_back(new Alter_drop(Alter_drop::KEY,
2233
2235
                                                               $3.str));
2234
 
            lex->alter_info.flags|= ALTER_DROP_INDEX;
 
2236
            lex->alter_info.flags.set(ALTER_DROP_INDEX);
2235
2237
          }
2236
2238
        | DISABLE_SYM KEYS
2237
2239
          {
2238
2240
            LEX *lex=Lex;
2239
2241
            lex->alter_info.keys_onoff= DISABLE;
2240
 
            lex->alter_info.flags|= ALTER_KEYS_ONOFF;
 
2242
            lex->alter_info.flags.set(ALTER_KEYS_ONOFF);
2241
2243
          }
2242
2244
        | ENABLE_SYM KEYS
2243
2245
          {
2244
2246
            LEX *lex=Lex;
2245
2247
            lex->alter_info.keys_onoff= ENABLE;
2246
 
            lex->alter_info.flags|= ALTER_KEYS_ONOFF;
 
2248
            lex->alter_info.flags.set(ALTER_KEYS_ONOFF);
2247
2249
          }
2248
2250
        | ALTER opt_column field_ident SET DEFAULT signed_literal
2249
2251
          {
2250
2252
            LEX *lex=Lex;
2251
2253
            lex->alter_info.alter_list.push_back(new Alter_column($3.str,$6));
2252
 
            lex->alter_info.flags|= ALTER_COLUMN_DEFAULT;
 
2254
            lex->alter_info.flags.set(ALTER_COLUMN_DEFAULT);
2253
2255
          }
2254
2256
        | ALTER opt_column field_ident DROP DEFAULT
2255
2257
          {
2256
2258
            LEX *lex=Lex;
2257
2259
            lex->alter_info.alter_list.push_back(new Alter_column($3.str,
2258
2260
                                                                  (Item*) 0));
2259
 
            lex->alter_info.flags|= ALTER_COLUMN_DEFAULT;
 
2261
            lex->alter_info.flags.set(ALTER_COLUMN_DEFAULT);
2260
2262
          }
2261
2263
        | RENAME opt_to table_ident
2262
2264
          {
2274
2276
              DRIZZLE_YYABORT;
2275
2277
            }
2276
2278
            lex->name= $3->table;
2277
 
            lex->alter_info.flags|= ALTER_RENAME;
 
2279
            lex->alter_info.flags.set(ALTER_RENAME);
2278
2280
          }
2279
2281
        | CONVERT_SYM TO_SYM collation_name_or_default
2280
2282
          {
2283
2285
            lex->create_info.default_table_charset= $3;
2284
2286
            lex->create_info.used_fields|= (HA_CREATE_USED_CHARSET |
2285
2287
              HA_CREATE_USED_DEFAULT_CHARSET);
2286
 
            lex->alter_info.flags|= ALTER_CONVERT;
 
2288
            lex->alter_info.flags.set(ALTER_CONVERT);
2287
2289
          }
2288
2290
        | create_table_options_space_separated
2289
2291
          {
2290
2292
            LEX *lex=Lex;
2291
 
            lex->alter_info.flags|= ALTER_OPTIONS;
 
2293
            lex->alter_info.flags.set(ALTER_OPTIONS);
2292
2294
          }
2293
2295
        | FORCE_SYM
2294
2296
          {
2295
 
            Lex->alter_info.flags|= ALTER_FORCE;
 
2297
            Lex->alter_info.flags.set(ALTER_FORCE);
2296
2298
          }
2297
2299
        | alter_order_clause
2298
2300
          {
2299
2301
            LEX *lex=Lex;
2300
 
            lex->alter_info.flags|= ALTER_ORDER;
 
2302
            lex->alter_info.flags.set(ALTER_ORDER);
2301
2303
          }
2302
2304
        ;
2303
2305
 
2316
2318
        | AFTER_SYM ident
2317
2319
          {
2318
2320
            store_position_for_column($2.str);
2319
 
            Lex->alter_info.flags|= ALTER_COLUMN_ORDER;
 
2321
            Lex->alter_info.flags.set(ALTER_COLUMN_ORDER);
2320
2322
          }
2321
2323
        | FIRST_SYM
2322
2324
          {
2323
2325
            store_position_for_column(first_keyword);
2324
 
            Lex->alter_info.flags|= ALTER_COLUMN_ORDER;
 
2326
            Lex->alter_info.flags.set(ALTER_COLUMN_ORDER);
2325
2327
          }
2326
2328
        ;
2327
2329
 
4372
4374
            LEX *lex=Lex;
4373
4375
            lex->sql_command= SQLCOM_DROP_INDEX;
4374
4376
            lex->alter_info.reset();
4375
 
            lex->alter_info.flags= ALTER_DROP_INDEX;
 
4377
            lex->alter_info.flags.set(ALTER_DROP_INDEX);
4376
4378
            lex->alter_info.build_method= $2;
4377
4379
            lex->alter_info.drop_list.push_back(new Alter_drop(Alter_drop::KEY,
4378
4380
                                                               $4.str));