以前对 MySQL 测试框架 MTR 的使用,主要集中于 SQL 正确性验证。近期由于工作需要,深入了解了 MTR 的方方面面,发现 MTR 的能力不仅限于此,还支持单元测试...
mysql-test-run.pl:perl 脚本,简称 mtr,是 MySQL 最常用的测试工具,负责控制流程,包括启停、识别执行哪些用例、创建文件夹、收集结果等等,主要作用是验证 SQL 语句在各种场景下是否返回正确的结果。 mysqltest:C++二进制程序,负责执行测试用例,包括读文件、解析特定语法、执行用例。用例的特殊语法(比如,--source,-...
--replace_regex /pattern/replacement/[i] ... example: --replace_regex /.*mysql.*// 这样下一行语句的实际输出中就没有包含“mysql”的行,对应的修改预期结果即可。 忽略日志的warning和error 加命令行参数--nowarnings。 忽略日志的某些输出 call mtr.add_suppression("The table 't[0-9]*' is full"...
release_all() : mtr_t::Command, net::io_context::AsyncOps Release_all_locking_service_locks() : Release_all_locking_service_locks release_all_locks_for_name() : MDL_context release_anonymous_ownership() : Gtid_state release_auto_inc_if_possible() : Partition_share release_auto_increment(...
For example: shell> export MTR_BUILD_THREAD=31 shell> ./mysql-test-run.pl [options] [test_name] mysql-test-run.pl defines several environment variables. Some of them are listed in the following table. +---+---+ |Variable | Meaning | +---+---+ |MYSQL_TEST | Path name to mysql...
To runmysql-test-run.plon Windows, you'll need either Cygwin or ActiveState Perl to run it. You may also need to install the modules required by the script. To run the test script, change location into themysql-testdirectory, set theMTR_VS_CONFIGenvironment variable to the configuration yo...
To run the test script, change location into the mysql-test directory, set the MTR_VS_CONFIG environment variable to the configuration you selected earlier (or use the --vs-config option), and invoke mysql-test-run.pl. For example (using Cygwin and the bash shell): shell> cd mysql-test...
string) = '$old_auth_str' FROM mysql.user WHERE user LIKE 'user1' # [KH] replacetest #--replace_regex /AS '(.*)' REQUIRE/AS '<non-deterministic-password-hash>' REQUIRE/ --replace_regex / = '(.*)'FROM/ = '<non-deterministicpassword-hash>' FROM/ --let $post_binlog_...
以前对 MySQL 测试框架 MTR 的使用,主要集中于 SQL 正确性验证。近期由于工作需要,深入了解了 MTR 的方方面面,发现 MTR 的能力不仅限于此,还支持单元测试、压力测试、代码覆盖率测试、内存错误检测、线程竞争与死锁等功能,因此,本着分享的精神,将其总结成一个系列。
replace.c 替换文本文件或管道中的字符串 resolve_stack_dump.c 显示来自MySQL堆栈转储的符号信息,通常在mysql.err文件中找到 resolveip.c 将IP地址转换为主机名,反之亦然 include 大多数库的头文件( .h)包括随MySQL二进制发行版一起发行的所有头文件。 这些文件可能包含在C程序文件中。请注意,每个目录也将具有...