Commit e0c38d58 authored by unknown's avatar unknown

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 91f2db94
......@@ -294,6 +294,7 @@ Q_DISPLAY_VERTICAL_RESULTS, Q_DISPLAY_HORIZONTAL_RESULTS,
Q_QUERY_VERTICAL, Q_QUERY_HORIZONTAL,
Q_START_TIMER, Q_END_TIMER,
Q_CHARACTER_SET, Q_DISABLE_PS_PROTOCOL, Q_ENABLE_PS_PROTOCOL,
Q_EXIT,
Q_DISABLE_RECONNECT, Q_ENABLE_RECONNECT,
Q_IF,
......@@ -381,6 +382,7 @@ const char *command_names[]=
"character_set",
"disable_ps_protocol",
"enable_ps_protocol",
"exit",
"disable_reconnect",
"enable_reconnect",
"if",
......@@ -3744,7 +3746,7 @@ int main(int argc, char **argv)
{
int error = 0;
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];
MY_STAT res_info;
MY_INIT(argv[0]);
......@@ -3825,7 +3827,7 @@ int main(int argc, char **argv)
*/
var_set_errno(-1);
while (!read_query(&q))
while (!abort_flag && !read_query(&q))
{
int current_line_inc = 1, processed = 0;
if (q->type == Q_UNKNOWN || q->type == Q_COMMENT_WITH_COMMAND)
......@@ -4028,6 +4030,9 @@ int main(int argc, char **argv)
case Q_ENABLE_RECONNECT:
cur_con->mysql.reconnect= 1;
break;
case Q_EXIT:
abort_flag= 1;
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