MySQL 8.4.2
Source Code Documentation
Controlling the Binary Log Format Used for Tests

Table of Contents

The server can do binary logging using statement-based logging (SBL), which logs events as statements that produce data changes, or row-based logging (RBL), which logs events as changes to individual rows. It also supports mixed logging, which switches between SBL and RBL automatically as necessary.

The server's global binlog_format system variable indicates which log format is in effect. It has possible values of STATEMENT, ROW, and MIXED (not case sensitive). This system variable can be set at server startup by specifying --binlog_format=value on the command line or in an option file. A user who has the SUPER privilege can change the log format at runtime. For example:

SET GLOBAL binlog_format = STATEMENT;

Some tests require a particular binary log format. You can exercise control over the binary log format in two ways:

  • To control the log format that the server uses for an entire test run, you can pass options to mysql-test-run.pl that tell it which format mysqld should use.
  • To verify that a particular log format is in effect for a specific test case, you can use an appropriate include file that checks the current format and exits if the format is other than what is required.

The following sections describe how to use these techniques.