Bug #43137 mysqltest: Let --error expand variables
Submitted: 24 Feb 2009 10:36 Modified: 11 Aug 2009 8:29
Reporter: Jørgen Austvik Email Updates:
Status: Duplicate Impact on me:
None 
Category:Tools: MTR / mysql-test-run Severity:S4 (Feature request)
Version: OS:Any
Assigned to: Bjørn Munch CPU Architecture:Any

[24 Feb 2009 10:36] Jørgen Austvik
Description:
It would (to create include files and reduce code duplication) be good to let --errors parse $variables.

Today:

let $errors=1, 2, 3
--error $errors

gives:

mysqltest: At line 50: Invalid argument to error: '$errors' - the errno may only consist of digits[0-9]

eval --error $errors

gives:

ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '--error 1, 2, 3

There are no users of this in the test suite today (also a good sign that it isn't supported):

bash-3.2$ ggrep -r "\-\-error" * | grep "[$]" | grep -v "mysqltest\.test"
bash-3.2$ 

How to repeat:
Run a small test that contains:

let $errors=1, 2, 3
--error $errors

Suggested fix:
Parse $variable in --error expressions
[29 Apr 2009 11:48] Valeriy Kravchuk
Thank you for the feature request.
[11 Aug 2009 8:29] Bjørn Munch
Duplicate of the newer Bug #46528. I was not aware of this one due to its initial category.