summaryrefslogtreecommitdiff
path: root/sql/sql_base.cc
diff options
context:
space:
mode:
authoringo@mysql.com <>2004-03-30 19:22:14 +0200
committeringo@mysql.com <>2004-03-30 19:22:14 +0200
commit85ec87a09445906dc1273c614434b1de5d2b5bea (patch)
tree1aadd9023a8717250c99b8a10791977beac9c8eb /sql/sql_base.cc
parent6a636a4d07a90c29ab7b47dca557124df6dee9fd (diff)
downloadmariadb-git-85ec87a09445906dc1273c614434b1de5d2b5bea.tar.gz
Worklog#1563 - Support of on-line CREATE/DROP INDEX.
This is to enable table handlers to implement online create/drop index. It consists of some parts: - New default handler methods in handler.h - Split of mysql_alter_table. It decides if only one kind of alteration is to be done (e.g. only create indexes or only drop indexes etc.) It then calls the specialized new handler method if the handler implements it. Otherwise it calls real_alter_table. - The parser sets flags for each alter operation detected in a command. These are used by mysql_alter_table for the decision. - mysql_prepare_table is pulled out of mysql_create_table. This is also used by mysql_create_index to prepare the key structure array for the handler. It is also used by mysql_create_index and mysql_drop_index to prepare a call to mysql_create_frm. - mysql_create_frm is pulled out of rea_create_table for use by mysql_create_index and mysql_drop_index after the index is created/dropped. Thanks to Antony who supplied most of the changes.
Diffstat (limited to 'sql/sql_base.cc')
-rw-r--r--sql/sql_base.cc39
1 files changed, 0 insertions, 39 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 1766063c5ec..ef9f568ed92 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -2497,45 +2497,6 @@ static void mysql_rm_tmp_tables(void)
}
-/*
- CREATE INDEX and DROP INDEX are implemented by calling ALTER TABLE with
- the proper arguments. This isn't very fast but it should work for most
- cases.
- One should normally create all indexes with CREATE TABLE or ALTER TABLE.
-*/
-
-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;
- HA_CREATE_INFO create_info;
- DBUG_ENTER("mysql_create_index");
- bzero((char*) &create_info,sizeof(create_info));
- create_info.db_type=DB_TYPE_DEFAULT;
- 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,
- DUP_ERROR));
-}
-
-
-int mysql_drop_index(THD *thd, TABLE_LIST *table_list, List<Alter_drop> &drop)
-{
- 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;
- DBUG_RETURN(mysql_alter_table(thd,table_list->db,table_list->real_name,
- &create_info, table_list,
- fields, keys, drop, alter, 0, (ORDER*)0,
- DUP_ERROR));
-}
/*****************************************************************************
unireg support functions