diff options
author | unknown <sasha@mysql.sashanet.com> | 2000-11-27 11:13:05 -0700 |
---|---|---|
committer | unknown <sasha@mysql.sashanet.com> | 2000-11-27 11:13:05 -0700 |
commit | d95ec59726ad44cc26bee2e32c9bffa0052b0a51 (patch) | |
tree | 66e0033b6a729fa25769f98640f7ec7b1bfc719f /client | |
parent | 241e25389f99fa5a536ac3a0bb50d269ec637f07 (diff) | |
parent | 7648e3bc3c3dd27f97b878760938f748499fd378 (diff) | |
download | mariadb-git-d95ec59726ad44cc26bee2e32c9bffa0052b0a51.tar.gz |
Merge work.mysql.com:/home/bk/mysql
into mysql.sashanet.com:/home/sasha/src/bk/mysql
sql/mysql_priv.h:
Auto merged
sql/mysqld.cc:
Auto merged
sql/slave.cc:
Auto merged
sql/sql_class.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_table.cc:
Auto merged
Diffstat (limited to 'client')
-rw-r--r-- | client/mysqltest.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/client/mysqltest.c b/client/mysqltest.c index 3d8b72c5ae4..dd024bb339b 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -78,6 +78,7 @@ struct query }; static void die(const char* fmt, ...); +int close_connection(struct query* q); int hex_val(int c) @@ -155,6 +156,30 @@ int select_connection(struct query* q) return 1; } +int close_connection(struct query* q) +{ + char* p, *name; + struct connection *con; + p = (char*)q->q + q->first_word_len; + while(*p && isspace(*p)) p++; + if(!*p) + die("Missing connection name in connect\n"); + name = p; + while(*p && !isspace(*p)) + p++; + *p = 0; + + for(con = cons; con < next_con; con++) + if(!strcmp(con->name, name)) + { + mysql_close(&con->mysql); + return 0; + } + + die("connection '%s' not found in connection pool", name); + return 1; +} + /* this one now is a hack - we may want to improve in in the future to handle quotes. For now we assume that anything that is not @@ -851,6 +876,8 @@ int main(int argc, char** argv) do_connect(&q); else if(check_first_word(&q, "connection", 10)) select_connection(&q); + else if(check_first_word(&q, "disconnect", 10)) + close_connection(&q); else if(check_first_word(&q, "source", 6)) do_source(&q); else if(check_first_word(&q, "sleep", 5)) |