← Back to team overview

maria-developers team mailing list archive

Re: [Commits] 99ca8b9: MDEV-8219: enforce_storage_engine cannot be set globally

 

Hi, Jan!

On Jun 23, Jan Lindström wrote:
> revision-id: 99ca8b9ea8ee1b756fbf1edc567f6d06c9cf63fd
> parent(s): d3b7eb7b99ef7dae79c20b5beb63acdfdf6d8046
> committer: Jan Lindström
> branch nick: 10.1-bugs
> timestamp: 2015-06-23 13:14:46 +0300
> message:
> 
> MDEV-8219: enforce_storage_engine cannot be set globally
> 
> Change session only variable enforce_storage_engine to be
> session variable and make sure that also global value
> is used if session variable is not set.
> 
> diff --git a/mysql-test/suite/sys_vars/r/sysvars_innodb.result b/mysql-test/suite/sys_vars/r/sysvars_innodb.result
> index 927cd05..1c59391 100644
> --- a/mysql-test/suite/sys_vars/r/sysvars_innodb.result
> +++ b/mysql-test/suite/sys_vars/r/sysvars_innodb.result
> @@ -355,6 +355,20 @@ NUMERIC_BLOCK_SIZE	1048576
>  ENUM_VALUE_LIST	NULL
>  READ_ONLY	YES
>  COMMAND_LINE_ARGUMENT	REQUIRED
> +VARIABLE_NAME	INNODB_BUF_DUMP_STATUS_FREQUENCY
> +SESSION_VALUE	NULL
> +GLOBAL_VALUE	0
> +GLOBAL_VALUE_ORIGIN	COMPILE-TIME
> +DEFAULT_VALUE	0
> +VARIABLE_SCOPE	GLOBAL
> +VARIABLE_TYPE	BIGINT UNSIGNED
> +VARIABLE_COMMENT	A number between [0, 100] that tells how oftern buffer pool dump status in percentages should be printed. E.g. 10 means that buffer pool dump status is printed when every 10% of number of buffer pool pages are dumped. Default is 0 (only start and end status is printed).

please, no unrelated changes. If you want to fix forgotten result files,
do it in a separate commit.

> +NUMERIC_MIN_VALUE	0
> +NUMERIC_MAX_VALUE	100
> +NUMERIC_BLOCK_SIZE	0
> +ENUM_VALUE_LIST	NULL
> +READ_ONLY	NO
> +COMMAND_LINE_ARGUMENT	REQUIRED
>  VARIABLE_NAME	INNODB_BUF_FLUSH_LIST_NOW
>  SESSION_VALUE	NULL
>  GLOBAL_VALUE	OFF
> diff --git a/sql/sql_table.cc b/sql/sql_table.cc
> index 954970d..f18e6a2 100644
> --- a/sql/sql_table.cc
> +++ b/sql/sql_table.cc
> @@ -9772,7 +9772,7 @@ static bool check_engine(THD *thd, const char *db_name,
>    DBUG_ENTER("check_engine");
>    handlerton **new_engine= &create_info->db_type;
>    handlerton *req_engine= *new_engine;
> -  handlerton *enf_engine= thd->variables.enforced_table_plugin ?  plugin_hton(thd->variables.enforced_table_plugin) : NULL;
> +  handlerton *enf_engine= thd->variables.enforced_table_plugin ?  plugin_hton(thd->variables.enforced_table_plugin) : global_system_variables.enforced_table_plugin ? plugin_hton(global_system_variables.enforced_table_plugin) : NULL;

Please, no. Global variable should not be used like that, it simply sets
a default value for the session variable for new connections.

The way you've done it now, one cannot disable enforced_table_plugin per
session at all.

>    bool no_substitution= thd->variables.sql_mode & MODE_NO_ENGINE_SUBSTITUTION;
>    *new_engine= ha_checktype(thd, req_engine, no_substitution);

Regards,
Sergei