Commit 8a291efb authored by guilhem@mysql.com's avatar guilhem@mysql.com

The "exit" command of mysqltest is quite useful when writing tests for 4.1 so...

The "exit" command of mysqltest is quite useful when writing tests for 4.1 so I'm porting it from 5.0 to 4.1.
parent e6043231
...@@ -294,6 +294,7 @@ Q_DISPLAY_VERTICAL_RESULTS, Q_DISPLAY_HORIZONTAL_RESULTS, ...@@ -294,6 +294,7 @@ Q_DISPLAY_VERTICAL_RESULTS, Q_DISPLAY_HORIZONTAL_RESULTS,
Q_QUERY_VERTICAL, Q_QUERY_HORIZONTAL, Q_QUERY_VERTICAL, Q_QUERY_HORIZONTAL,
Q_START_TIMER, Q_END_TIMER, Q_START_TIMER, Q_END_TIMER,
Q_CHARACTER_SET, Q_DISABLE_PS_PROTOCOL, Q_ENABLE_PS_PROTOCOL, Q_CHARACTER_SET, Q_DISABLE_PS_PROTOCOL, Q_ENABLE_PS_PROTOCOL,
Q_EXIT,
Q_DISABLE_RECONNECT, Q_ENABLE_RECONNECT, Q_DISABLE_RECONNECT, Q_ENABLE_RECONNECT,
Q_IF, Q_IF,
...@@ -381,6 +382,7 @@ const char *command_names[]= ...@@ -381,6 +382,7 @@ const char *command_names[]=
"character_set", "character_set",
"disable_ps_protocol", "disable_ps_protocol",
"enable_ps_protocol", "enable_ps_protocol",
"exit",
"disable_reconnect", "disable_reconnect",
"enable_reconnect", "enable_reconnect",
"if", "if",
...@@ -3744,7 +3746,7 @@ int main(int argc, char **argv) ...@@ -3744,7 +3746,7 @@ int main(int argc, char **argv)
{ {
int error = 0; int error = 0;
struct st_query *q; struct st_query *q;
my_bool require_file=0, q_send_flag=0, query_executed= 0; my_bool require_file=0, q_send_flag=0, query_executed= 0, abort_flag= 0;
char save_file[FN_REFLEN]; char save_file[FN_REFLEN];
MY_STAT res_info; MY_STAT res_info;
MY_INIT(argv[0]); MY_INIT(argv[0]);
...@@ -3825,7 +3827,7 @@ int main(int argc, char **argv) ...@@ -3825,7 +3827,7 @@ int main(int argc, char **argv)
*/ */
var_set_errno(-1); var_set_errno(-1);
while (!read_query(&q)) while (!abort_flag && !read_query(&q))
{ {
int current_line_inc = 1, processed = 0; int current_line_inc = 1, processed = 0;
if (q->type == Q_UNKNOWN || q->type == Q_COMMENT_WITH_COMMAND) if (q->type == Q_UNKNOWN || q->type == Q_COMMENT_WITH_COMMAND)
...@@ -4028,6 +4030,9 @@ int main(int argc, char **argv) ...@@ -4028,6 +4030,9 @@ int main(int argc, char **argv)
case Q_ENABLE_RECONNECT: case Q_ENABLE_RECONNECT:
cur_con->mysql.reconnect= 1; cur_con->mysql.reconnect= 1;
break; break;
case Q_EXIT:
abort_flag= 1;
break;
default: processed = 0; break; default: processed = 0; break;
} }
......
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