Documentation Home
The MySQL Test Framework, Version 2.0
Download this Manual
PDF (US Ltr) - 0.5Mb
PDF (A4) - 0.5Mb
EPUB - 126.7Kb


The MySQL Test Framework, Version 2.0  /  Writing Test Cases  /  Controlling the Binary Log Format Used for Tests

4.12 Controlling the Binary Log Format Used for Tests

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.