1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +03:00

Merge 11.4 into 11.8

This commit is contained in:
Marko Mäkelä
2025-03-05 20:39:47 +02:00
177 changed files with 5360 additions and 2623 deletions

View File

@@ -1618,12 +1618,19 @@ int mysql_rm_table_no_locks(THD *thd, TABLE_LIST *tables,
else
{
#ifdef WITH_WSREP
if (WSREP(thd) && hton && !wsrep_should_replicate_ddl(thd, hton))
if (WSREP(thd) && hton)
{
error= 1;
goto err;
handlerton *ht= hton;
// For partitioned tables resolve underlying handlerton
if (table->table && table->table->file->partition_ht())
ht= table->table->file->partition_ht();
if (!wsrep_should_replicate_ddl(thd, ht))
{
error= 1;
goto err;
}
}
#endif
#endif /* WITH_WSREP */
error= -1;
if (thd->locked_tables_mode == LTM_LOCK_TABLES ||
@@ -1899,18 +1906,6 @@ err:
if (non_temp_tables_count)
query_cache_invalidate3(thd, tables, 0);
/*
We are always logging drop of temporary tables.
The reason is to handle the following case:
- Use statement based replication
- CREATE TEMPORARY TABLE foo (logged)
- set row based replication
- DROP TEMPORARY TABLE foo (needs to be logged)
This should be fixed so that we remember if creation of the
temporary table was logged and only log it if the creation was
logged.
*/
if (non_trans_tmp_table_deleted ||
trans_tmp_table_deleted || non_tmp_table_deleted)
{
@@ -5071,9 +5066,26 @@ bool wsrep_check_sequence(THD* thd,
// In Galera cluster we support only InnoDB sequences
if (db_type != DB_TYPE_INNODB)
{
my_error(ER_NOT_SUPPORTED_YET, MYF(0),
"non-InnoDB sequences in Galera cluster");
return(true);
// Currently any dynamic storage engine is not possible to identify
// using DB_TYPE_XXXX and ENGINE=SEQUENCE is one of them.
// Therefore, we get storage engine name from lex.
const LEX_CSTRING *tb_name= thd->lex->m_sql_cmd->option_storage_engine_name()->name();
// (1) CREATE TABLE ... ENGINE=SEQUENCE OR
// (2) ALTER TABLE ... ENGINE= OR
// Note in ALTER TABLE table->s->sequence != nullptr
// (3) CREATE SEQUENCE ... ENGINE=
if ((thd->lex->sql_command == SQLCOM_CREATE_TABLE &&
lex_string_eq(tb_name, STRING_WITH_LEN("SEQUENCE"))) ||
(thd->lex->sql_command == SQLCOM_ALTER_TABLE) ||
(thd->lex->sql_command == SQLCOM_CREATE_SEQUENCE))
{
my_error(ER_NOT_SUPPORTED_YET, MYF(0),
"non-InnoDB sequences in Galera cluster");
push_warning_printf(thd, Sql_condition::WARN_LEVEL_NOTE,
ER_NOT_SUPPORTED_YET,
"ENGINE=%s not supported by Galera", tb_name->str);
return(true);
}
}
// In Galera cluster it is best to use INCREMENT BY 0 with CACHE
@@ -10806,10 +10818,21 @@ bool mysql_alter_table(THD *thd, const LEX_CSTRING *new_db,
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->s->db_type()))
DBUG_RETURN(true);
#endif /* WITH_WSREP */
thd->lex->sql_command == SQLCOM_DROP_INDEX))
{
handlerton *ht= table->s->db_type();
// If alter used ENGINE= we use that
if (create_info->used_fields & HA_CREATE_USED_ENGINE)
ht= create_info->db_type;
// For partitioned tables resolve underlying handlerton
else if (table->file->partition_ht())
ht= table->file->partition_ht();
if (!wsrep_should_replicate_ddl(thd, ht))
DBUG_RETURN(true);
}
#endif
DEBUG_SYNC(thd, "alter_table_after_open_tables");