diff options
author | unknown <kostja@bodhi.local> | 2007-01-15 13:10:07 +0300 |
---|---|---|
committer | unknown <kostja@bodhi.local> | 2007-01-15 13:10:07 +0300 |
commit | 408d7752495684425a96c32feaedb4cd865a826a (patch) | |
tree | 267e52364d28d1d17e8c9dd45c15c9917ce3be95 /sql/sql_yacc.yy | |
parent | 31e01f0a74dd4988ab0628ff0d1b832a190340fe (diff) | |
parent | a8103a89b4ad39031abd1db242beca1b4332c895 (diff) | |
download | mariadb-git-408d7752495684425a96c32feaedb4cd865a826a.tar.gz |
Manual merge.
mysql-test/r/sp.result:
Auto merged
mysql-test/t/sp.test:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_insert.cc:
Auto merged
sql/sql_lex.cc:
Auto merged
sql/sql_lex.h:
Auto merged
sql/sql_list.h:
Auto merged
sql/sql_show.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
Diffstat (limited to 'sql/sql_yacc.yy')
-rw-r--r-- | sql/sql_yacc.yy | 47 |
1 files changed, 25 insertions, 22 deletions
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 1fa23beb2f7..92640ea58d6 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -1352,8 +1352,7 @@ create: TL_READ_NO_INSERT: TL_READ))) YYABORT; - lex->create_list.empty(); - lex->key_list.empty(); + lex->alter_info.reset(); lex->col_list.empty(); lex->change=NullS; bzero((char*) &lex->create_info,sizeof(lex->create_info)); @@ -1371,16 +1370,17 @@ create: if (!lex->current_select->add_table_to_list(lex->thd, $7, NULL, TL_OPTION_UPDATING)) YYABORT; - lex->create_list.empty(); - lex->key_list.empty(); + lex->alter_info.reset(); + lex->alter_info.flags= ALTER_ADD_INDEX; lex->col_list.empty(); lex->change=NullS; } '(' key_list ')' { LEX *lex=Lex; + Key *key= new Key($2, $4.str, $5, 0, lex->col_list); - lex->key_list.push_back(new Key($2,$4.str, $5, 0, lex->col_list)); + lex->alter_info.key_list.push_back(key); lex->col_list.empty(); } | CREATE DATABASE opt_if_not_exists ident @@ -2920,29 +2920,34 @@ key_def: key_type opt_ident key_alg '(' key_list ')' { LEX *lex=Lex; - lex->key_list.push_back(new Key($1,$2, $3, 0, lex->col_list)); + Key *key= new Key($1, $2, $3, 0, lex->col_list); + lex->alter_info.key_list.push_back(key); + lex->col_list.empty(); /* Alloced by sql_alloc */ } | opt_constraint constraint_key_type opt_ident key_alg '(' key_list ')' { LEX *lex=Lex; const char *key_name= $3 ? $3:$1; - lex->key_list.push_back(new Key($2, key_name, $4, 0, - lex->col_list)); + Key *key= new Key($2, key_name, $4, 0, lex->col_list); + lex->alter_info.key_list.push_back(key); lex->col_list.empty(); /* Alloced by sql_alloc */ } | opt_constraint FOREIGN KEY_SYM opt_ident '(' key_list ')' references { LEX *lex=Lex; - lex->key_list.push_back(new foreign_key($4 ? $4:$1, lex->col_list, - $8, - lex->ref_list, - lex->fk_delete_opt, - lex->fk_update_opt, - lex->fk_match_option)); - lex->key_list.push_back(new Key(Key::MULTIPLE, $4 ? $4 : $1, - HA_KEY_ALG_UNDEF, 1, - lex->col_list)); + const char *key_name= $4 ? $4 : $1; + Key *key= new foreign_key(key_name, lex->col_list, + $8, + lex->ref_list, + lex->fk_delete_opt, + lex->fk_update_opt, + lex->fk_match_option); + lex->alter_info.key_list.push_back(key); + key= new Key(Key::MULTIPLE, key_name, + HA_KEY_ALG_UNDEF, 1, + lex->col_list); + lex->alter_info.key_list.push_back(key); lex->col_list.empty(); /* Alloced by sql_alloc */ } | constraint opt_check_constraint @@ -3484,8 +3489,6 @@ alter: if (!lex->select_lex.add_table_to_list(thd, $4, NULL, TL_OPTION_UPDATING)) YYABORT; - lex->create_list.empty(); - lex->key_list.empty(); lex->col_list.empty(); lex->select_lex.init_order(); lex->select_lex.db= @@ -3495,8 +3498,7 @@ alter: lex->create_info.db_type= DB_TYPE_DEFAULT; lex->create_info.default_table_charset= NULL; lex->create_info.row_type= ROW_TYPE_NOT_USED; - lex->alter_info.reset(); - lex->alter_info.flags= 0; + lex->alter_info.reset(); } alter_list {} @@ -6254,7 +6256,8 @@ drop: { LEX *lex=Lex; lex->sql_command= SQLCOM_DROP_INDEX; - lex->alter_info.drop_list.empty(); + lex->alter_info.reset(); + lex->alter_info.flags= ALTER_DROP_INDEX; lex->alter_info.drop_list.push_back(new Alter_drop(Alter_drop::KEY, $3.str)); if (!lex->current_select->add_table_to_list(lex->thd, $5, NULL, |