Bug #88576 incorrect binlog file name handling with multiple dots in file name
Submitted: 21 Nov 2017 6:20 Modified: 11 Sep 2018 0:31
Reporter: Andrew Dalgleish Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Logging Severity:S3 (Non-critical)
Version:5.7 OS:Any
Assigned to: CPU Architecture:Any
Triage: Needs Triage: D4 (Minor)

[21 Nov 2017 6:20] Andrew Dalgleish
Description:
The log_bin_basename file name handling is incorrect if there is more than one dot in the file name.

log-bin=correct.horse.battery.staple

mysql [localhost] {msandbox} ((none)) > SHOW GLOBAL VARIABLES LIKE 'log_bin%';
| log_bin                         | ON                                                    |
| log_bin_basename                | /home/vagrant/sandboxes/msb_5_7_20/data/correct       |
| log_bin_index                   | /home/vagrant/sandboxes/msb_5_7_20/data/correct.index |

mysql [localhost] {msandbox} ((none)) > SHOW MASTER LOGS;
+-----------------------+-----------+
| Log_name              | File_size |
+-----------------------+-----------+
| correct.horse.battery |       154 |
| correct.horse.battery |       154 |
+-----------------------+-----------+
2 rows in set (0.00 sec)

 ls -al data/correct*
-rw-r-----. 1 vagrant vagrant 1523 Nov 21 16:52 data/correct.horse.battery
-rw-r-----. 1 vagrant vagrant   72 Nov 21 16:52 data/correct.index

How to repeat:
Test with:
log-bin=correct.horse.battery.staple

mysql [localhost] {msandbox} ((none)) > SHOW GLOBAL VARIABLES LIKE 'log_bin%';
| log_bin                         | ON                                                    |
| log_bin_basename                | /home/vagrant/sandboxes/msb_5_7_20/data/correct       |
| log_bin_index                   | /home/vagrant/sandboxes/msb_5_7_20/data/correct.index |

mysql [localhost] {msandbox} ((none)) > SHOW MASTER LOGS;
+-----------------------+-----------+
| Log_name              | File_size |
+-----------------------+-----------+
| correct.horse.battery |       154 |
| correct.horse.battery |       154 |
+-----------------------+-----------+
2 rows in set (0.00 sec)

ls -al data/correct*
-rw-r-----. 1 vagrant vagrant 1523 Nov 21 16:52 data/correct.horse.battery
-rw-r-----. 1 vagrant vagrant   72 Nov 21 16:52 data/correct.index

Test with
log-bin=.correct.horse.battery.staple
mysql [localhost] {msandbox} ((none)) > SHOW GLOBAL VARIABLES LIKE 'log_bin%';
+---------------------------------+------------------------------------------------+
| Variable_name                   | Value                                          |
+---------------------------------+------------------------------------------------+
| log_bin                         | ON                                             |
| log_bin_basename                | /home/vagrant/sandboxes/msb_5_7_20/data/       |
| log_bin_index                   | /home/vagrant/sandboxes/msb_5_7_20/data/.index |
| log_bin_trust_function_creators | OFF                                            |
| log_bin_use_v1_row_events       | OFF                                            |
+---------------------------------+------------------------------------------------+
5 rows in set (0.00 sec)

mysql [localhost] {msandbox} ((none)) > FLUSH LOGS;
Query OK, 0 rows affected (0.14 sec)

mysql [localhost] {msandbox} ((none)) > SHOW MASTER LOGS;
+------------------------+-----------+
| Log_name               | File_size |
+------------------------+-----------+
| .correct.horse.battery |       154 |
| .correct.horse.battery |       154 |
+------------------------+-----------+
2 rows in set (0.00 sec)

ls -al data/.correct.horse.battery data/.index
-rw-r-----. 1 vagrant vagrant 207 Nov 21 17:00 data/.correct.horse.battery
-rw-r-----. 1 vagrant vagrant  50 Nov 21 17:00 data/.index
[21 Nov 2017 6:52] Andrew Dalgleish
Similar issues with relay-log=correct.horse.battery.staple etc.
[11 Sep 2018 0:31] Andrew Dalgleish
Duplicate of bug 75507