Bug #79539 Unnecessary condition for "Unknown system variable 'SERVER_UUID' on master."
Submitted: 7 Dec 2015 5:28 Modified: 7 Dec 2015 13:47
Reporter: tsubasa tanaka (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Replication Severity:S3 (Non-critical)
Version:5.7.9 OS:Any
Assigned to: CPU Architecture:Any

[7 Dec 2015 5:28] tsubasa tanaka
Description:
MySQL 5.6 displays an error when its master doesn't support SERVER_UUID(ex. Master is 5.5 and slave is 5.6)

https://github.com/mysql/mysql-server/blob/5.6/sql/rpl_slave.cc#L1904-L1911

By the way, MySQL 5.7 still have this condition but 5.7 will never display this message.

https://github.com/mysql/mysql-server/blob/5.7/sql/rpl_slave.cc#L2382-L2390

Because of that, MySQL 5.6 checks master has server_uuid by "SHOW GLOBAL VARIABLES LIKE 'SERVER_UUID'".
This can return empty result without error. This condition seems correct.

https://github.com/mysql/mysql-server/blob/5.6/sql/rpl_slave.cc#L1858-L1861

But MySQL 5.7 checks it by "SELECT @@GLOBAL.SERVER_UUID".
This can't return empty result. When master doesn't support server_uuid, then this query returns error.

https://github.com/mysql/mysql-server/blob/5.7/sql/rpl_slave.cc#L2337-L2339

After that, these lines are not used.
https://github.com/mysql/mysql-server/blob/5.7/sql/rpl_slave.cc#L2382-L2390

How to repeat:
Construct 5.5's master and 5.7's slave and "START SLAVE".

```
                Last_IO_Error: Fatal error: The slave I/O thread stops because a fatal error is encountered when it tries to get the value of SERVER_UUID variable from master.
```

This behavior has already explained at Bug #79272, but unnecessary code is still there.

Suggested fix:
Remove unnecessary else-if-condition.
[7 Dec 2015 13:47] MySQL Verification Team
Thank you for the bug report.