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);
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);
1550
1550
| constraint opt_check_constraint
1732
1732
| COLUMN_FORMAT_SYM column_format_types
1734
1734
Lex->column_format= $2;
1735
Lex->alter_info.flags|= ALTER_COLUMN_FORMAT;
1735
Lex->alter_info.flags.set(ALTER_COLUMN_FORMAT);
1737
1737
| not NULL_SYM { Lex->type|= NOT_NULL_FLAG; }
1738
1738
| DEFAULT now_or_signed_literal
1740
1740
Lex->default_value=$2;
1741
Lex->alter_info.flags|= ALTER_COLUMN_DEFAULT;
1741
Lex->alter_info.flags.set(ALTER_COLUMN_DEFAULT);
1743
1743
| ON UPDATE_SYM NOW_SYM optional_braces
1744
1744
{ Lex->on_update_value= new Item_func_now_local(); }
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);
1752
1752
| opt_primary KEY_SYM
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);
1761
1761
lex->type|= UNIQUE_FLAG;
1762
lex->alter_info.flags|= ALTER_ADD_INDEX;
1762
lex->alter_info.flags.set(ALTER_ADD_INDEX);
1764
1764
| UNIQUE_SYM KEY_SYM
1767
1767
lex->type|= UNIQUE_KEY_FLAG;
1768
lex->alter_info.flags|= ALTER_ADD_INDEX;
1768
lex->alter_info.flags.set(ALTER_ADD_INDEX);
1770
1770
| COMMENT_SYM TEXT_STRING_sys { Lex->comment= $2; }
1771
1771
| COLLATE_SYM collation_name
2172
2172
add_column column_def opt_place { }
2175
Lex->alter_info.flags|= ALTER_ADD_INDEX;
2175
Lex->alter_info.flags.set(ALTER_ADD_INDEX);
2177
2177
| add_column '(' field_list ')'
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);
2181
2182
| CHANGE opt_column field_ident
2184
2185
lex->change= $3.str;
2185
lex->alter_info.flags|= ALTER_CHANGE_COLUMN;
2186
lex->alter_info.flags.set(ALTER_CHANGE_COLUMN);
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;
2214
2215
lex->alter_info.drop_list.push_back(new Alter_drop(Alter_drop::COLUMN,
2216
lex->alter_info.flags|= ALTER_DROP_COLUMN;
2217
lex->alter_info.flags.set(ALTER_DROP_COLUMN);
2218
2219
| DROP FOREIGN KEY_SYM opt_ident
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);
2222
2224
| DROP PRIMARY_SYM KEY_SYM
2225
2227
lex->alter_info.drop_list.push_back(new Alter_drop(Alter_drop::KEY,
2227
lex->alter_info.flags|= ALTER_DROP_INDEX;
2229
lex->alter_info.flags.set(ALTER_DROP_INDEX);
2229
2231
| DROP key_or_index field_ident
2232
2234
lex->alter_info.drop_list.push_back(new Alter_drop(Alter_drop::KEY,
2234
lex->alter_info.flags|= ALTER_DROP_INDEX;
2236
lex->alter_info.flags.set(ALTER_DROP_INDEX);
2236
2238
| DISABLE_SYM KEYS
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);
2242
2244
| ENABLE_SYM KEYS
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);
2248
2250
| ALTER opt_column field_ident SET DEFAULT signed_literal
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);
2254
2256
| ALTER opt_column field_ident DROP DEFAULT
2257
2259
lex->alter_info.alter_list.push_back(new Alter_column($3.str,
2259
lex->alter_info.flags|= ALTER_COLUMN_DEFAULT;
2261
lex->alter_info.flags.set(ALTER_COLUMN_DEFAULT);
2261
2263
| RENAME opt_to table_ident
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);
2288
2290
| create_table_options_space_separated
2291
lex->alter_info.flags|= ALTER_OPTIONS;
2293
lex->alter_info.flags.set(ALTER_OPTIONS);
2295
Lex->alter_info.flags|= ALTER_FORCE;
2297
Lex->alter_info.flags.set(ALTER_FORCE);
2297
2299
| alter_order_clause
2300
lex->alter_info.flags|= ALTER_ORDER;
2302
lex->alter_info.flags.set(ALTER_ORDER);
2316
2318
| AFTER_SYM ident
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);
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);
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,