← Back to team overview

maria-developers team mailing list archive

Re: 269328884e5: MDEV-21365: Check $MARIADB_HOME/my.cnf in addition to $MYSQL_HOME/my.cnf

 

Hi, Rucha!

On Mar 22, Rucha Deodhar wrote:
> revision-id: 269328884e5 (mariadb-10.5.2-269-g269328884e5)
> parent(s): 46fab5b32a8
> author: Rucha Deodhar <rucha.deodhar@xxxxxxxxxxx>
> committer: Rucha Deodhar <rucha.deodhar@xxxxxxxxxxx>
> timestamp: 2021-03-22 16:18:18 +0530
> message:
> 
> MDEV-21365: Check $MARIADB_HOME/my.cnf in addition to $MYSQL_HOME/my.cnf
> 
> Currently for the server, we only check if $MYSQL_HOME is set. Added a check
> if $MARIADB_HOME is set and try to read the configuration file from this
> directory.
> To keep behavior consistent with MariaDB Connector/C, checking $MARIADB_HOME
> after $MYSQL_HOME.

The patch is fine. But the commit comment says exactly the opposite of
what you've implemented. You check MARIADB_HOME before MYSQL_HOME (which
is correct), not after. Please fix the comment and ok to push.

> diff --git a/mysys/my_default.c b/mysys/my_default.c
> index c76ab8c6eb1..ec94aee290c 100644
> --- a/mysys/my_default.c
> +++ b/mysys/my_default.c
> @@ -1051,8 +1051,17 @@ static const char **init_default_directories(MEM_ROOT *alloc)
>  
>  #endif
>  
> -  if ((env= getenv("MYSQL_HOME")))
> +  /* 
> +    If value of $MARIADB_HOME environment variable name is NULL, check
> +    for $MYSQL_HOME
> +  */
> +  if ((env= getenv("MARIADB_HOME")))
>      errors += add_directory(alloc, env, dirs);
> +  else
> +  {
> +    if ((env= getenv("MYSQL_HOME")))
> +      errors += add_directory(alloc, env, dirs);
> +  }
>  
>    /* Placeholder for --defaults-extra-file=<path> */
>    errors += add_directory(alloc, "", dirs);
> 
Regards,
Sergei
VP of MariaDB Server Engineering
and security@xxxxxxxxxxx