You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
BUG#11766444 : MTR PRINTS WRONG FILE AND LINE NUMBER WHEN TESTS FAIL
Description :
=============
When a test case fails, MTR sometimes prints the wrong line number.
This happens if a test case fails inside a while loop and it is not
the first iteration of the loop.
E.g:
----
--let $i = 2
while ($i)
{
dec $i;
if (!$i)
{
execute this invalid query;
}
}
When executing the above test case, MTR fails with the following
message:
mysqltest: At line 9: query 'execute this invalid query' failed: 1064:
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 'invalid query' at line 1
Note that the error was on line 7 but the test reports line 9.
Issue :
=======
The variable 'start_lineno' keeping track of the current line number
in a test is not updated after the first iteration and hence printing
the line number of the last line of the loop.
Fix :
=====
Introduced a new variable 'lineno' in 'st_command' structure to keep
track of the the line number for each command. During the iteration
after the first one, use this variable to update the 'start_lineno'
variable to the current line number.
Reviewed-by: Deepa Dixit <[email protected]>
Reviewed-by: Srikanth B R <[email protected]>
RB: 16015
Copy file name to clipboardExpand all lines: mysql-test/r/mysqltest.result
+4Lines changed: 4 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1526,3 +1526,7 @@ Hello
1526
1526
# Outer while condition evalutes to false
1527
1527
# "Hello" shouldn't be repeated
1528
1528
Hello
1529
+
#
1530
+
# BUG#11766444 : MTR PRINTS WRONG FILE AND LINE NUMBER WHEN TESTS FAIL
1531
+
#
1532
+
mysqltest: At line 7: query 'execute this invalid query' failed: 1064: 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 'invalid query' at line 1
0 commit comments