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:
None 
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
Description:
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.
  */

  DBUG_EXECUTE_IF("emulate_empty_datadir_param",
                  { 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
assertion.
[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] MySQL Verification Team
Hi,

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.