Bug #116239 include/assert_grep.inc is wrong
Submitted: 26 Sep 2024 8:39 Modified: 14 Mar 17:03
Reporter: Ke Yu (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:Tools: MTR / mysql-test-run Severity:S3 (Non-critical)
Version:8.0.39 OS:Any
Assigned to: CPU Architecture:Any
Tags: Contribution

[26 Sep 2024 8:39] Ke Yu
Description:
include/assert_grep.inc is wrong.

This is a serious bug, it can cause test cases that invoke the include/assert_grep.inc file 
to produce results that do not meet expectations.

How to repeat:
1. run the test binlog_cache_write_failure, it will pass

./mtr binlog.binlog_cache_write_failure

2. modified the assert_count to 100 in suite/binlog/t/binlog_cache_write_failure.test.

--- a/mysql-test/suite/binlog/t/binlog_cache_write_failure.test
+++ b/mysql-test/suite/binlog/t/binlog_cache_write_failure.test
@@ -116,7 +116,7 @@ SET SESSION debug = "-d,fault_injection_reinit_io_cache_while_flushing_to_file";
 
 # Check that error is present in error log
 --let $assert_file= $MYSQLTEST_VARDIR/log/mysqld.1.err
---let $assert_count = 1
+--let $assert_count = 100
 --let $assert_select = An error occurred during flush stage of the commit. 'binlog_error_action' is set to 'IGNORE_ERROR'.
 --let $assert_text = An error occurred during flush stage of the commit. 'binlog_error_action' is set to 'IGNORE_ERROR'.

3. run the test binlog_cache_write_failure again, it will also pass. This is wrong!

./mtr binlog.binlog_cache_write_failure

4. Check the error log, "An error occurred during flush stage of the commit. 'binlog_error_action' is set to 'IGNORE_ERROR'." 
only appeared once which is not as expected,

Suggested fix:
commit aff77ab3c1116d0474f8a164efa129c7022a49e3 makes include/assert_grep.inc wrong.
[26 Sep 2024 9:45] MySQL Verification Team
Hello Ke Yu,

Thank you for the report and feedback.

regards,
Umesh
[27 Sep 2024 2:05] Ke Yu
This is my fix code, based on 8.0.39

(*) I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.

Contribution: 116239.diff (application/octet-stream, text), 1.12 KiB.

[27 Nov 2024 7:09] MySQL Verification Team
Thank you for your contribution.

regards,
Umesh
[14 Mar 17:03] Jon Stephens
Documented fix as follows in the MySQL 9.3.0 changelog:

    An error in include/assert_grep.inc could lead to erroneous
    results from any file that included it.

    Out thanks to Ke Yu for the contribution.

Closed.