Bug #91887 Redundant code around mysql_real_data_home_ptr in rpl_make_log_name()
Submitted: 3 Aug 2018 10:29 Modified: 3 Aug 2018 12:34
Reporter: Alexey Kopytov Email Updates:
Status: Verified Impact on me:
Category:MySQL Server: Options Severity:S3 (Non-critical)
Version:5.7.22, 8.0.13 OS:Any
Assigned to: CPU Architecture:Any

[3 Aug 2018 10:29] Alexey Kopytov
Came across the following code in mysqld.cc:rpm_make_log_name(). The
same code is present in both 5.7.22 and 8.0.13:

  /* mysql_real_data_home_ptr may be null if no value of datadir has been
     specified through command-line or througha cnf file. If that is the
     case we make mysql_real_data_home_ptr point to mysql_real_data_home
     which, in that case holds the default path for data-dir.

                  { mysql_real_data_home_ptr = NULL; };);

  if (mysql_real_data_home_ptr == NULL)
    mysql_real_data_home_ptr = mysql_real_data_home;

I believe all of that is now unnecessary, because of the fix for bug #60995.

How to repeat:
Read the code. Notice that mysql_real_data_home_ptr can never be null
after the fix for bug #60995. Which makes the code and the associated
test case redundant. It could all be replaced with a single debug
[3 Aug 2018 10:30] Alexey Kopytov
Correction: the function name is rpl_make_log_name().
[3 Aug 2018 10:30] Alexey Kopytov
[3 Aug 2018 12:34] Sinisa Milivojevic

Thank you for your bug report ...

I have analysed the fix for the bug #60995 and this report and I think that you are quite right.

Verified as reported.