MySQL 8.0 MTR: ‘require’, is now an invalid mysqltest command

Some of the users may have noticed that .require files do not exist anymore in the MySQL test suite.

A .require is file is used along with 'require' mysqltest command. In test cases, the command 'require' is used to ensure MTR performs certain sanity checks. 'require' command takes filename as the argument, generally a file with require extension and compares its content with the result of next query executed in the test case. A .require file is more like a result file for the next query executed in a test case.

First let us look at an example of how the 'require' command is used to perform a sanity check. Consider an include file '' which checks whether the server is debug build.

And the require file, 'have_debug.require' has the following content:

The way this works is that 'require' command in the include file causes the result of the next query executed to be written to a temporary file and then its contents is compared with the contents of the file passed as argument to the 'require' command, 'have_debug.require' in the above case.

This causes overhead in the test execution due to file comparison. It causes overall increase in the test suite execution time. Also there are issues on Windows where a test can fail simply because of DOS/UNIX line ending differences.

In MySQL 8.0.1, we have stopped providing support for 'require' command and removed all the .require files. The necessary checks are implemented in the corresponding include files and skip mysqltest command is used to skip a test case if the check is unsuccessful.

The modified include file '' looks like this now.

Here the necessary check is done without creating a temporary file, hence avoiding the file comparison between the temporary file and the .require file. Also there is no risk of DOS/UNIX line ending differences.

Thank you for using MTR..!

About Pavan Naik

Pavan Naik has been working with Oracle MySQL team since 2013. He is a Senior Member Technical Staff for the ServerQA team and responsible for maintaining and enhancing MTR test tool, qualifying optimizer and GIS features.

One thought on “MySQL 8.0 MTR: ‘require’, is now an invalid mysqltest command

Leave a Reply

Your email address will not be published. Required fields are marked *

Please enter * Time limit is exhausted. Please reload CAPTCHA.