diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2021-08-16 17:55:40 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2021-08-16 17:55:40 +0300 |
commit | dc58303cf8a7d0884d44cac54772b0aa506b6e6a (patch) | |
tree | 1fcfa92c6032451a0608daa86bb74e0bad26c203 | |
parent | 46c3e7e3537c31a94289033bfeccf3faf8d4069e (diff) | |
download | mariadb-git-dc58303cf8a7d0884d44cac54772b0aa506b6e6a.tar.gz |
MDEV-26372 enforce-storage-engine=InnoDB has no usability as an option to mysqld-install-db
Creation of tables by the three names mysql.user, mysql.host, mysql.db
was being blocked in the function row_mysql_is_system_table().
Since commit 4abb8216a054e14afbeb81e8529e02bab6fa14ac (MDEV-17658),
mysql.user is a view, not a table. Since commit
ead9a34a3e934f607c2ea7a6c68f7f6d9d29b5bd (MDEV-15851), mysql.host
is not being created at all.
Let us remove the special handling of table names in InnoDB,
and allow mysql.db to be created in InnoDB. The special handling
was originally added in commit e84ef2b747e31235036429760bfda488b82db0bb
without any explanation.
Reviewed by: Sergei Golubchik
-rw-r--r-- | storage/innobase/row/row0mysql.cc | 46 |
1 files changed, 3 insertions, 43 deletions
diff --git a/storage/innobase/row/row0mysql.cc b/storage/innobase/row/row0mysql.cc index a6c75f7f450..0453b61b32c 100644 --- a/storage/innobase/row/row0mysql.cc +++ b/storage/innobase/row/row0mysql.cc @@ -100,25 +100,6 @@ static ib_mutex_t row_drop_list_mutex; /** Flag: has row_mysql_drop_list been initialized? */ static bool row_mysql_drop_list_inited; -/*******************************************************************//** -Determine if the given name is a name reserved for MySQL system tables. -@return TRUE if name is a MySQL system table name */ -static -ibool -row_mysql_is_system_table( -/*======================*/ - const char* name) -{ - if (strncmp(name, "mysql/", 6) != 0) { - - return(FALSE); - } - - return(0 == strcmp(name + 6, "host") - || 0 == strcmp(name + 6, "user") - || 0 == strcmp(name + 6, "db")); -} - #ifdef UNIV_DEBUG /** Wait for the background drop list to become empty. */ void @@ -2374,25 +2355,12 @@ row_create_table_for_mysql( DBUG_EXECUTE_IF( "ib_create_table_fail_at_start_of_row_create_table_for_mysql", - goto err_exit; - ); - - trx->op_info = "creating table"; - - if (row_mysql_is_system_table(table->name.m_name)) { - - ib::error() << "Trying to create a MySQL system table " - << table->name << " of type InnoDB. MySQL system" - " tables must be of the MyISAM type!"; -#ifndef DBUG_OFF -err_exit: -#endif /* !DBUG_OFF */ dict_mem_table_free(table); - trx->op_info = ""; + return DB_ERROR; + ); - return(DB_ERROR); - } + trx->op_info = "creating table"; trx_start_if_not_started_xa(trx, true); @@ -4196,14 +4164,6 @@ row_rename_table_for_mysql( if (high_level_read_only) { return(DB_READ_ONLY); - - } else if (row_mysql_is_system_table(new_name)) { - - ib::error() << "Trying to create a MySQL system table " - << new_name << " of type InnoDB. MySQL system tables" - " must be of the MyISAM type!"; - - goto funct_exit; } trx->op_info = "renaming table"; |