diff --git a/mysql-test/main/mysql57nopart.result b/mysql-test/main/mysql57nopart.result new file mode 100644 index 00000000000..2b902f27947 --- /dev/null +++ b/mysql-test/main/mysql57nopart.result @@ -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 +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 diff --git a/mysql-test/main/mysql57nopart.test b/mysql-test/main/mysql57nopart.test new file mode 100644 index 00000000000..93df68cee5f --- /dev/null +++ b/mysql-test/main/mysql57nopart.test @@ -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 diff --git a/mysql-test/std_data/mysql57part.frm b/mysql-test/std_data/mysql57part.frm new file mode 100644 index 00000000000..9a2e5779973 Binary files /dev/null and b/mysql-test/std_data/mysql57part.frm differ diff --git a/sql/table.cc b/sql/table.cc index 394e43fcda0..68b3d9efc9a 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -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; } }