← Back to team overview

maria-developers team mailing list archive

Re: [Commits] 6ed7307: MDEV-8576: Bootstrap should ignore --enforce-storage-engine option

 

Hi, Jan!

On Sep 16, Jan Lindström wrote:
> revision-id: 6ed73070e120e1be5456288556019db5bd3f9f60
> parent(s): 6cc1befcf26b2dc43e5cd7ad85d29c576073b1c5
> committer: Jan Lindström
> branch nick: 10.1-tests
> timestamp: 2015-09-16 11:47:34 +0300
> message:
> 
> MDEV-8576: Bootstrap should ignore --enforce-storage-engine option
> 
> Allow enforce-storage-engine="" option and use that on mysql_install_db
> when doing bootstrap.

Agree.

After I commented on the previous patch it occurred to me that
--disable-enforce-storage-engine is a bad idea, because
--enable-enforce-storage-engine makes no sense, and one normally expects
--enable-xxx for every --disable-xxx. So --enforce-storage-engine=""
is a better way of switching this feature off.

> diff --git a/sql/mysqld.cc b/sql/mysqld.cc
> index b45d4e1..ee3b870 100644
> --- a/sql/mysqld.cc
> +++ b/sql/mysqld.cc
> @@ -4843,7 +4843,10 @@ static void add_file_to_crash_report(char *file)
>  static int init_default_storage_engine_impl(const char *opt_name,
>                                              char *engine_name, plugin_ref *res)
>  {
> -  if (!engine_name)
> +  /* Storage engine can be NULL and enforced storage engine
> +  can be empty. */
> +  if (!engine_name ||
> +      (strcmp(opt_name, "enforced_storage_engine") == 0 && strlen(engine_name) == 0))
>    {
>      *res= 0;
>      return 0;

In fact, default_tmp_storage_engine can be NULL too. See in mysqld.cc:

  if (default_tmp_storage_engine && !*default_tmp_storage_engine)
      default_tmp_storage_engine= NULL;

  if (init_default_storage_engine(default_tmp_storage_engine, tmp_table_plugin))
    unireg_abort(1);

And it looks like it's important to have default_tmp_storage_engine=NULL,
not leave it as an empty string. Because Sys_var_plugin::do_check()
doesn't allow empty strings as plugins names, but translates NULL to "no
plugin". So, you either need to set enforced_storage_engine=NULL if it
was an empty string, or you need to fix Sys_var_plugin::do_check() to
treat empty strings as "no plugin" too.

Regards,
Sergei