1036
1036
opt_field_or_var_spec fields_or_vars opt_load_data_set_spec
1037
1037
init_key_options key_options key_opts key_opt key_using_alg
1038
parse_vcol_expr vcol_opt_attribute vcol_opt_attribute_list
1042
1040
%type <index_hint> index_hint_type
1612
1609
type opt_attribute {}
1613
| VIRTUAL_SYM type AS '(' virtual_column_func ')' vcol_opt_attribute
1615
$$=DRIZZLE_TYPE_VIRTUAL;
1616
Lex->vcol_info->set_field_type((enum enum_field_types) $2);
1622
| vcol_opt_attribute_list {}
1625
vcol_opt_attribute_list:
1626
vcol_opt_attribute_list vcol_attribute {}
1634
lex->type|= UNIQUE_FLAG;
1635
lex->alter_info.flags|= ALTER_ADD_INDEX;
1637
| UNIQUE_SYM KEY_SYM
1640
lex->type|= UNIQUE_KEY_FLAG;
1641
lex->alter_info.flags|= ALTER_ADD_INDEX;
1643
| COMMENT_SYM TEXT_STRING_sys { Lex->comment= $2; }
1646
Lex->vcol_info->set_field_stored(true);
1651
PARSE_VCOL_EXPR_SYM '(' virtual_column_func ')'
1654
"PARSE_VCOL_EXPR" can only be used by the SQL server
1655
when reading a '*.frm' file.
1656
Prevent the end user from invoking this command.
1658
if (not Lex->parse_vcol_expr)
1660
my_message(ER_SYNTAX_ERROR, ER(ER_SYNTAX_ERROR), MYF(0));
1666
virtual_column_func:
1667
remember_name expr remember_end
1669
Lex->vcol_info= new virtual_column_info();
1670
if (not Lex->vcol_info)
1672
my_error(ER_OUTOFMEMORY, MYF(0), sizeof(virtual_column_info));
1675
uint32_t expr_len= (uint)($3 - $1) - 1;
1676
Lex->vcol_info->expr_str.str= (char* ) sql_memdup($1 + 1, expr_len);
1677
Lex->vcol_info->expr_str.length= expr_len;
1678
Lex->vcol_info->expr_item= $2;