diff options
author | unknown <vva@eagle.mysql.r18.ru> | 2004-05-21 19:57:03 +0500 |
---|---|---|
committer | unknown <vva@eagle.mysql.r18.ru> | 2004-05-21 19:57:03 +0500 |
commit | ea63df7f54cbaf8553890eaa87d35045a733780c (patch) | |
tree | e17af21dff1c62a563a59b94a4e07d102eb006c3 /sql/sql_parse.cc | |
parent | ccdbfd1492693aeb94fc8771f410fb4718da56f3 (diff) | |
download | mariadb-git-ea63df7f54cbaf8553890eaa87d35045a733780c.tar.gz |
Introduced parameter object "ALTER_INFO" for mysql_alter_table
to make list of parameters in mysql_alter_table shorted
to avoid warning in MSVC (windows) building
sql/mysql_priv.h:
Introduced parameter object "ALTER_INFO" for mysql_alter_table
- changed declaration of mysql_alter_table
- changed declaration of mysql_drop_index
(replaced List<Alter_drop> by ALTER_INFO)
sql/sql_lex.h:
Introduced parameter object "ALTER_INFO" for mysql_alter_table
- declared struct ALTER_INFO
- added ALTER_INFO alter_info; into LEX
- removed fields which were added into ALTER_INFO from LEX
sql/sql_parse.cc:
Introduced parameter object "ALTER_INFO" for mysql_alter_table
- changed invotaions of mysql_alter_table
- replaced cleaning fields in SQLCOM_OPTIMIZE by ALTER_INFO::reset
- changed invocation of mysql_drop_index (replaced lex->drop_list by &lex->alter_info)
- changed definition of mysql_create_index and mysql_drop_index to use ALTER_INFO
sql/sql_table.cc:
Introduced parameter object "ALTER_INFO" for mysql_alter_table
- changed definition of mysql_alter_table
sql/sql_yacc.yy:
Introduced parameter object "ALTER_INFO" for mysql_alter_table
- replaced using of removed from LEX fields my fields of LEX::alter_info
Diffstat (limited to 'sql/sql_parse.cc')
-rw-r--r-- | sql/sql_parse.cc | 37 |
1 files changed, 17 insertions, 20 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 373f3c82ff3..8ddac68bcdb 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -2368,14 +2368,10 @@ unsent_create_error: res= mysql_alter_table(thd, select_lex->db, lex->name, &lex->create_info, tables, lex->create_list, - lex->key_list, lex->drop_list, lex->alter_list, + lex->key_list, select_lex->order_list.elements, (ORDER *) select_lex->order_list.first, - lex->alter_flags, - lex->duplicates, - lex->alter_keys_onoff, - lex->tablespace_op, - lex->simple_alter); + lex->duplicates, &lex->alter_info); } break; } @@ -2514,17 +2510,15 @@ unsent_create_error: lex->create_list.empty(); lex->key_list.empty(); lex->col_list.empty(); - lex->drop_list.empty(); - lex->alter_list.empty(); + lex->alter_info.reset(); bzero((char*) &create_info,sizeof(create_info)); create_info.db_type=DB_TYPE_DEFAULT; create_info.row_type=ROW_TYPE_DEFAULT; create_info.default_table_charset=default_charset_info; res= mysql_alter_table(thd, NullS, NullS, &create_info, tables, lex->create_list, - lex->key_list, lex->drop_list, lex->alter_list, - 0, (ORDER *) 0, 0, - DUP_ERROR); + lex->key_list, 0, (ORDER *) 0, + DUP_ERROR, &lex->alter_info); } else res = mysql_optimize_table(thd, tables, &lex->check_opt); @@ -2754,7 +2748,7 @@ unsent_create_error: if (end_active_trans(thd)) res= -1; else - res = mysql_drop_index(thd, tables, lex->drop_list); + res = mysql_drop_index(thd, tables, &lex->alter_info); break; case SQLCOM_SHOW_DATABASES: #if defined(DONT_ALLOW_SHOW_COMMANDS) @@ -4903,8 +4897,9 @@ Item * all_any_subquery_creator(Item *left_expr, int mysql_create_index(THD *thd, TABLE_LIST *table_list, List<Key> &keys) { List<create_field> fields; - List<Alter_drop> drop; - List<Alter_column> alter; + ALTER_INFO alter_info; + alter_info.flags= ALTER_ADD_INDEX; + alter_info.is_simple= 0; HA_CREATE_INFO create_info; DBUG_ENTER("mysql_create_index"); bzero((char*) &create_info,sizeof(create_info)); @@ -4912,25 +4907,27 @@ int mysql_create_index(THD *thd, TABLE_LIST *table_list, List<Key> &keys) create_info.default_table_charset= thd->variables.collation_database; DBUG_RETURN(mysql_alter_table(thd,table_list->db,table_list->real_name, &create_info, table_list, - fields, keys, drop, alter, 0, (ORDER*)0, - ALTER_ADD_INDEX, DUP_ERROR)); + fields, keys, 0, (ORDER*)0, + DUP_ERROR, &alter_info)); } -int mysql_drop_index(THD *thd, TABLE_LIST *table_list, List<Alter_drop> &drop) +int mysql_drop_index(THD *thd, TABLE_LIST *table_list, ALTER_INFO *alter_info) { List<create_field> fields; List<Key> keys; - List<Alter_column> alter; HA_CREATE_INFO create_info; DBUG_ENTER("mysql_drop_index"); bzero((char*) &create_info,sizeof(create_info)); create_info.db_type=DB_TYPE_DEFAULT; create_info.default_table_charset= thd->variables.collation_database; + alter_info->clear(); + alter_info->flags= ALTER_DROP_INDEX; + alter_info->is_simple= 0; DBUG_RETURN(mysql_alter_table(thd,table_list->db,table_list->real_name, &create_info, table_list, - fields, keys, drop, alter, 0, (ORDER*)0, - ALTER_DROP_INDEX, DUP_ERROR)); + fields, keys, 0, (ORDER*)0, + DUP_ERROR, alter_info)); } |