mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
merged
sql/handler.h: Auto merged sql/sql_base.cc: Auto merged
This commit is contained in:
@@ -2612,28 +2612,28 @@ int real_alter_table(THD *thd,char *new_db, char *new_name,
|
||||
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->activate_all_index(thd);
|
||||
/* COND_refresh will be signaled in close_thread_tables() */
|
||||
break;
|
||||
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();
|
||||
/* COND_refresh will be signaled in close_thread_tables() */
|
||||
break;
|
||||
case DISABLE:
|
||||
if (table->db_type == DB_TYPE_MYISAM)
|
||||
{
|
||||
VOID(pthread_mutex_lock(&LOCK_open));
|
||||
wait_while_table_is_used(thd, table, HA_EXTRA_FORCE_REOPEN);
|
||||
VOID(pthread_mutex_unlock(&LOCK_open));
|
||||
table->file->deactivate_non_unique_index(HA_POS_ERROR);
|
||||
/* COND_refresh will be signaled in close_thread_tables() */
|
||||
}
|
||||
else
|
||||
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
|
||||
ER_ILLEGAL_HA,
|
||||
ER(ER_ILLEGAL_HA), table->table_name);
|
||||
break;
|
||||
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(0, 1);
|
||||
/* COND_refresh will be signaled in close_thread_tables() */
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (error==HA_ERR_WRONG_COMMAND)
|
||||
{
|
||||
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
|
||||
ER_ILLEGAL_HA, ER(ER_ILLEGAL_HA),
|
||||
table->table_name);
|
||||
error=0;
|
||||
}
|
||||
if (!error)
|
||||
{
|
||||
mysql_update_log.write(thd, thd->query, thd->query_length);
|
||||
@@ -2645,6 +2645,11 @@ int real_alter_table(THD *thd,char *new_db, char *new_name,
|
||||
}
|
||||
send_ok(thd);
|
||||
}
|
||||
else
|
||||
{
|
||||
table->file->print_error(error, MYF(0));
|
||||
error=-1;
|
||||
}
|
||||
table_list->table=0; // For query cache
|
||||
query_cache_invalidate3(thd, table_list, 0);
|
||||
DBUG_RETURN(error);
|
||||
@@ -3236,9 +3241,8 @@ copy_data_between_tables(TABLE *from,TABLE *to,
|
||||
DBUG_RETURN(-1); /* purecov: inspected */
|
||||
|
||||
to->file->external_lock(thd,F_WRLCK);
|
||||
to->file->extra(HA_EXTRA_WRITE_CACHE);
|
||||
from->file->info(HA_STATUS_VARIABLE);
|
||||
to->file->deactivate_non_unique_index(from->file->records);
|
||||
to->file->start_bulk_insert(from->file->records);
|
||||
|
||||
List_iterator<create_field> it(create);
|
||||
create_field *def;
|
||||
@@ -3321,17 +3325,15 @@ copy_data_between_tables(TABLE *from,TABLE *to,
|
||||
end_read_record(&info);
|
||||
free_io_cache(from);
|
||||
delete [] copy; // This is never 0
|
||||
uint tmp_error;
|
||||
if ((tmp_error=to->file->extra(HA_EXTRA_NO_CACHE)))
|
||||
|
||||
if (to->file->end_bulk_insert() && !error)
|
||||
{
|
||||
to->file->print_error(tmp_error,MYF(0));
|
||||
to->file->print_error(my_errno,MYF(0));
|
||||
error=1;
|
||||
}
|
||||
to->file->extra(HA_EXTRA_NO_IGNORE_DUP_KEY);
|
||||
if (to->file->activate_all_index(thd))
|
||||
error=1;
|
||||
|
||||
tmp_error = ha_recovery_logging(thd,TRUE);
|
||||
ha_recovery_logging(thd,TRUE);
|
||||
/*
|
||||
Ensure that the new table is saved properly to disk so that we
|
||||
can do a rename
|
||||
@@ -3421,7 +3423,7 @@ int mysql_checksum_table(THD *thd, TABLE_LIST *tables, HA_CHECK_OPT *check_opt)
|
||||
if (f->type() == FIELD_TYPE_BLOB)
|
||||
{
|
||||
String tmp;
|
||||
f->val_str(&tmp,&tmp);
|
||||
f->val_str(&tmp);
|
||||
row_crc= my_checksum(row_crc, (byte*) tmp.ptr(), tmp.length());
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user