Commit e55fb3bb authored by unknown's avatar unknown

Fix mysqltest printing of include stack.

The printing of include stack in the error case in mysqltest omitted the
bottom of the stack (the line number in original test case file), and instead
printed the top of the stack twice. Fix to print each element on the stack
once and only once.
parent 984fa23b
...@@ -1270,12 +1270,17 @@ static void cleanup_and_exit(int exit_code) ...@@ -1270,12 +1270,17 @@ static void cleanup_and_exit(int exit_code)
void print_file_stack() void print_file_stack()
{ {
for (struct st_test_file* err_file= cur_file; struct st_test_file* err_file= cur_file;
err_file != file_stack; if (err_file == file_stack)
err_file--) return;
for (;;)
{ {
err_file--;
fprintf(stderr, "included from %s at line %d:\n", fprintf(stderr, "included from %s at line %d:\n",
err_file->file_name, err_file->lineno); err_file->file_name, err_file->lineno);
if (err_file == file_stack)
break;
} }
} }
......
...@@ -334,10 +334,10 @@ included from MYSQLTEST_VARDIR/tmp/recursive.sql at line 1: ...@@ -334,10 +334,10 @@ included from MYSQLTEST_VARDIR/tmp/recursive.sql at line 1:
included from MYSQLTEST_VARDIR/tmp/recursive.sql at line 1: included from MYSQLTEST_VARDIR/tmp/recursive.sql at line 1:
included from MYSQLTEST_VARDIR/tmp/recursive.sql at line 1: included from MYSQLTEST_VARDIR/tmp/recursive.sql at line 1:
included from MYSQLTEST_VARDIR/tmp/recursive.sql at line 1: included from MYSQLTEST_VARDIR/tmp/recursive.sql at line 1:
included from MYSQLTEST_VARDIR/tmp/recursive.sql at line 1: included from <stdin> at line 1:
At line 1: Source directives are nesting too deep At line 1: Source directives are nesting too deep
mysqltest: In included file "MYSQLTEST_VARDIR/tmp/error.sql": mysqltest: In included file "MYSQLTEST_VARDIR/tmp/error.sql":
included from MYSQLTEST_VARDIR/tmp/error.sql at line 1: included from <stdin> at line 1:
At line 1: query 'garbage ' 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 'garbage' at line 1 At line 1: query 'garbage ' 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 'garbage' at line 1
2 = outer loop variable after while 2 = outer loop variable after while
...@@ -433,7 +433,7 @@ while with string, only once ...@@ -433,7 +433,7 @@ while with string, only once
1 1
Testing while with not Testing while with not
mysqltest: In included file "MYSQLTEST_VARDIR/tmp/mysqltest_while.inc": mysqltest: In included file "MYSQLTEST_VARDIR/tmp/mysqltest_while.inc":
included from MYSQLTEST_VARDIR/tmp/mysqltest_while.inc at line 65: included from <stdin> at line 1:
At line 64: Nesting too deeply At line 64: Nesting too deeply
mysqltest: At line 1: missing '(' in while mysqltest: At line 1: missing '(' in while
mysqltest: At line 1: missing ')' in while mysqltest: At line 1: missing ')' in while
...@@ -484,10 +484,10 @@ mysqltest: At line 1: Illegal argument for port: 'illegal_port' ...@@ -484,10 +484,10 @@ mysqltest: At line 1: Illegal argument for port: 'illegal_port'
mysqltest: At line 1: Illegal option to connect: SMTP mysqltest: At line 1: Illegal option to connect: SMTP
200 connects succeeded 200 connects succeeded
mysqltest: In included file "MYSQLTEST_VARDIR/tmp/mysqltest.sql": mysqltest: In included file "MYSQLTEST_VARDIR/tmp/mysqltest.sql":
included from MYSQLTEST_VARDIR/tmp/mysqltest.sql at line 3: included from <stdin> at line 1:
At line 3: connection 'test_con1' not found in connection pool At line 3: connection 'test_con1' not found in connection pool
mysqltest: In included file "MYSQLTEST_VARDIR/tmp/mysqltest.sql": mysqltest: In included file "MYSQLTEST_VARDIR/tmp/mysqltest.sql":
included from MYSQLTEST_VARDIR/tmp/mysqltest.sql at line 2: included from <stdin> at line 1:
At line 2: Connection test_con1 already exists At line 2: Connection test_con1 already exists
show tables; show tables;
ERROR 3D000: No database selected ERROR 3D000: No database selected
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment