Bug #79117 "change_user" command should be aware of preceding "error" command
Submitted: 4 Nov 2015 9:39 Modified: 20 Jan 2016 14:24
Reporter: Laurynas Biveinis (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:Tools: MTR / mysql-test-run Severity:S3 (Non-critical)
Version:5.7.9 OS:Any
Assigned to: CPU Architecture:Any
Tags: mysqltest

[4 Nov 2015 9:39] Laurynas Biveinis
Description:
"change_user" MTR command does not handle preceding "error". Some testcases could use it, and there is at least one testcase that tries to depend on it, failing silently.

How to repeat:
Run main.audit_plugin_2 of 5.7.9. It passes. Then find the following snippet there:

--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
--error ER_AUDIT_API_ABORT
--change_user user2,,mysql
SELECT USER(), CURRENT_USER();

Remove the --error line, re-run the testcase, note that it passes the same.

Additionally, grep the testsuite for constructs like
--error 1
--exec echo "--change_user root,,inexistent" | $MYSQL_TEST 2>&1
which could be simplified if change_user supported error

Suggested fix:
Make do_change_user call handle_error instead of die in case of failure in client/mysqltest.cc
[4 Nov 2015 9:59] Laurynas Biveinis
Bug 79118 for bogus testcase.
[4 Nov 2015 11:41] MySQL Verification Team
Hello Laurynas,

Thank you for the report.

Thanks,
Umesh
[20 Jan 2016 14:24] Paul DuBois
Fixed in 5.7.12.

Changes for test suite. No changelog entry needed.