diff options
author | unknown <guilhem@mysql.com> | 2005-10-05 12:21:53 +0200 |
---|---|---|
committer | unknown <guilhem@mysql.com> | 2005-10-05 12:21:53 +0200 |
commit | e0c38d58f573164eff8a0865127cd87b9b3c42b3 (patch) | |
tree | e7689f0d91328c37bc985b83382fc85630db3e6a /client | |
parent | 91f2db942ff58306e704e5f18f4d79fe994ed670 (diff) | |
download | mariadb-git-e0c38d58f573164eff8a0865127cd87b9b3c42b3.tar.gz |
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.
Diffstat (limited to 'client')
-rw-r--r-- | client/mysqltest.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/client/mysqltest.c b/client/mysqltest.c index 19a44b0f24c..35408368a73 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -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; } |