mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Merge siva.hindu.god:/usr/home/tim/m/bk/g51
into siva.hindu.god:/usr/home/tim/m/bk/51
This commit is contained in:
@ -5234,6 +5234,7 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
|
||||
|
||||
/* DISCARD/IMPORT TABLESPACE is always alone in an ALTER TABLE */
|
||||
if (alter_info->tablespace_op != NO_TABLESPACE_OP)
|
||||
/* Conditionally writes to binlog. */
|
||||
DBUG_RETURN(mysql_discard_or_import_tablespace(thd,table_list,
|
||||
alter_info->tablespace_op));
|
||||
strxnmov(new_name_buff, sizeof (new_name_buff) - 1, mysql_data_home, "/", db,
|
||||
@ -5389,10 +5390,10 @@ view_err:
|
||||
!table->s->tmp_table) // no need to touch frm
|
||||
{
|
||||
error=0;
|
||||
VOID(pthread_mutex_lock(&LOCK_open));
|
||||
if (new_name != table_name || new_db != db)
|
||||
{
|
||||
thd->proc_info="rename";
|
||||
VOID(pthread_mutex_lock(&LOCK_open));
|
||||
/* Then do a 'simple' rename of the table */
|
||||
error=0;
|
||||
if (!access(new_name_buff,F_OK))
|
||||
@ -5415,7 +5416,6 @@ view_err:
|
||||
error= -1;
|
||||
}
|
||||
}
|
||||
VOID(pthread_mutex_unlock(&LOCK_open));
|
||||
}
|
||||
|
||||
if (!error)
|
||||
@ -5424,16 +5424,12 @@ view_err:
|
||||
case LEAVE_AS_IS:
|
||||
break;
|
||||
case ENABLE:
|
||||
VOID(pthread_mutex_lock(&LOCK_open));
|
||||
wait_while_table_is_used(thd, table, HA_EXTRA_FORCE_REOPEN);
|
||||
VOID(pthread_mutex_unlock(&LOCK_open));
|
||||
error= table->file->enable_indexes(HA_KEY_SWITCH_NONUNIQ_SAVE);
|
||||
/* COND_refresh will be signaled in close_thread_tables() */
|
||||
break;
|
||||
case DISABLE:
|
||||
VOID(pthread_mutex_lock(&LOCK_open));
|
||||
wait_while_table_is_used(thd, table, HA_EXTRA_FORCE_REOPEN);
|
||||
VOID(pthread_mutex_unlock(&LOCK_open));
|
||||
error=table->file->disable_indexes(HA_KEY_SWITCH_NONUNIQ_SAVE);
|
||||
/* COND_refresh will be signaled in close_thread_tables() */
|
||||
break;
|
||||
@ -5458,6 +5454,7 @@ view_err:
|
||||
table->file->print_error(error, MYF(0));
|
||||
error= -1;
|
||||
}
|
||||
VOID(pthread_mutex_unlock(&LOCK_open));
|
||||
table_list->table=0; // For query cache
|
||||
query_cache_invalidate3(thd, table_list, 0);
|
||||
DBUG_RETURN(error);
|
||||
@ -6458,7 +6455,7 @@ end_temporary:
|
||||
thd->some_tables_deleted=0;
|
||||
DBUG_RETURN(FALSE);
|
||||
|
||||
err1:
|
||||
err1:
|
||||
if (new_table)
|
||||
{
|
||||
/* close_temporary_table() frees the new_table pointer. */
|
||||
@ -6467,7 +6464,7 @@ end_temporary:
|
||||
else
|
||||
VOID(quick_rm_table(new_db_type, new_db, tmp_name, FN_IS_TMP));
|
||||
|
||||
err:
|
||||
err:
|
||||
DBUG_RETURN(TRUE);
|
||||
}
|
||||
/* mysql_alter_table */
|
||||
|
Reference in New Issue
Block a user