From d3d38d0b14e6ad4acfcd89a7ef8c6b7eaef23e8a Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 13 Jul 2007 01:55:04 -0400 Subject: [PATCH] When opening a new connecgtion, changed mysqltest to prefer a brand new connection slot over an existing, closed slot. Fixes a problem with reused slots that can cause tests to fail. bug#29579 client/mysqltest.c: When opening a new connecgtion, changed mysqltest to prefer a brand new connection slot over an existing, closed slot. Fixes a problem with reused slots that can cause tests to fail. --- client/mysqltest.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/client/mysqltest.c b/client/mysqltest.c index 2e964056a73..d1ec753b54b 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -3777,14 +3777,14 @@ void do_connect(struct st_command *command) if (find_connection_by_name(ds_connection_name.str)) die("Connection %s already exists", ds_connection_name.str); - - if (!(con_slot= find_connection_by_name("-closed_connection-"))) + + if (next_con != connections_end) + con_slot= next_con; + else { - if (next_con == connections_end) + if (!(con_slot= find_connection_by_name("-closed_connection-"))) die("Connection limit exhausted, you can have max %d connections", (int) (sizeof(connections)/sizeof(struct st_connection))); - - con_slot= next_con; } if (!mysql_init(&con_slot->mysql))