Bug #100809 log_bin variable description in 8.0 is little confusing
Submitted: 11 Sep 2020 7:29 Modified: 15 Oct 2020 14:56
Reporter: Chelluru Vidyadhar Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:8.0.x OS:Any
Assigned to: CPU Architecture:Any

[11 Sep 2020 7:29] Chelluru Vidyadhar
Description:
The description provided for log_bin in mysql 8.0 documentation is as follows:

"Shows the status of binary logging on the server, either enabled (ON) or disabled (OFF). With binary logging enabled, the server logs all statements that change data to the binary log, which is used for backup and replication. ON means that the binary log is available, OFF means that it is not in use."

https://dev.mysql.com/doc/refman/8.0/en/replication-options-binary-log.html#sysvar_log_bin

>> Here the last statement (ON means that the binary log is available, OFF means that it is not in use) may cause confusion around ON and OFF being considered as values to log_bin.

The same variable description in MySQL 5.7 and earlier versions is very clear enough.

"Whether the binary log is enabled. If the --log-bin option is used, then the value of this variable is ON; otherwise it is OFF. This variable reports only on the status of binary logging (enabled or disabled); it does not actually report the value to which --log-bin is set. "

https://dev.mysql.com/doc/refman/5.7/en/replication-options-binary-log.html#sysvar_log_bin

>> As you can see the the second statement is very clear enough (If the --log-bin option is used, then the value of this variable is ON; otherwise it is OFF). 

How to repeat:
none 

Suggested fix:
Please consider to update the documentation (8.0) accordingly
[11 Sep 2020 7:56] MySQL Verification Team
Hello Chelluru,

Thank you for the report and feedback.

regards,
Umesh
[15 Oct 2020 14:56] Margaret Fisher
Posted by developer:
 
Thanks for your comment. The way this system variable works has changed in MySQL 8.0 so the description is not the same. The full description explains what is going on:

 Shows the status of binary logging on the server, either enabled (ON) or disabled (OFF). With binary logging enabled, the server logs all statements that change data to the binary log, which is used for backup and replication. ON means that the binary log is available, OFF means that it is not in use. The --log-bin option can be used to specify a base name and location for the binary log.

In earlier MySQL versions, binary logging was disabled by default, and was enabled if you specified the --log-bin option. From MySQL 8.0, binary logging is enabled by default, with the log_bin system variable set to ON, whether or not you specify the --log-bin option. The exception is if you use mysqld to initialize the data directory manually by invoking it with the --initialize or --initialize-insecure option, when binary logging is disabled by default. It is possible to enable binary logging in this case by specifying the --log-bin option.

If the --skip-log-bin or --disable-log-bin option is specified at startup, binary logging is disabled, with the log_bin system variable set to OFF. If either of these options is specified and --log-bin is also specified, the option specified later takes precedence.

- So --log-bin only now affects the value of log_bin in one specific scenario, which is described in detail. You do need to use the full explanation now to understand what is happening with the relationship between these system variables, and it is not the same as in MySQL 5.7.