1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Merge branch '10.11' into 11.0

This commit is contained in:
Sergei Golubchik
2024-05-11 13:23:27 +02:00
820 changed files with 18746 additions and 6295 deletions

View File

@ -1468,6 +1468,7 @@ int mysql_rm_table_no_locks(THD *thd, TABLE_LIST *tables,
temporary_table_was_dropped= 1;
}
is_temporary= 1;
thd->reset_sp_cache= true;
}
if ((drop_temporary && if_exists) || temporary_table_was_dropped)
@ -1841,8 +1842,11 @@ report_error:
}
DBUG_PRINT("table", ("table: %p s: %p", table->table,
table->table ? table->table->s : NULL));
if (is_temporary_table(table))
thd->reset_sp_cache= true;
}
DEBUG_SYNC(thd, "rm_table_no_locks_before_binlog");
thd->used|= THD::THREAD_SPECIFIC_USED;
error= 0;
@ -4679,6 +4683,7 @@ int create_table_impl(THD *thd,
if (is_trans != NULL)
*is_trans= table->file->has_transactions();
thd->reset_sp_cache= true;
thd->used|= THD::THREAD_SPECIFIC_USED;
create_info->table= table; // Store pointer to table
}
@ -5167,7 +5172,8 @@ static bool make_unique_constraint_name(THD *thd, LEX_CSTRING *name,
if (!check) // Found unique name
{
name->length= (size_t) (real_end - buff);
name->str= strmake_root(thd->stmt_arena->mem_root, buff, name->length);
name->str= thd->strmake(buff, name->length);
return (name->str == NULL);
}
}
@ -7402,14 +7408,28 @@ bool alter_table_manage_keys(TABLE *table, int indexes_were_disabled,
switch (keys_onoff) {
case Alter_info::ENABLE:
DEBUG_SYNC(table->in_use, "alter_table_enable_indexes");
error= table->file->ha_enable_indexes(HA_KEY_SWITCH_NONUNIQ_SAVE);
error= table->file->ha_enable_indexes(key_map(table->s->keys), true);
break;
case Alter_info::LEAVE_AS_IS:
if (!indexes_were_disabled)
break;
/* fall through */
case Alter_info::DISABLE:
error= table->file->ha_disable_indexes(HA_KEY_SWITCH_NONUNIQ_SAVE);
{
key_map map= table->s->keys_in_use;
bool do_clear= false;
for (uint i=0; i < table->s->keys; i++)
{
if (!(table->s->key_info[i].flags & HA_NOSAME) &&
i != table->s->next_number_index)
{
map.clear_bit(i);
do_clear= true;
}
}
if (do_clear)
error= table->file->ha_disable_indexes(map, true);
}
}
if (unlikely(error))
@ -10253,14 +10273,14 @@ bool mysql_alter_table(THD *thd, const LEX_CSTRING *new_db,
if we can support implementing storage engine.
*/
if (WSREP(thd) && table && table->s->sequence &&
wsrep_check_sequence(thd, thd->lex->create_info.seq_create_info, used_engine))
wsrep_check_sequence(thd, create_info->seq_create_info, used_engine))
DBUG_RETURN(TRUE);
if (WSREP(thd) &&
if (WSREP(thd) && table &&
(thd->lex->sql_command == SQLCOM_ALTER_TABLE ||
thd->lex->sql_command == SQLCOM_CREATE_INDEX ||
thd->lex->sql_command == SQLCOM_DROP_INDEX) &&
!wsrep_should_replicate_ddl(thd, table_list->table->s->db_type()))
!wsrep_should_replicate_ddl(thd, table->s->db_type()))
DBUG_RETURN(true);
#endif /* WITH_WSREP */
@ -12732,12 +12752,10 @@ bool Sql_cmd_create_table_like::execute(THD *thd)
wsrep_check_sequence(thd, lex->create_info.seq_create_info, used_engine))
DBUG_RETURN(true);
WSREP_TO_ISOLATION_BEGIN_ALTER(create_table->db.str,
create_table->table_name.str,
first_table, &alter_info, NULL,
&create_info)
{
WSREP_WARN("CREATE TABLE isolation failure");
WSREP_TO_ISOLATION_BEGIN_ALTER(create_table->db.str, create_table->table_name.str,
first_table, &alter_info, NULL, &create_info)
{
WSREP_WARN("CREATE TABLE isolation failure");
res= true;
goto end_with_restore_list;
}