mirror of
https://github.com/MariaDB/server.git
synced 2025-01-15 19:42:28 +01:00
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:
parent
7842cab8c0
commit
3b58c6b93f
4 changed files with 30 additions and 7 deletions
13
mysql-test/main/mysql57nopart.result
Normal file
13
mysql-test/main/mysql57nopart.result
Normal 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
|
11
mysql-test/main/mysql57nopart.test
Normal file
11
mysql-test/main/mysql57nopart.test
Normal 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
|
BIN
mysql-test/std_data/mysql57part.frm
Normal file
BIN
mysql-test/std_data/mysql57part.frm
Normal file
Binary file not shown.
13
sql/table.cc
13
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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue