MDEV-35079 Migrate MySQL5.7 to MariaDB 10.4, then to MariaDB 10.11 Failed

correctly detect when partitioning is disabled
This commit is contained in:
Sergei Golubchik 2024-10-04 18:40:34 +02:00
parent 7842cab8c0
commit 3b58c6b93f
4 changed files with 30 additions and 7 deletions

View file

@ -0,0 +1,13 @@
#
# MDEV-35079 Migrate MySQL5.7 to MariaDB 10.4, then to MariaDB 10.11 Failed
#
select table_name, concat('<',table_comment,'>') from information_schema.tables
where table_schema='test';
table_name concat('<',table_comment,'>')
mysql57part <The MariaDB server is running with the --skip-partition option so it cannot execute this statement>
Warnings:
Warning 1290 The MariaDB server is running with the --skip-partition option so it cannot execute this statement
drop table mysql57part;
Warnings:
Warning 1932 Table 'test.mysql57part' doesn't exist in engine
# End of 10.11 tests

View file

@ -0,0 +1,11 @@
source include/have_innodb.inc;
--echo #
--echo # MDEV-35079 Migrate MySQL5.7 to MariaDB 10.4, then to MariaDB 10.11 Failed
--echo #
let $datadir=`select @@datadir`;
copy_file std_data/mysql57part.frm $datadir/test/mysql57part.frm;
select table_name, concat('<',table_comment,'>') from information_schema.tables
where table_schema='test';
drop table mysql57part;
--echo # End of 10.11 tests

Binary file not shown.

View file

@ -1728,9 +1728,9 @@ public:
*/
#ifdef WITH_PARTITION_STORAGE_ENGINE
static bool change_to_partiton_engine(LEX_CSTRING *name,
plugin_ref *se_plugin)
static bool change_to_partiton_engine(plugin_ref *se_plugin)
{
LEX_CSTRING name= { STRING_WITH_LEN("partition") };
/*
Use partition handler
tmp_plugin is locked with a local lock.
@ -1738,10 +1738,9 @@ static bool change_to_partiton_engine(LEX_CSTRING *name,
replacing it with a globally locked version of tmp_plugin
*/
/* Check if the partitioning engine is ready */
if (!plugin_is_ready(name, MYSQL_STORAGE_ENGINE_PLUGIN))
if (!plugin_is_ready(&name, MYSQL_STORAGE_ENGINE_PLUGIN))
{
my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0),
"--skip-partition");
my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0), "--skip-partition");
return 1;
}
plugin_unlock(NULL, *se_plugin);
@ -2039,7 +2038,7 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write,
else if (str_db_type_length == 9 &&
!strncmp((char *) next_chunk + 2, "partition", 9))
{
if (change_to_partiton_engine(&se_name, &se_plugin))
if (change_to_partiton_engine(&se_plugin))
goto err;
}
#endif
@ -2078,7 +2077,7 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write,
share->mysql_version >= 50600 && share->mysql_version <= 50799)
{
share->keep_original_mysql_version= 1;
if (change_to_partiton_engine(&se_name, &se_plugin))
if (change_to_partiton_engine(&se_plugin))
goto err;
}
}