summaryrefslogtreecommitdiff
path: root/client/mysqltest.c
diff options
context:
space:
mode:
Diffstat (limited to 'client/mysqltest.c')
-rw-r--r--client/mysqltest.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/client/mysqltest.c b/client/mysqltest.c
index 3287c9738d3..02982e8e37f 100644
--- a/client/mysqltest.c
+++ b/client/mysqltest.c
@@ -229,11 +229,11 @@ Q_ENABLE_INFO, Q_DISABLE_INFO,
Q_ENABLE_METADATA, Q_DISABLE_METADATA,
Q_EXEC, Q_DELIMITER,
Q_DISPLAY_VERTICAL_RESULTS, Q_DISPLAY_HORIZONTAL_RESULTS,
-Q_QUERY_VERTICAL, Q_QUERY_HORIZONTAL,
+Q_QUERY_VERTICAL, Q_QUERY_HORIZONTAL, Q_EXIT,
Q_UNKNOWN, /* Unknown command. */
Q_COMMENT, /* Comments, ignored. */
-Q_COMMENT_WITH_COMMAND
+Q_COMMENT_WITH_COMMAND,
};
/* this should really be called command */
@@ -308,6 +308,7 @@ const char *command_names[]=
"horizontal_results",
"query_vertical",
"query_horizontal",
+ "exit",
0
};
@@ -2592,12 +2593,11 @@ int main(int argc, char **argv)
{
int error = 0;
struct st_query *q;
- my_bool require_file=0, q_send_flag=0;
+ my_bool require_file=0, q_send_flag=0, abort_flag= 0;
char save_file[FN_REFLEN];
MY_INIT(argv[0]);
{
DBUG_ENTER("main");
- DBUG_PROCESS(argv[0]);
save_file[0]=0;
TMPDIR[0]=0;
@@ -2653,7 +2653,7 @@ int main(int argc, char **argv)
init_var_hash(&cur_con->mysql);
- 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)
@@ -2813,6 +2813,9 @@ int main(int argc, char **argv)
case Q_EXEC:
(void) do_exec(q);
break;
+ case Q_EXIT:
+ abort_flag= 1;
+ break;
default: processed = 0; break;
}
}