Description:
When
--error An_expected_error
is separated from the following query merely by the end of if-{}-block mark,
that is by the closing '}', like here
if (1)
{
--error ER_BAD_TABLE_ERROR
}
DROP TABLE that_does_not_exist_either;
The expected error won't be counted by mysqltest, so the test just [ fail ],
like query 'DROP TABLE that_does_not_exist_either' failed: 1051: Unknown table 'test.that_does_not_exist_either'
Notice 1051 is exactly ER_BAD_TABLE_ERROR.
This mysqltest parsing behaviour does not look correct, and should be
explained and rectified.
How to repeat:
# The first block to work out as expected
--error ER_BAD_TABLE_ERROR
DROP TABLE that_does_not_exist;
# The 2nd to [ fail ], as described
if (1)
{
--error ER_BAD_TABLE_ERROR
}
DROP TABLE that_does_not_exist_either;
Suggested fix:
Make sure not detach --error from the following query even if
there's '}' closing, or '{' opening symbol or a compound block ahead.
Description: When --error An_expected_error is separated from the following query merely by the end of if-{}-block mark, that is by the closing '}', like here if (1) { --error ER_BAD_TABLE_ERROR } DROP TABLE that_does_not_exist_either; The expected error won't be counted by mysqltest, so the test just [ fail ], like query 'DROP TABLE that_does_not_exist_either' failed: 1051: Unknown table 'test.that_does_not_exist_either' Notice 1051 is exactly ER_BAD_TABLE_ERROR. This mysqltest parsing behaviour does not look correct, and should be explained and rectified. How to repeat: # The first block to work out as expected --error ER_BAD_TABLE_ERROR DROP TABLE that_does_not_exist; # The 2nd to [ fail ], as described if (1) { --error ER_BAD_TABLE_ERROR } DROP TABLE that_does_not_exist_either; Suggested fix: Make sure not detach --error from the following query even if there's '}' closing, or '{' opening symbol or a compound block ahead.