Bug #82125 @@basedir sysvar value not normalized if set through the command line/INI file
Submitted: 6 Jul 2016 12:16 Modified: 13 Jul 2016 14:03
Reporter: Georgi Kodinov Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Options Severity:S3 (Non-critical)
Version:5.7 OS:Any
Assigned to: CPU Architecture:Any

[6 Jul 2016 12:16] Georgi Kodinov
Description:
If the basedir is set explicitly through on the command line or in the INI file then the @@basedir system variable reflects exactly what's being set and not the normalized directory name (i.e. replace "/" with "\" on windows etc). 
If the basedir is left to its default value it gets properly normalized.

How to repeat:
On windows:
c:\> mysqld ... --basedir=S:/ade\git/mysql-5.7/bld\sql

Inspect @@basedir:

mysql> select @@basedir;
+-------------------------------+
| @@basedir                     |
+-------------------------------+
| S:/ade\git/mysql-5.7/bld\sql  |
+-------------------------------+
1 row in set (0.19 sec)

Suggested fix:
When processing the --basedir option in mysqld.cc:get_one_option() also re-assign mysql_home_ptr as it's done for e.g. mysql_real_data_home/mysql_real_data_home_ptr or lc_messages_dir/lc_messages_dir_ptr
[13 Jul 2016 14:03] Paul DuBois
Posted by developer:
 
Noted in 5.6.33, 5.7.15 changelogs.

If the basedir system variable was set at server startup from the
command line or option file, the value was not normalized (on
WIndows, / was not replaced with /).
[11 Sep 2016 2:49] Paul DuBois
Revised changelog (typo spotted by Valeriy):

If the basedir system variable was set at server startup from the
command line or option file, the value was not normalized (on
Windows, / was not replaced with \).