MySQL 8.4.2
Source Code Documentation
Specifying Test Case-Specific Bootstrap Options

If a test has to run with a particular value of a bootstrap variable such as --innodb-page-size or --innodb-data-file-path, the option can be passed on the command line while running mysql-test-run.pl.

For example, consider a test that can only run with --innodb-page-size=8k. The test can be run like this:

shell> ./mysql-test-run.pl test_name_8k --initialize=--innodb-page-size=8k

This will initialize the data directory with 8k page size, and start the server with that value.

It is also possible to pass bootstrap options in the master.opt file of the test, so that the test can run with the specified value of the bootstrap options without using any command line arguments. The usage is:

--initialize --innodb-page-size=8k

or

--initialize=--innodb-page-size=8k

Specifying bootstrap variables in the opt file is the preferred method.

Each bootstrap variable must be specified as the value of a --initialize option in the opt file to ensure mysql-test-run.pl recognizes that the variable must be used during server initialization. If there are bootstrap options in the file, the current data directory is deleted, and initialized again with the options set in the file. The server is also started with the bootstrap options passed along with the other options in the opt file.

Similarly, bootstrap options passed in the slave.opt will be used to reinitialize the slave server in replication scenarios.

Bootstrap options set in the opt file are passed to the server first, followed by the server options. So, server start up options have precedence over bootstrap options, regardless of the order in which they are set in the opt file.

Note that since the bootstrap options are passed in the opt files, they have precedence over the command line bootstrap options. So, if a test has a master.opt file containing --innodb-page-size=8k, and while it is being run, --innodb-page-size=4k is passed on the command line, the test will run with 8k page size.

Some tests require the server to be restarted multiple times with different server options, as well different bootstrap options. In such cases, the existing data directory is deleted inside the test and a new data directory is initialized with the bootstrap options. When the server is started with the bootstrap options after this, the SQL queries will run with the specified options.

--exec $MYSQLD --no-defaults --initialize-insecure
--lc_messages_dir=$MYSQL_SHAREDIR --innodb_page_size=8K
--basedir=$MYSQLD_BASEDIR --datadir=$MYSQL_TMP_DIR/datadir1/data
--init-file=$BOOTSTRAP_SQL --secure-file-priv=""